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

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

ICM Scripting Basics

Hi All,


I have little experience in Cisco ICM, this is the first time am working on ICM scripting. Is their any documents to learn about formulae which we use in nodes in the script? any documentation would be appreciated.


Note : I have already have

Scripting and Media Routing Guide Cisco Unified ICM/Contact

Center Enterprise & Hosted Release 9.0(1)

Please let me know any other documents which says clearly about the formula usages..






Not aware of any such

Not aware of any such documents, i think there is no document for this.


but similar kind of course is available:

"Cisco IPCC Enterprise Advanced Scripting"


or you can also learn by your self by doing some lab assignment and walking through already deployed scripts.





New Member

HI,Its not lik am stuck in


Its not lik am stuck in some where on Scripting, am new to this. When I look script I can understand the flow but the formula written on the nodes is not getting understandable. below are some examples:


concatenate("application=A BC;MenuFlag=",Call.PeripheralVariable1,";callid=",Call.RouterCallDay,".",Call.RouterCallKey)




The above are the examples which I don't know what it does. Lookin for some help/documents to learn above things.




hi, first of all the



first of all the variables:

Call.RouterCallDay = value that indicates date on which Central controller processes the call

Call.RouterCallKey= it will be unique key for all the calls handled by software after midnight, Combination of Router Call key and Day will make call unique across all the calls.


now coming on to the function:

//concatenate("application=A BC;MenuFlag=",Call.PeripheralVariable1,";callid=",Call.RouterCallDay,".",Call.RouterCallKey)//

the concatenate() does concatenation of argument provided in example:

lets assume your:

PeripheralVariable1 = Y

RouterCallDay = 151027

RouterCallKey = 333


then the concatenation value will be : "application=ABC;Menuflag=Y,callid=151027.333"

most probably you will assign above value to some variable and pass it on.


in the same way:

substr(String s,i,j) function will fetch the sub string from s starting from word at place i to count of J word.


the output of 

substr("ABCDEFGHIJK",4,5) = "DEFGH"

(word starting at 4 and continues till 5 word)


//concatenate("rf",substr(Call.user.microapp.FromExtVXML[1],4,5)) will concatenate rf with sub string of fromExtVXML[1].

you can always refer built in functions formula editor, also there is good explaination given in Script editor help menu.



New Member

HI Chintan, Thanks so much

HI Chintan,


Thanks so much for your time, its really appreciated. is there any documents or video tutorial in cisco websites for the same?




Hari,Each of the formulas in


Each of the formulas in Script Editor are pretty well documented in the help. From within the Formula Editor, the "Built-In Functions" tab has a lot of information.

If I'm looking for information about one of the variables (such as Call.RouterCallKey, Call.RouterCallKeyDay, CallType.*.AnswerWaitTimeToday, etc.), I find that the Cisco document "Database Schema Guide for Unified Contact Center Enterprise" is incredibly useful. Don't attempt to read it all the way through... just search for the term you're looking for.

