Multiple Instances of GTD Messages
A parameter in a GTD message can have multiple instances which need not be contiguous. In VoiceXML and JavaScript, indexing of instance numbers of GTD parameters starts with zero. For example, the first instance of a GTD parameter is referenced with the index number zero, the second instance is referenced with the index number one, the third instance is referenced with the index number two, and so on.
The syntax
<gtd-object-name>.<gtd-parameter-object-name>[<instance-number>]
refers to a specific instance. The property
instance_count
is exposed to every GTD parameter object. The VoiceXML script must first read
this property before accessing a specific instance. The instance number must be
less than or equal to the total number of instances read by the script.
For example:
<assign name="my_gtd" expr= "new
com.cisco.objclass.gtd(com.cisco.signal.gtdlist['setup_indication'])"/>
<assign name="total_uus_inst" expr="my_gtd.UUS.instance_count"/>
<assign name="uus2" expr="my_gtd.UUS[2]" >/
<assign name="uus2" expr="my_gtd.UUS[2].dat">/
GTD parameter instance numbers start with 0 for the first instance. For example,
<assign name= "my_gtd" expr= "com.cisco.signal.gtdlist['setup_indication']"/>
<assign name= "uus1" expr= "my_gtd.UUS[0]"/> ==> for first UUS instance
<assign name= "uus2" expr= "my_gtd.UUS[1]"/> ==> for second UUS instance
Note | If VoiceXML and JavaScript do not accept some special characters such as #, -, or + for field names, those field names must be provided within square brackets []. For example, to access the number (#) field of the first instance of the CGN parameter using JavaScript, it is specified as var cgn_num= my_gtd.CGN[0]['#']. |