cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
2845
Views
0
Helpful
7
Replies
Senthil Kumar Sankar
Cisco Employee

Converting Hexadecimal to String in ICM Script

Hi All,

We have UCCE 8.0 setup, I am passing a Custom SIP Header to ICM, and the parameter of the header consists of the UUI Hexadecimal value.

Now in the ICM script i need to convert this Hexadecimal Value to actual String, Can someone guide how i can create a custom function in ICM inorder to complete this task.

Regards,

Senthil

7 REPLIES 7
Senthil Kumar Sankar
Cisco Employee

Hi All,

Have anyone ever worked on the above scenario. Can someone guide me

Regards,

Senthil

Hi All,

In CVP Configuration file, i have the below configuration

# Whether to convert the UUS from hex to ascii.

SIP.UUSHexToAscii = true

We have Custom Sip header passing to ICM and below is the update in config file

The Sip header which we were passing is given below

# The list of SIP Header names and values.

SIP.HeaderValue = CustomSip

Can we add another configuration as below if i want to conver the value from Hex to Ascii

# Whether to convert the UUS from hex to ascii.

SIP.UUSHexToAscii = true

SIP.CustomSipHexToAscii = true

Someone guide me please.

Regards,

Senthil

I'm not sure about the custom headers part, but converting hex to ascii is probably best handled by a peripheral (IP IVR/CVP) so you can use Java to do it.  The only way I could imagine doing this in ICM is to have a massive custom function which parses every value then does a if/then check to replace the hex with ascii.  This will not be pretty and it will probably take a long time to get the custom formular right.  Also, not sure if such a long custom formula would be supported.

david

Hi All,

Is there any command in the Voice Gateway to accomplish the below task.

When the Call hits in the CUBE and when matches the Incoming Dial-Peer and we see the below UUI header information in the SIP INVITE

User-to-User: 30303931323436;encoding=hex

When the call goes out thru the Outbound Dial-peer, is there a way i can convert this back to String.

Have anyone tried this via Sip Normalization. Can someone give me a clue.

Regards,

Senthil

Hi Senthil,

Were you able to find a solution for the Hex to String converison?

Thanks,

Simranjeet

If you are only receiving numbers in the UUI string, you can use the attached ICM custom function to convert it. This script converts up to 24 ASCII characters (that's 48 hex characters when represented in ICM). This script uses the fact that ASCII 0 - 9 characters are 30 - 39 in hex, so we can just use every other number.

If you need to convert specific letters or symbols as well, you can could do that with a more complex ICM custom function, but they are very limited and won't work with any kind of recursion or if custom functions call other custom functions more than a few times in a script. 

If you need to convert most or all ASCII characters, you'd need to do it in Java in an IVR application.

 

Edit: I have attached a new script that safely ignores any ASCII character except numerical digits; so, it works the same as the first script but will skip over hex characters that are not ASCII 0 - 9.

Ok, I have figured the max amount of abridged hex-to-ascii code we can do in ICM custom functions (therefore, this is pretty much the max that ICM can do) is 19 ASCII characters of 0-9,A-Z,a-z. You could do more character lenght if you recognize fewer ASCII character hex values, or you could add recognition for more types of characters and further limit the number of total characters your can recognize. That might be nice actually, if you needed a few extra characters like a comma or period or plus sign, but at a max length of 16 - 18 ASCII output characters.

FYI, ICM custom functions are limited to 30,000 characters and 32 stacked function calls (you can only stack/chain up to 32 function calls within each other). Modularizing the code doesn't help, either, and actually seems to further limit how much you can get done with this code.

I put all this code into a bitbucket repository so it's easier to manage, and you can get updates that I might make to the code in the future.

https://bitbucket.org/juxe/icm-hex-to-ascii/

Create
Recognize Your Peers
Content for Community-Ad