Andres Gomez
Customers-
Posts
77 -
Joined
-
Days Won
1
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
Thanks, I did see that. But I couldn't find a list of variables to verify the syntax. Would you be able to suggest an example based on what we are trying to do?
-
Hello guys, Has anyone used the Branch Variable call-flow option through the Monster UI? and if so can you guys share some guidance or business case around it? We tried to use it to enable and disable call-waiting on the server side, and branch out some different flows, but we weren't successful in finding the variables available to be used and whether they work. Thanks Andres
-
Andres Gomez started following Stir//Shaken Complaince and MSTeams Integration using TeamMate Connector
-
Andres Gomez started following CSV Onboarding
-
We had been fighting with that exact issue recently, and discover it was a codec miss match issue. Make sure the codecs in the app and kazoo match.
-
Advanced Provsioner Suggestion - Last Downloaded Config
Andres Gomez replied to esoare's topic in Tips and Feedback
I would like to see SPA112 as an avaiable cisco device to provision via advanced provisioner. -
Here's exactly what we did: 1) Create a callflow/pivot to react to *8 + 4-digit extension: curl -v -X PUT -H "X-Auth-Token: " -d '{"data":{"flow":{"data":{"method":"GET","req_timeout":"5","req_format":"kazoo","voice_url":"http://pivot.server/path/to/getGrpExtension.php","debug":false},"module":"pivot","children":{}},"numbers":[],"patterns":["^\\*8([0-9]*)$"],"featurecode":{"name":"Group Pickup","number":"8"},"contact_list":{"exclude":true}}}' http://{KAZOO_SERVER}/v2/accounts/{ACCOUNT_ID}/callflows The script getGrpExtension.php looks like: <code> <?php foreach ($_REQUEST as $key=>$value) { $$key = $value; } $accountID = $_REQUEST['Account-ID']; if(preg_match('/^\\*8/', $To)) { // Strip off the Feature Code (*8) from $To $extension = str_replace('*8','',$To); } header('content-type:application/json'); ?> { "module": "pivot", "data": { "voice_url": "http:/{SERVER}/path/to/verifyExtension.php?extension=<?php echo($extension); ?>&accountID=<?php echo($accountID); ?>" }, "children": {} } </code> As you can see, this script sends the Extension and {ACCOUNT_ID} to the next script. The code in verifyExtension.php looks like this: <code> <?php require_once('/path/to/getAuthToken.php'); $user_id = ""; foreach($_GET as $key=>$value) {$$key = $value;} $extension = $_GET['extension']; $accountID = $_GET['accountID']; $token = authenticateUser(); function fetchUserIDs($token, $accountID, $extension) { // We're checking for the extension (stored as "presdence_id") that was dialed, among the users of this account. If/when we find a match, we save the userID to put in the JSON message going back to Kazoo. $userID = ""; $PID = ""; $service_url = "http://{KAZOO_SERVER}/v2/accounts/$accountID/users"; $ch = curl_init($service_url); curl_setopt($ch, CURLOPT_HTTPHEADER, array("X-Auth-Token: $token")); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); if ($response === false) { $info = curl_getinfo($ch); curl_close($ch); die('error occured during curl exec. Additional info: ' . var_export($info)); } $decoded = json_decode($response); if (isset($decoded->response->status) && $decoded->response->status == 'ERROR') { die('error occured: ' . $decoded->response->errormessage); } $value = get_object_vars($decoded); $data = $value['data']; foreach($data as $obj) { $PID = $obj->presence_id; if($PID == $extension) { $userID = $obj->id; break; } } curl_close($ch); return($userID); } $user_id = fetchUserIDs($token, $accountID, $extension); header('content-type:application/json'); function valid($user_id){ // Is it -> "group_id":"$user_id" OR "user_id":"$user_id" ?? ?> {"module":"group_pickup_feature", "data":{"type":"extension","user_id": "<?php echo($user_id); ?>"} } <?php } if(strlen($user_id) > 1) {valid($user_id);} // If we didn't get a valid userID, just quit. ?> </code> We've tested this and it works perfectly.