Logicwrath Posted March 11, 2016 Report Share Posted March 11, 2016 I have a specific need to automatically change the caller id based on the destination number. A specific customer has 7 or 8 numbers in multiple area codes and likes to change the caller id based on which area code they are calling.I have been creating call flows using postman to try and solve this because patterns and the set_cid module are not available in Monster.The problem is that my pattern is not matching/working. If I create the exact same call flow using numbers, the set_cid module works. If I switch to patterns, it always chooses the default caller id.Here is the JSON I am using to create the call flow: http://pastebin.com/91QSUnDfI have tried 3-4 different patterns. As soon as I use numbers instead, the call flow functions correctly. It appears that something else is matching first like no_match. I assume this because I can see different recording URLs in the call logs.If I post the pattern with a * in front like ^\\*(1586\d{7})$ the correct call flow will get matched but the call is sent with the * and fails.Can anyone help me understand what I am doing wrong? Link to comment Share on other sites More sharing options...
Karl Stallknecht Posted March 11, 2016 Report Share Posted March 11, 2016 If you get this working, please let me know. We have a few customers who would love to be able to do this but we haven't been able to get it to work in the past unfortunately. Link to comment Share on other sites More sharing options...
Logicwrath Posted March 16, 2016 Author Report Share Posted March 16, 2016 I did solve this issue, and I plan on posting the solution to somewhere in the community soon. I suspect I will post it to the Github that Darren was talking about yesterday once it is setup/released. Link to comment Share on other sites More sharing options...
esoare Posted March 17, 2016 Report Share Posted March 17, 2016 I would love to see this to! Link to comment Share on other sites More sharing options...
Administrators Darren Schreiber Posted March 18, 2016 Administrators Report Share Posted March 18, 2016 So to follow up on the Wiki, we discussed this yesterday.Github has a Wiki. It also lets you fork it so you can always have a copy and never fear where it goes. Plus you can download it offline.So we're going to use our Kazoo Wiki and I'm working on laying out sections I think you guys want filled there. I'll keep you posted. This solution is cool because you can edit inline on the webpage, or download it and edit offline in your favorite editor. And we can track revisions.Will this work? Link to comment Share on other sites More sharing options...
Logicwrath Posted March 18, 2016 Author Report Share Posted March 18, 2016 Yes, this works for me. It likely will not be searchable via the community, however, that may not be necessary for people to use it. Link to comment Share on other sites More sharing options...
Administrators Darren Schreiber Posted March 18, 2016 Administrators Report Share Posted March 18, 2016 Why would it not be searchable? Not sure I understand. Link to comment Share on other sites More sharing options...
Logicwrath Posted March 19, 2016 Author Report Share Posted March 19, 2016 I just meant from the community searchbox from this website.---As far as my solution for dynamic outbound caller id. I can post it here for now.Create a call flow using Postman and the API. Here is an example of the call flow data:http://pastebin.com/js3uba9qEdit the following php file with the caller id's you want to match.http://pastebin.com/hAsdSQqUYou can set a logging variable to dump the headers and the other important variables to a text file.The call flow dialing pattern should match anything with a * and 10 or 11 digits. *15558675309So instead of pressing 1 for country code people can do * and use the dynamic matching pivot script. I have not put this into production yet. I stopped looking at it when it worked a few times. Link to comment Share on other sites More sharing options...
Logicwrath Posted April 5, 2016 Author Report Share Posted April 5, 2016 I wanted to add that in order for this to work you cannot set a company caller id in Smart PBX. I am not sure if that is by design or not. I would prefer to have this override the main company caller ID.This also requires per minute calling as it will not make use of the trunk limits. I am also not sure if this is by design. In my use cases I would prefer to make use of trunk limits. My plans specify trunk limits.custom_channel_vars.reseller_billingper_minuteYou should also specify a default case match in the pivot file to specify your default caller id on on-matches. Link to comment Share on other sites More sharing options...
Logicwrath Posted April 6, 2016 Author Report Share Posted April 6, 2016 It's worth mentioning, that you can create a dial plan in Bria that will automatically prefix the number with a * before it sends.---I am however, having an issue with this again. If I place a call using this pivot call flow the call will end exactly at 20 seconds.I placed a pivot call to myself and used wireshark to better see what types of SIP messages were going back and forth. The picture on the left is my soft phone receiving the call and the image on the right is my soft phone placing the call.http://prntscr.com/aozyn6You can also see an example of the TWIML response that gets generated by the Pivot script here:http://pastebin.com/yTUeiR6jI assume other people successfully use pivot to dial calls, the response from the pivot script is super basic, what am I missing here?I tried 2 different soft phones Bria and Ninja with the same behaviour. Session timers are disabled in Bria and so are inactivity timers. Link to comment Share on other sites More sharing options...
Logicwrath Posted April 6, 2016 Author Report Share Posted April 6, 2016 It gets worse when you consider that you have to leave the company caller id field unset to use the pivot script in the first place. So if you want to let the users decide when to use the dynamic outbound caller id option, they will not have a caller id set when they do not use the pivot script.I may have to set a company caller id and disable the pivot script until I figure out what is going on.Does this sound like a bug?I could avoid pivot all together if we had regex patterns in call flows and there was a set caller id object. Link to comment Share on other sites More sharing options...
Logicwrath Posted April 7, 2016 Author Report Share Posted April 7, 2016 The problem is with my TWIML response. I needed to specify a longer timeout attribute. For example: timeout="60". This fixed the dropped calls at 20 seconds.<Dial timeout="60" callerId="<?php echo $callerid ?>"> Link to comment Share on other sites More sharing options...
Recommended Posts