Skip to main content

transfer

Transfer the execution of the script to a new URL.

Parameters

NameTypeDescription
deststringSpecifies where to transfer to. Required. The value can be one of:
  • "relay:<relay application>" - relay application to notify (currently not implemented)
  • "https://<URL>" - URL to fetch next document from. Sends HTTP POST
paramsobjectNamed parameters to send to a section, URL, or application. Optional. Default is not set.
metaobjectUser data, ignored by SignalWire. Optional. Default is not set.
resultobject | arraySet up a switch on return_value by using an object or a cond statement by using an array.

Variables

  • return_value: (out) - Value returned by subroutine.

Examples

Named parameter

version: 1.0.0
sections:
main:
- transfer:
dest: "https://example.com/next"

Named parameter with sub-parameters

version: 1.0.0
sections:
main:
- transfer:
- dest: "https://example.com/next"
- params:
- foo: "bar"

Implicit first parameter

version: 1.0.0
sections:
main:
- transfer: "https://example.com/next"

Execute subroutine with a switch on return value

label: retry_menu
execute:
dest: my_menu
params:
file: https://example.com/foo.wav
digits: "123"
result:
case:
"1":
- execute: https://example.com/sales.swml
"2":
- execute: https://example.com/support.swml
"3":
- execute: https://example.com/leave_a_message.swml
default:
- goto:
label: retry_menu
max: 3

Execute subroutine and branch on return value

label: retry_menu
execute:
dest: my_menu
params:
file: https://example.com/foo.wav
digits: "123"
result:
- when: return_value == '1'
then:
- execute: https://example.com/sales.swml
- when: return_value == '2'
then:
- execute: https://example.com/support.swml
- when: return_value == '3'
then:
- execute: https://example.com/leave_a_message.swml
- else:
- goto:
label: retry_menu
max: 3