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

UCCX Scripting, working with variables (re-type variables?!?)

Hi,

I've got single-language IVR script which distributes calls into two separate CSQ (services and logistics) based on caller input in IVR menu. Each CSQ contains several agents. There is sub-flow script which is checking if a current day is holiday (similar to Cisco example HolidayCheck.aef)

Now I have to expand this script and make it multilangual. Many aspects in the script like dates.xml to check, name of CSQ (each lang have services and logistics), lang for IVR prompts are exactly the same called wav files localized to specific national enviroment in different directories.

My idea is to parse input (IVR or by called number specific to each country) and on this basis set some variable named input_lang (string) with values "en", or "sk" or other). Then set other variables for right localization based on this input_lang variable.

I've variables for customization:

input_lang (String) = ""

holiday_datelist (Document) = DOC[]

ivr_lang (Language) = L[]

CSQ_service (String) = ""

CSQ_logistics (String) = ""

When I set variable input_lang, for example to "sk" (Slovak), I have other variables defined like:

set holiday_datelist = "DOC[dates-" + input_lang + ".xml]"

set ivr_lang = "L[" + input_lang + "]"

set CSQ_service = "CSQ_servis-" + input_lang

set CSQ_logistics = "CSQ_logistics-" + input_lang

But this result into this wierd values (not so wierd, because all of them are "String-like")

holiday_datelist = "DOC[dates-sk.xml]" instead of DOC[dates-sk.xml]

ivr_lang = "L[sk]" instead of L[sk]

etc.. but CSQs names are also strings and results are OK

Script halts and throws an exception of unidentified/error value of variable.

Is there any way how to re-type variable from string like representation to lang/document like? I think I have to get rid of those quotes in the beginning and end of value! I only want to concatenate variable values from sub strings based on each lang.

Or I'm following the bad way and this all have to be done in a different manner?

Thanx a lot for any advice!

(UCCX Enhanced, version 5.0.2)

2 ACCEPTED SOLUTIONS

Accepted Solutions

