11-17-2017 09:11 AM - edited 03-14-2019 05:44 PM
We are having an issue with numbers calling in to our script as anonymous are not being routed. I debugged the script and found its failing at the part below:
We are using E.164 numbers so this is essentially stripping the +1 and forward the other 10 digits through.
Our customer wants to also be able to dial these numbers anonymously so I am wondering how in the script we can do that. Is it something like adding a check variable null and send it through? Is there a way to attach the script here? It is saying its not a valid extension. Thanks.
Solved! Go to Solution.
11-20-2017 01:58 PM
Yeah because your Set Step;
callingNumber = callingNumber.substring(2, 12)
Must contain 12 characters. The word 'anonymous' only has 9 characters. If you want to strip the first 2 digits/characters from the string, then your Set Step would look like this;
callingNumber = callingNumber.substring(2)
However, this wouldn't prevent the script from stripping the first 2 digits/characters from 'anonymous' either. In this case, the callingNumber would be 'onymous'. To avoid this, simply add an IF Statement (or Switch Statement) before the Set Step. Depending on the outcome of the IF/Switch Statement, you would then specify this step and everything else wouldn't be strip. Your IF/Switch Statement would look like this;
IF (callingNumber == "anonymous")
Or, like this;
IF (callingNumber.length() < 12)
Honestly, there's probably a dozen ways to resolve this particular problem. You should check CUIC Reporting for a history of calling numbers and account for those as well... for example, "unknown". Good Luck!
11-20-2017 01:58 PM
Yeah because your Set Step;
callingNumber = callingNumber.substring(2, 12)
Must contain 12 characters. The word 'anonymous' only has 9 characters. If you want to strip the first 2 digits/characters from the string, then your Set Step would look like this;
callingNumber = callingNumber.substring(2)
However, this wouldn't prevent the script from stripping the first 2 digits/characters from 'anonymous' either. In this case, the callingNumber would be 'onymous'. To avoid this, simply add an IF Statement (or Switch Statement) before the Set Step. Depending on the outcome of the IF/Switch Statement, you would then specify this step and everything else wouldn't be strip. Your IF/Switch Statement would look like this;
IF (callingNumber == "anonymous")
Or, like this;
IF (callingNumber.length() < 12)
Honestly, there's probably a dozen ways to resolve this particular problem. You should check CUIC Reporting for a history of calling numbers and account for those as well... for example, "unknown". Good Luck!
11-22-2017 08:15 AM
Thank you this worked for me.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide