<Gosub>
The <Gosub /> element provides for creating complex workflows similar to <Goto /> but the execution will return to previous execution block after being called.
Element Attributes
Attribute | Description |
|---|---|
| The name/identifier that execution of InboundXML. The name/identifier set here is the location that InboundXML will execute.
This element is similar to
|
Nesting
The Gosub can contain nested elements but must be placed inside the default Response element.
<Response>
<Gosub label="FirstBlock" />
<Block label="FirstBlock">
<Say>This is spoken first.</Say>
<Gosub label="SayThis" />
<Say>This is spoken after the Gosub element.</Say>
</Block>
<Gosub label="SayThis" />
{/* 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>Block, Goto and Gosub Example
The following code sample contains all three elements to demonstrate how they can be put together.
<Response>
<Goto label="M360Test_1" />
<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" />
<Block label="M360Test_3">
<Say>Hello. This is Third block.</Say>
</Block>
<Say>This text will never be spoken.</Say>
</Response>Updated 6 months ago