This formula:
//concatenate("application=A BC;MenuFlag=",Call.PeripheralVariable1,";callid=",Call.RouterCallDay,".",Call.RouterCallKey)//
looks like it is for a call to a CVP Studio VXML application. CVP Studio is another scripting environment, centered around IVRs. If you need to learn CVP scripting, I would definitely take a course on it if you can ( - there are a lot of nuances to CVP scripting that are hard to get without instruction, and the Cisco documentation is quite incomplete.



New Member

Thanks James.

Thanks James.

New Member

Hi,Anybody having this book


Anybody having this book Formulas (Release 4.6.2). It will be available in below link in the web page there is no sample figures present. Also when I tried to download it says page not found.

If any one downloaded past means please attach here. later versions also fine.

New Member

Hi James/Chintan,I need a

Hi James/Chintan,

I need a clarification on Set variable node, below is the senario:

Condition in DN node:(if the given DN there go to this set variableA else goto set variableB)

Inside set variableA we have formula: concatenate("application=App ABC;",concatenate("callid=",Call.RouterCallDay,".",Call.RouterCallKey))

Inside set variableB we have formula: concatenate("application=App XYZ;",concatenate("callid=",Call.RouterCallDay,".",Call.RouterCallKey))


So either the DN condition is true or false both the cases the call to go to one set variable and run appropriate application.


After running the application, the call is coming to RUN Ext script node(GS,server.v)..


My Understanding on above senario:

Set variable is going to run the application/call flow ABC/XYZ from CVP(Which is developed with the help of Cisco Call studio).

RUN ext Script node: Its going to execute a application/call flow which is developed with the help Cisco Call studio.


My doubt:

Both the nodes doing same work(executing epplication). Then what is the difference, why we use two different nodes.





Your Understanding is correct

Your Understanding is correct,

but with few modification: set node will set variable to value of to some other variable,

and this variable will be passed to VXML server to invoke application,


Run External script node will actually invoke application, by instructing CVP and passing data whatever you have set.(ECC variables).


now coming to your doubt:

which node is getting duplicated? Run ext or Set node ?


if possible can you post the screenshot of your script? this may be because of You are collecting Different data on Both VXML application and treating them in different ways.




New Member

Hi Chitan,I have understood

Hi Chitan,

I have understood the differeence bet set variable and Run ext script node. But i have different question:

We are sending Callid to CVP from ICM, in CVP that Callid is getting stored in VXML[3]. The same VXML[3] also storing 4 more information (acct number, custname, custaddress, Callid). So to we need to say about the Callid to CVP on which position it starts.

We also can with a logic the swaping Callid to first position in VXML[3], so tht we can say using substr formula..


Is there any other way we can achieve it without swaping the positions.





Hari,CVP does not care about


CVP does not care about what position the data is in for the user.microapp.ToExtVXML array. It is only looking for this format:


You can put as much as you like into each of the 4 "cells" of ToExtVXML, as long as the resulting text is within the variable length. The CVP app will automatically create session variables for itself using the text from the ToExtVXML array as long as you're using the format above. Order of variables does not matter.



New Member

Hi james,

Hi james, Thanks for yur inputs.. i can understand wat yu are saying.. but i believe this will treat tht call as new if we follw above syntx.. let me tell yu the objective: We are sending the call frm icm to cvp fr 2nd in the same call for some ivr treatment. So cvp should identify tht call is comin 2nd.we need to by pass all the greetin routin queueing etc... So as i said earlier callid is in last position.. we need to say wat the calld is to cvp.. we had a thought of using right (string n) formula, so tht it will provide callid which is at right.... Nw the challeng is wen we check digits of callid in cvp its varies for each calls.. for eg: 11111.235 , nw cant use right (string n) fórmula also... Is thr any othr wat we can reach ths req?

Hari,Can you provide more


Can you provide more information about the call flow? How is the call getting to CVP the second time? The RouterCallKey and RouterCallKeyDay should stay the same throughout the call in a normal call flow. The UCCE variable "" should stay the same as well.

It sounds like this second CVP script visit may be the result of a new call leg. Is this the result of an agent transfer? Can you pull some sample data for a complete example call from the Termination_Call_Detail table in UCCE?


New Member

Hi James, We are providing

Hi James, 

We are providing the EWT to the calller, if the caller doesn't  want to wait at a certain amount of time he can go for self service option. So here we sends the call to CVP.

Yes for this requirement RouterCallKey and RouterCallKeyDay must be same then only the CVP will come to know that this is a existing call when it enters 2nd time.




New Member

Hi, Can you please let me


Can you please let me know the result of below formula: before("|",Call.user.microapp.FromExtVXML[2])


I want to know wht | says also how to take a single data specifically from above VXML[2]. 


Hari,The "before(x,y)"


The "before(x,y)" function returns everything in y that is before x. So with the data and parameters you give, it would evaluate to "OneMoney", as "OneMoney" is before the first "|". "|" (called "vertical bar", or "pipe") is often used as a convenient way to pack multiple pieces of data into the same string variable. In your case, it has been used to put 8 data items into the FromExtVXML[2] variable.

The before()  function is just one way to get data out of the "packed" string. You can potentially combine it with uses of "after()" to get to different data items in your FromExtVXML[2] example above. If I wanted to retrieve the "TT_SALES_SG" value, I might use this formula:
The formulas are evaluated inside-out... so the solving order as the router processes would look like this:

  1. before("|",after("|",after("|",after("|",Call.user.microapp.FromExtVXML[2]))))
  2. before("|",after("|",after("|",after("|","OneMoney|NA|NA|TT_SALES_SG|SID01|NA|N|NA"))))
  3. before("|",after("|",after("|","NA|NA|TT_SALES_SG|SID01|NA|N|NA")))
  4. before("|",after("|","NA|TT_SALES_SG|SID01|NA|N|NA"))
  5. before("|","TT_SALES_SG|SID01|NA|N|NA")
  6. "TT_SALES_SG"

As a reminder, please remember that the "Built-In Functions" tab of the Formula Editor has definitions for all of the functions provided by ICM. Here's the definition that's provided for before():

before(s1, s2)

That portion of s2 that precedes the first occurrence of s1. If s1 does not occur in s2, s2 is returned. If s1 is the null string, the null string is returned.


New Member

Hi James, Thanks for your

Hi James, 

Thanks for your explanation, if i would understand well from your points. The below formula should be correct. Please check and let me know below:


am going to retrieve the last position ie 0123 from the above VXML[3], below is the formula written from above understanding:



please check and provide me the right one if my logic is wrong.


Also please note i have mentioned Call.user.microapp.ToExtVXML[3]) in the formula because we are sending this 7th position(Callid)data  to CVP, as  this call is going to CVP second time for some IVR treatment. So with the help of this formula CVP will come to know that this Callid is already there and will treat this call as existing call not a new call.... This is our requirement, please reply your ideas for both the clarification(formula is good/bad? do we achieve our req from above formula?) 




