Originate Example
About
Simple examples to use the originate API command to initiate calls.
Click here to expand Table of Contents
Originate Example 1
Courtesy of SwK:
Simplified originate usage template:
originate ALEG BLEG
The full template from the FreeSWITCH API command interpreter:
originate <call url> <exten>|&<application_name>(<app_args>) [<dialplan>][<context>] [<cid_name>][<cid_num>] [<timeout_sec>]
originate Example 1
originate {origination_caller_id_number=9005551212}sofia/default/whatever@wherever 19005551212 XML default CALLER_ID_NAME CALLER_ID_NUMBER
This will make a call out to sip:whatever@wherever
with the Caller ID number set to 9005551212. After the A-leg supervises (is answered) it will send the call to the XML dialplan using context=default with the destination number of 19005551212 using the Caller ID name and number specified in the fields CALLER_ID_NAME and CALLER_ID_NUMBER.
Originate Example 2
originate Example 2
originate {origination_caller_id_number=9005551212}sofia/default/whatever@wherever &bridge({origination_caller_id_number=8001234567}sofia/profile/someother@destination.com)
This does the same thing as Example 1, but bypasses the dialplan and just sends the connected A-leg directly to the bridge app for B-leg.
Additional Settings
You can also get fancy if you want to set additional channel variables in the originate command line:
originate {origination_caller_id_number=12345,ignore_early_media=true,call_timeout=60,hangup_after_bridge=true}sofia/default....