11-30-2009 07:31 AM - edited 03-14-2019 04:55 AM
Hi,
I have a question regarding uccx feature.
Our customer would like to implement an IVR with the following criteria:
A PSTN phone calls my customer at number 999 which is a CTI_RP for IVR.
The IVR begins and asked the caller to press an "office code" in order to reach an external PSTN phone. So if the caller enters the DTMF "55" for instance, he's redirected to a PSTN number "YYYYYYYY". If he enters the DTMF "44", he's redirected to a PSTN number "XXXXXXXX" and so on and so on...
My question is: Is there a way to set the value "PSTN number" depending of the DTMF entered bay the caller ? For my customer I need 200 different location (external number) ?
Is it possible to have this kind of behaviour ? What's the design ?
Thank you
Regards
Fabian
Solved! Go to Solution.
12-02-2009 06:47 AM
Oops, my bad. This should have said:
"/office_root/office[code=" + YOURVARIABLE + "]/redirect"
If YOURVARIABLE is within the quotes, it will be passed as a part of the literal string. You need to concatinate the string, variable, and the rest of the string together.
11-30-2009 07:44 AM
Is there any pattern to the PSTN numbers? You could have a very big IF statement with 200 different options, or if there's a pattern you could do some math and have a function which constructs the PSTN number then dials it.
david
11-30-2009 07:54 AM
Sure. The easiest ways would be an XML file in the document repository; or, an ODBC connection to another database server. You can retrieve the value from an XML file using Xpath; or, the database using SQL.
11-30-2009 07:59 AM
11-30-2009 08:05 AM
Hi,
Xml file seems the easiest way to test the solution.
Is there any documentation/link explaining how to configure such a xml file ? (or a template)
Thx
Fabian
11-30-2009 09:01 AM
It's documented, sort of, in the CCX Step Editor Reference. You need to create a valid XML file and then parse it with Xpath.
Example XML:
55
44
In the script you need to get the document from the repository with a Create XML Document step. Once you've done that, you can then use the Get XML Document Data step with Xpath to pull the variable you want.
To continue the example, the XML Path would be "/office_root/office[code = YOURVARIABLE]/redirect" where YOURVARIABLE is the office code supplied by the caller.
You'll need to do some exception handling if a match is not found.
11-30-2009 09:18 AM
Ok. thx for your post.
I'll try it tomorrow.
One more question regarding the size of the xml file.
If I set 200 different data in the file, will it work without any issue ?
I don't know the right behaviour, but if the script need to scan over the 200 value in the file each time there's a incoming call, it may impact server performance... right ?
Thanks again
11-30-2009 09:22 AM
That's the purpose of Xpath. The entire is loaded into memory (that's unavoidable); however, the script is only selecting a single value from it. The script is not looping through every possible element looking for a match. Xpath addresses that.
Having said that, you should be concious of the size of this XML file in memory. It will be loaded for every concurrent call in to the JVM. There is no sizing tool for this, you'll just have to keep an eye on it. I would not anticipate this being a problem unless you have cut the server sizing close elsewhere.
12-01-2009 01:56 AM
Hi again,
Thx for your answer.
However I did some test this morning, and I can't make it work. I follow the CRS editor guide and your advice.
I've posted an attachment (it's a very basic script). If you have a little time to have a look, maybe you would be able to help me (I guess it's just the XML Path which is wrong).
Thx again
Fabian
12-02-2009 02:25 AM
Hi again,
I did more test with the XML Path, and here is the result:
My variable from the 'get digit' step is a String named "dtmf"
test1:
"/office_root/office[code= dtmf]/redirect" ==> script error during test
test2:
"/office_root/office[code= 'dtmf']/redirect" ==> script error during test
test3:hardcoded a value
"/office_root/office[code= 55]/redirect" ==> Works fine. redirect to the right number
So I guess the syntax [code= dtmf] or [code= 'dtmf'] doesn' t take the value of the variable 'dtmf'.
So is there anything I did wrong ?
Any idea ?
Thx
Fabian
12-02-2009 06:47 AM
Oops, my bad. This should have said:
"/office_root/office[code=" + YOURVARIABLE + "]/redirect"
If YOURVARIABLE is within the quotes, it will be passed as a part of the literal string. You need to concatinate the string, variable, and the rest of the string together.
12-02-2009 06:53 AM
Works Perfect
Thx for your time
Fabian
05-23-2010 01:27 PM
Hi Jonathan,
Thanks for the excellent Post!
Maybe you can help me with one more thing.
Using these example ("/office_root/office[code=" + YOURVARIABLE + "]/redirect") Suppose that i have in XML code1, code2 , code3 tag and YOURVARIABLE could be in one of these tags.
So my question is how can i do that? Can i use an OR operator?
"/office_root/office[code1 & code2 & code3 =" + YOURVARIABLE + "]/redirect"
Thanks
Best Regards
MC
05-24-2010 04:54 AM
I have not tested this scenario; however, according to the syntax rules that I am aware of, you should be able to use a wildcard as follows:
"/office_root/office[* ='" + YOURVARIABLE + "']/redirect"
This translates to "find any redirect element that is a child of the office element with any attribute matching YOURVARIABLE.
A few things to note here:
05-24-2010 03:21 PM
Hi Jonathan,
Thanks for the quick answer. It works but without single quotes just "/office_root/office[* = " + YOURVARIABLE + "]/redirect".
My variable is calling_number that i have defined as a string type. Basically what i'm trying to do is searching these calling number in xml costumer element that have 3 atributes GSM PHONE, PROFESSIONAL PHONE, OTHER PHONE and with your solution it works.
you said that this presumes that i will never have two elements costumer (in previous example office) with same atributes values. If these happens it will get the information of first costumer element?
Best Regards
MC.
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