Hari,You're close. However, I


You're close. However, I think you will want to run the functions on FromExtVXML[3], as that would be where data from the original CVP call would be stored, not ToExtVXML[3].

You should store the result into one of the ToExtVXML array variables. I would suggest using the concatenate() function to add a CVP session variable name to the front of the string result in the format we previously discussed, otherwise the application will not know what to do with the value.


New Member

Hi James,I have created a

Hi James,

I have created a script in way that the call is sending back to back to CVP 4 times. All the four time its taking only one(same),callid. But my doubt is the callid is stored in VXML[3] in CVP propective. Please let me know which formula can we using to send the call to CVP:

Current one which gives same callid: concatenate("application=CELL_123=",Call.CallerEnteredDigits,";callid=",Call.RouterCallDay,".",Call.RouterCallKey)


Below is the one which we got from our above discussion: concatenate("application=CELL_123;CED=",Call.CallerEnteredDigits,";callid=",after("|",after("|",after("|",after("|",after("|",after("|",Call.user.microapp.ToExtVXML[3])))))))

Please let me know which can be used in a good way...

Hari,The formula:concatenate(


The formula:

Is simpler, I would use that if you can. Another option would be to use the "" for your callid, this is typically what is taught in CVP courses. The resulting formula would be like this:


Be careful with that one, though... the is 32 digits long, you would need to make sure your ToExtVXML variable is long enough to handle everything.


You don't have to store everything in ToExtVXML[3]... you can spread things out between ToExtVXML[0], ToExtVXML[1], ToExtVXML[2], and ToExtVXML[3]. CVP doesn't care which variable in that array that you put the data in. Your CVP app will never see ToExtVXML, it only receives the variable=value pairs. So on the above example, the CVP app would start with a CED variable with value of 12345 (assuming caller entered those digits), and a "callid" variable like 151234.182 .


New Member

hi James,We are sending the

hi James,

We are sending the call 2nd time to CVP for IVR treatment, now additional point got added that we need to send the call back again to queuing (ICM) if the caller wishes to go back to queue but his queue position will  get started from initial stage. Please let me know what all we need to change on both CVP and ICM script.


Hari,That is a very broad


That is a very broad question. What specifically are you having trouble with?


New Member

Hi, We are giving the caller


We are giving the caller an option to go back to the queue if he want to spk to an agent. So tht is the reason i hav asked. Now i think they figured out that. we are doing tht with the help for Skill group ID. and giving them in Call studio so tht the caller press tht option, he will be able to go the the queue(ICM).



Hari,It sounds like the


It sounds like the script is just running a different CVP application depending on which Dialed Number the call came in on. In this case the Set Variable nodes are used to select the application (either "AppABC" or "AppXYZ"), while the Run Ext Script node actually runs the selected application. I'm not seeing any configuration issue or duplication in what you described.

All CVP Studio applications are run with a (GS,server,v) Run Ext Script node. It is the contents of the ToExtVXML variable array that determines which application CVP runs, and which variables are passed to that application.



Hi, do you have any

Hi, do you have any particular issue with scripting? We can help you with that if you can explain what you don't understand or what you need help with.


Hall of Fame Super Silver

There is a UCCE book out

There is a UCCE book out there you may check out (I have not read it):



Hi,I bought that book while


I bought that book while it was on sale. Honestly, did not meet my expectations at all. It's kind of a basic overview of how UCCE works but that's it.


That book has pretty bad

That book has pretty bad reviews on Amazon, so I never bothered getting it.

I definitely agree with everyone else here... If you have a specific issue we'd be glad to help you with it. In the meantime I would say to explore the system, and read as many of the Cisco-provided guides as you can. You should definitely read the Reporting Guide - good scripting and good reporting go hand-in-hand. If you have questions about what specific object variables mean in the Formula Editor, the Database Schema is a great reference for that. The Configuration Guide will give you a better foundation on the nodes and configurations that you use in scripting.



I'm reading the book Chris

I'm reading the book Chris mentioned, it will not really help you with scripting, but it does provide a good foundation. Your best bet is just to start playing with it and come here when you have questions.



CreatePlease login to create content