Avaya Logo

Previous Topic

Next Topic

Book Contents

Book Index

Using the Object tag with undefined parameters

If the VoiceXML object tag is used with multiple <param statements and one of the parameters is undefined, the only arguments that will be passed to the subprog are the arguments that are listed prior to reaching the undefined parameter. In the following code sample, if the session.telephone.uui parameter were undefined, the remaining arguments would not be passed.

<object name="testscript"
classid="com.avaya.subprog">
<param
name="application_name" value="vxmlobjs"/>
<param
name="arg2" value="string argument"/>
<param
name="arg3" expr="session.telephone.channel"/>
<param
name="arg4" expr="session.telephone.uui"/>
<param
name="arg5" expr="'channel ' +
session.telephone.channel"/>
<param
name="arg6" value="six"/>
</object
>

If there is a possibility that a variable passed via a parameter in the object tag could have a value of 'undefined', provide a variable definition. In the following example, the if statement was added to change the value of uui from 'unknown' to the value of session.telephone.uui only if the session.telephone.uui variable is defined.

<var name="uui" expr="'unknown'"/>
<if cond="session.telephone.uui != undefined">
<assign name="uui"
expr="session.telephone.uui"/>
</if
>

<object name="testscript"
classid="com.avaya.subprog">
<param
name="application_name" value="vxmlobjs"/>
<param
name="arg2" value="string argument"/>
<param
name="arg3" expr="session.telephone.channel"/>
<param
name="arg4" expr="uui"/>
<param name="arg5" expr="'channel ' +
session.telephone.channel"/>
<param
name="arg6" value="six"/>
</object
>

© 2004 Avaya Inc. All Rights Reserved.