freeswitch.Session and session

This object represents a call leg. You create an outbound call leg, giving freeswitch. Session a dialing string as an argument:

new_leg = freeswitch.Session("user/1011") 

Let's test an example script that originates a call to a phone registered as 1011, then originates another leg to another phone (registered as 1010), and bridge the two legs so they can talk. Save this script as /usr/local/freeswitch/scripts/test4.lua, and then call it from the FreeSWITCH console, typing lua test4.lua, then run it again typing luarun test4.lua (hint: with luarun the console will not block):

 freeswitch.consoleLog("WARNING","Before first call\n") first_session = freeswitch.Session("user/1011") if (first_session:ready()) then ...

Get FreeSWITCH 1.8 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.