05-25-2015 02:55 AM
Does ICM scripting have an Escape Character for a double quote?
e.g. so you can set double quote within a string
Example:
You want to set PeripheralVariable1 to the Value of : "Jane said "Hello""
The first and last double quotes contain a string which itself has two double quotes.
Is this possible to do?
Gerry
05-25-2015 08:02 AM
Can you instead use single quotes around the inner string?
05-25-2015 08:08 AM
Janine,
Single quotes are allowed, but I need double quotes for my use case.
I want to set a SIP header which contains a string value which includes double quotes.
My example above of setting PV1 to "Jane said "Hello"" is just a simple test case.
Ampersand (&) can be set when sending variables to CVP by using the semi colon.
I wonder if there is a similar way to send a double quote?
Gerry
06-01-2015 01:50 AM
Hi Gerry,
If you want to use double quotes, You can use two single quotes( ' ) together to replace double quotes.
I tested the same on my lab and found the positive results as needed in your case.
Below are the screenshots from my lab where I created a variable with value " Hello ''Welcome''". Also verified within the DB that the same value is dumping properly.
Let me know if this answers your query.
Regards
Hemant
06-02-2015 03:24 AM
Hemant,
That is an interesting and simple way to achieve this. So many thanks for your response.
Visually the two single quotes will LOOK the same a s double quote
But will they be interrupted the same?
Example - lets say you want to set a SIP header
ExampleSipHeader: "This is test data"
Will the above interpret these as double quotes by the endpoint / device that receives it or not?
What might occur with your workaround, is that it interprets it two single quotes, which is not necessary the same thing, even though visually they look the same.
I should be able to test using wireshark and confirm.
I will update later this week.
Gerry
06-02-2015 05:35 AM
Gerry,
I don't know of any ICM escape character, but here's one way you could get a quote character...
Certainly not the cleanest solution, but this is one potential way of getting the specific character you need. You could even go so far as to create an ASCII table in SQL which contains all or most of the 128 ASCII codes. Double Quotes would be "34" in that case.
I'd be curious to see what these write out to the Termination_Call_Detail table as... if there is an ICM escape character, it might show up when the data gets there.
-Jameson
06-02-2015 07:23 AM
Jameson,
I believe that solution would definitely work. It is a bit of a pain, but its looks like a good workaround.
I was thinking of something similar, by grabbing a double quote from the SIP header "Remote-Party-ID".
But your way is nicer.
ICM Lookups not supported on PCCE and I wonder if CVP Studio app can pass back a double quote or not?
Would need to test.
I will check both of options out in next week or so.
Many thanks for the responses guys!
Gerry
06-02-2015 07:43 AM
Gerry,
You'll probably have a lot of trouble passing any quotes from a CVP app - I believe quotes are not supported characters for VXML. Not sure if you can escape them or not.
Grabbing a quote from a known location in existing SIP headers is a good option. If you can do this reliably from a formula, you could make a custom formula to reproduce it for you. Storing the result in a persistent user variable is an option as well, though I'm thinking it would have to be redone after any complete Router process shutdown.
-Jameson
06-22-2015 04:13 PM
Hi Gerry,
maybe you can try use "%22" as escape character of double quote.
I once used the workaround to pass some special characters from ICM to CVP.
let's suppose you want to pass 123"abc to CVP
in ICM, you can set variable as "123%22abc"
it could be successfully passed to CVP without any issue.
then in CVP, you can easily access it using a custom element using java code.
in java code, you can just replace "%22" with double quote using "String.Replace" or you can user "URLEncoder" to do the same trick.
Bing.
06-24-2015 08:06 AM
Bing,
I tried %22. Nice idea, but It didn't work.
i.e. if you put set "22blah%22" into a SIP header, it comes up as %22blah%22 and not as "blah" as I want.
Gerry
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