Re: UCCX Scripting, working with variables (re-type variables?!?

When I set variable input_lang, for example to "sk" (Slovak), I have other variables defined like:

set holiday_datelist = "DOC[dates-" + input_lang + ".xml]"

set ivr_lang = "L[" + input_lang + "]"

set CSQ_service = "CSQ_servis-" + input_lang

set CSQ_logistics = "CSQ_logistics-" + input_lang

I think you are on to something and just need to make some slight modifications.

1. Instead of assigning the "dates-sk.xml" directory to the document variable, assign it to a string that points to the filename and relevant path. Then initialize the document variable using the "Create File Document" step. This should get you over any humps with typcasting.

2. For language, would it make sense to use a "switch" statement like so:

Switch String (input_lang)

Connection:Slovak

set ivr_lang=L[sk]

Connection:en-uk

set ivr_lang=L[en-uk]

...

That may not be as efficient as the route you are planning to take this but it would work. The only time I messed with supporting multiple languages I used the JTAPI trigger. This would work for you if you went the route of choosing the language based on the "called number" (as you suggested was one possible path you would take). In this way, you can have multiple triggers pointing the same application and the Language variable would already be set on the trigger. You would still want to create/edit your variables. You would probably want to look at the .toString() and .getLanguage() expression editor methods.

HTH.

Regards,

Bill

HTH -Bill (b) http://ucguerrilla.com (t) @ucguerrilla

Please remember to rate helpful responses and identify

Re: UCCX Scripting, working with variables (re-type variables?!?

This is a bit complex for something UCCX supports natively.

Just go into the repositories and create a new language called sk.

Then place all of your sk documents/prompts/etc into the new language folders.

If you have an sk call in number, assign that trigger the sk language, otherwise, if it's just a menu option, use the set contact info step to change the contact's language to sk.

If you keep all the names of your prompts/documents/etc, the same, you actually don't have to modify anything in your script.

Consider the following english IVR that has an option for slovak:

menu(option_english + option_slovak @ l[sk])

     1 - english

          set contact info (language = l[en_US])

          set csq = "support_en"

     2 - slovak

          set contact info (language = l[sk])

          set csq = "support_sk"

play prompt(p[greeting])

get xml data (doc[dates.xml])

if (today == holiday)

     ...

select resource(csq)

     connected

          end

     queued

          play prompt(p[queued])

          moh

          ...

notice that I don't say where to get the greeting prompt, or the dates.xml document, or the queued prompt.  the script is going to take care of it for me, based on the contacts language.  You do however have to specify the csq name manually.  bummer.

it will even flow upwards towards the default folder if it cannot find the file it needs.  You can use this for language neutral settings or files.

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.
7 REPLIES

Re: UCCX Scripting, working with variables (re-type variables?!?

When I set variable input_lang, for example to "sk" (Slovak), I have other variables defined like:

set holiday_datelist = "DOC[dates-" + input_lang + ".xml]"

set ivr_lang = "L[" + input_lang + "]"

set CSQ_service = "CSQ_servis-" + input_lang

set CSQ_logistics = "CSQ_logistics-" + input_lang

I think you are on to something and just need to make some slight modifications.

1. Instead of assigning the "dates-sk.xml" directory to the document variable, assign it to a string that points to the filename and relevant path. Then initialize the document variable using the "Create File Document" step. This should get you over any humps with typcasting.

2. For language, would it make sense to use a "switch" statement like so:

Switch String (input_lang)

Connection:Slovak

set ivr_lang=L[sk]

Connection:en-uk

set ivr_lang=L[en-uk]

...

That may not be as efficient as the route you are planning to take this but it would work. The only time I messed with supporting multiple languages I used the JTAPI trigger. This would work for you if you went the route of choosing the language based on the "called number" (as you suggested was one possible path you would take). In this way, you can have multiple triggers pointing the same application and the Language variable would already be set on the trigger. You would still want to create/edit your variables. You would probably want to look at the .toString() and .getLanguage() expression editor methods.

HTH.

Regards,

Bill

HTH -Bill (b) http://ucguerrilla.com (t) @ucguerrilla

Please remember to rate helpful responses and identify

New Member

Re: UCCX Scripting, working with variables (re-type variables?!?

Thank you for your quick answer Will. I'll try it how you describe with pointing Document variable to the string

and making Language as a switch. You got it almost exactly how i though, idea is to have one universal script with multiple "triggering" numbers. The way you are suggesting as more applications with predefined variables is also possible but not so clean and universal.

What I've understood so far, re-typing variables and concatenating their name from Strings is impossible, isnt it?

Re: UCCX Scripting, working with variables (re-type variables?!?

I am not saying that is impossible. I just haven't attempted that approach with Document or Language variables. I have always done it the way I described, so I haven't had the inclination to look for alternatives. I did check quite several references when I researched your question and I did not see a way to convert.

HTH

Regards,

Bill

Please remember to rate helpful posts.

HTH -Bill (b) http://ucguerrilla.com (t) @ucguerrilla

Please remember to rate helpful responses and identify

New Member

Re: UCCX Scripting, working with variables (re-type variables?!?

(1) I don't fully understand how do you mean it. I'm still not able to set document like "DOC[" + variable_value + "]" But I've solved this similarly to (2).

(2) This aproach suits well.. I've done a few branches which depends on value of language_input variable (which can be set depending on called number, or at parameter at application web config) which set others variables to language specific.

Switch input_lang:

Connection:sk

Set holiday_datelist = DOC[dates-sk.xml]

Set ivr_lang = L[sk]

Set CSQ_service = CSQ_service_sk

Set noan_redir_num = "700" (used in redirect step in while when no agent available (logged in) or wait time exceed 45 sec, this is Pilot Hunt number of CUCM)

etc..

Connection: en

Set holiday_datelist = DOC[dates-en.xml]

Set ivr_lang = L[en]

Set CSQ_service = CSQ_service_cz

Set noan_redir_num = "701"

etc...

After this script is running with localized enviroment...

I'm looking forward to test it tomorrow on real CCX appliance to see correct call routing etc.!

Thanks for your help and ideas. If you figure out how to contatenate variable vaules from other variable values, please let me know. Also if you figure out how to use value of one variable and insert it as an "string" value definition of the other variable of another type (like Doc = DOC[test.xml] from Doc = "DOC[" + var + "]"), I would say simply retype them from string to definition of other variable.

Thanx anyway, and don't worry, I'll rate your helpful post.

Regards,

Jiri

Re: UCCX Scripting, working with variables (re-type variables?!?

Sorry if I wasn't being clear. For your document variable, I was thinking of something along these lines:

set myFileName = "Documents/user/" + ivr_lang + "/dates-" + ivr_lang + ".xml"

docDateList = Create File Document (myFileName)

docXML = Create XML Document (docDateList)

Parse the XML as you normally would, using methods like "Get XML Document Data".

In the above:

myFileName is a variable of type string that you are building in a manner similar to what is show.

docDateList is a variable of type Document that starts off with no set value

docXML is a variable of type Document that starts off with no set value

HTH.

Regards,

Bill

HTH -Bill (b) http://ucguerrilla.com (t) @ucguerrilla

Please remember to rate helpful responses and identify

Re: UCCX Scripting, working with variables (re-type variables?!?

This is a bit complex for something UCCX supports natively.

Just go into the repositories and create a new language called sk.

Then place all of your sk documents/prompts/etc into the new language folders.

If you have an sk call in number, assign that trigger the sk language, otherwise, if it's just a menu option, use the set contact info step to change the contact's language to sk.

If you keep all the names of your prompts/documents/etc, the same, you actually don't have to modify anything in your script.

Consider the following english IVR that has an option for slovak:

menu(option_english + option_slovak @ l[sk])

     1 - english

          set contact info (language = l[en_US])

          set csq = "support_en"

     2 - slovak

          set contact info (language = l[sk])

          set csq = "support_sk"

play prompt(p[greeting])

get xml data (doc[dates.xml])

if (today == holiday)

     ...

select resource(csq)

     connected

          end

     queued

          play prompt(p[queued])

          moh

          ...

notice that I don't say where to get the greeting prompt, or the dates.xml document, or the queued prompt.  the script is going to take care of it for me, based on the contacts language.  You do however have to specify the csq name manually.  bummer.

it will even flow upwards towards the default folder if it cannot find the file it needs.  You can use this for language neutral settings or files.

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.
New Member

Re: UCCX Scripting, working with variables (re-type variables?!?

Yes, that's exactly how I've done it!

Now I'm setting language not only for Prompts which have universal filenames, but for Documents also (both language directories had to be created in Document menu, else it always fell to default en_US directory). I was at first a little confused with directory structure which is under wfaavid: Documents\, Prompts\ instead of \Prompts, \Documents, ..

Thaks to both of you guys! It simply works,I'm beginning to like this stuff

7821
Views
9
Helpful
7
Replies
CreatePlease to create content