cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

Community Helping Community

388
Views
10
Helpful
9
Replies
Beginner

UCCX 10.6 - Looking for script that transforms callerid before check it against a database

I am looking to do a script that takes the callerid of the inbound caller and check it against a database before to route the calls to any CSQ. My problem is 
the callerid is presented in a regular format, area code + phone number, and the dabatase is configured with (area code) + phone number. i.e: 1133189999 received  
from PSTN, and configured at the database as (11)33139999. 
How can i use set step on the script to include () to the area code before consult the database ?

Thanks !!!

9 REPLIES 9
Contributor

Hi- You should be able to use

Hi-

 

You should be able to use a set step using the below value to accomplish this assuming you are not in a region with a variable length dial plan:

 

"("+ callingNumber .substring(0,2)+")"+callingNumber .substring(3,10)

 

Thanks,

DJ

Highlighted
Beginner

You may also want to check

You may also want to check that the number is 10 digits long before applying your manipulation and checking it against the DB (If callingNumber.length() == 10).

Beginner

Hi Guys,Thank you very much

Hi Guys,

Thank you very much for your help, again. The calling number is always 11 digits. I receive the calling number from PSTN as 0+citycode+extension number,

ie: 07332158490. I need to have this number transformed to (73)32158490.

 

Regards,

 

Contributor

Hi- Take a look at the screen

Hi-

 

Take a look at the screen shot from my post three days ago. That should get you there.

 

Thanks,

DJ

Beginner

Hi DJ,I applied your

Hi DJ,

I applied your suggestion. Find below the result:

 

07332158490 --> 7332158490. The correct result would be (73)32158490

 

Thanks,

Luis.

Contributor

Hi Luis- Sorry, perhaps I

Hi Luis-

 

Sorry, perhaps I should have been a bit more clear.  You'll need to start with stripping the 0 and then from there you can format the number using the other set step.  

 

Does that make sense?

 

DJ

Beginner

Hi Guys,Thanks for help but

Hi Guys,

Thanks for help but it seems which is not working fine yet. Find below the results from set step.

calling number - 07332158490

after set step - (07)3215849 

The correct translation should result in (73)32158490.

 

Thanks,

Beginner

In your original example, you

In your original example, you have a 10-digit calling number (1133189999); now you have an 11-digit calling number (07332158490), so the callingNumber.substring(3,10) is chopping off the last digit.

You could change it to callingNumber.substring(3,11) or you could use callingNumber.substring(3) and it should take the rest of the digits starting with the third one, independent of how many digits are in the string.

Contributor

Hi You would need to provide

Hi

 

You would need to provide more detail on the possible inbound numbers, but my method for dealing with calls that come in with a '+' or leading '0' can be seen in the screenshot. 

 

EDIT:  This assumes that 0 is not a valid start for an area code in your corner of the world. 

 

Thanks,

DJ

CreatePlease to create content
Content for Community-Ad
FusionCharts will render here