<Gosub>
The element provides for creating complex workflows similar to but the execution will return to previous execution block after being called.
###Element Attributes
Attribute | Description |
---|---|
label | The name/identifier that execution of InboundXML. The name/identifier set here is the location that InboundXML will execute. |
Nesting
The can contain nested elements but must be placed inside the default element.
<Response>
<Gosub label="FirstBlock"></Gosub>
<Block label="FirstBlock">
<Say>This is spoken first.</Say>
<Gosub label="SayThis"></Gosub>
<Say>This is spoken after the Gosub element.</Say>
</Block>
<Gosub label="SayThis"></Gosub>
<!-- other tags hidden for brevity -->
<Block label="SayThis">
<Say>Press 1 for billing. Press 2 for customer service. Press 3 for communication options.</Say>
</Block>
<Say>This statement will never be spoken.</Say>
</Response>
The following code sample contains all three elements to demonstrate how they can be put together.
<Response>
<Goto label="M360Test_1"></Goto>
<Say>This text will never execute.</Say>
<Block label="M360Test_1">
<Say>Hello. This is First block.</Say>
<Gosub label="M360Test_2"/>
</Block>
<Block label="M360Test_2">
<Say>Hello. This is Second block.</Say>
<Gosub label="M360Test_3"/>
<Say>This is spoken after gosub.</Say>
</Block>
<Goto label="M360Test_2"></Goto>
<Block label="M360Test_3">
<Say>Hello. This is Third block.</Say>
</Block>
<Say>This text will never execute.</Say>
</Response>
Updated almost 3 years ago
Did this page help you?