Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

Need to trim leading digits for DB Lookup - UCCX 7

Currently have a UCCX script that will be performing a DB lookup based on ANI, however, I've noticed that when my ANI comes in it is prefaced with a "91".  Rather than try and reconfigure what the gateway is accepting, I am wondering if it is possible to strip those 2 digits with Java language before sending it into the DB Read step using a Set command...I'm not too familiar with Java coding...Is this possible?

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Super Bronze

Need to trim leading digits for DB Lookup - UCCX 7

Hi

You can insert some Java for this... try something like this in a 'do' step (yourvariable swapped for your string var name containing ANI):

{

     if (yourvariable.startsWith("91"){

          return = yourvariable.substring(2,yourvariable.length());

     }

}

Aaron

Aaron Please remember to rate helpful posts to identify useful responses, and mark 'Answered' if appropriate!
4 REPLIES
Super Bronze

Need to trim leading digits for DB Lookup - UCCX 7

Hi

You can insert some Java for this... try something like this in a 'do' step (yourvariable swapped for your string var name containing ANI):

{

     if (yourvariable.startsWith("91"){

          return = yourvariable.substring(2,yourvariable.length());

     }

}

Aaron

Aaron Please remember to rate helpful posts to identify useful responses, and mark 'Answered' if appropriate!
Silver

Re: Need to trim leading digits for DB Lookup - UCCX 7

put your ani in a variable called AniStr and use the following in your set step

AniStr.substring(2)

Brian

edit - or what Aaron says

New Member

Re: Need to trim leading digits for DB Lookup - UCCX 7

Thanks to both of you...will use Brian's in the event all numbers come in with "91" prepended and jump to Aaron's if they do not

New Member

Hi Michael,

Hi Michael, I have task to write a script for DB lookup based on ANI, no idea how to start the script if you have similar script could you please help me? Thanks and best regards, Vinod
671
Views
10
Helpful
4
Replies
CreatePlease to create content