Modifying GTD Parameters
To modify a GTD message, an instance is created using the new operator in com.cisco.objclass.gtd.
-
<var name= "my_gtd" expr= "new com.cisco.objclass.gtd(com.cisco.signal.gtdlist['setup_indication'])"/>
This example creates a copy of the GTD message that came with the Setup Ind event on the incoming leg.
-
<var name= "out_gtd" expr= "new com.cisco.objclass.gtd(gtd_xfer$.com.cisco.signal.gtdlist['setup_indication'])"/>
This example creates a copy of the GTD message from the <transfer> shadow variable gtd_xfer$.com.cisco.signal.gtdlist (assuming that gtd_xfer was the name of the transfer.) out_gtd contains a copy of the GTD parameters that arrived in the setup message on the outgoing leg. This is a read-write variable and is used to modify GTD parameters.
-
<var name= "my_gtd" expr= "new com.cisco.objclass.gtd(com.cisco.signal.gtdlist['setup_indication'])"/>
This example creates a copy of the GTD message received in the setup message on the incoming leg which will be used to modify a GTD message.
<assign name= "my_gtd.UUS[0].dat" expr="'99'"/> updates the dat field of the first instance of the UUS parameter of the GTD message represented by my_gtd.
<var name= "my_uus" expr= "my_gtd.UUS[0]"/> // first instance of UUS parameter <var name= "uus_data" expr= "my_uus.dat"/> <assign name= "my_uus.dat" expr= "hello"/>This example shows a VoiceXML script modifying a GTD message that arrived with a Setup Ind event.
The same example is shown here using an ECMAScript:
<script> var my_gtd= new com.cisco.objclass.gtd(com.cisco.signal.gtdlist["setup_indication"]) var my_uus= my_gtd.UUS[0]; // first instance of UUS parameter my_uus.dat= "'hello'"; <script/>The following modifications of a GTD parameter or field are supported:-
Replace
-
Append
Delete is not supported.
-
If the VoiceXML script adds an instance of a GTD parameter with the instance number being greater than the current instance count by one, the parameter is appended. If the instance number is less than or equal to the current instance count, the specified parameter is replaced.
Examples
-
The VoiceXML script specifies <assign name= "UUS[2].dat" expr= "'ABCDEF0123'"/>, the GTD parameter is appended.
-
The VoiceXML script specifies <assign name= "UUS[1].dat" expr= "'ABCDEF0123'"/>, the GTD parameter is replaced.
-
The VoiceXML script specifies <assign name= "my_gtd[4].dat" expr= "'ABCDEF0123'"/>, an exception error is thrown because in this case only the instance numbers of 0 to 2 are valid, 0 and 1 for replace and 2 for append.