Hi, I need a small lua script to originate two extension calls and bridge them. This is my script (based on lua wiki example): local callee = argv[1] local called = argv[2] local domain = argv[3] Adisp = "None"; param="{ignore_early_media=true,ringback=\'%(1000,4000,425,425)\',origination_caller_id_number=" legA=freeswitch.Session(param..callee.."}user/"..called); while (Adisp~="ANSWER" and legA:ready()) do Adisp = legA:getVariable("endpoint_disposition"); os.execute("sleep 1") end -- waiting for A to answer if (Adisp=="ANSWER") then legB=freeswitch.Session(param..called.."}user/"..callee); freeswitch.bridge(legA,legB); end The script works but there's no ringback, when A answers and B is ringing. When B answers, we can talk. This is my log: http://pastebin.freeswitch.org/19745 I know that something stupid is missing but I can't work out where's the error! Any help?
You can do all this with a single originate command, why would you use lua for this in the first place? Mike On Aug 21, 2012, at 6:31 AM, Chris B. Ware <chrisbware@yahoo.it> wrote:
Hi,
I need a small lua script to originate two extension calls and bridge them. This is my script (based on lua wiki example):
local callee = argv[1] local called = argv[2] local domain = argv[3]
Adisp = "None"; param="{ignore_early_media=true,ringback=\'%(1000,4000,425,425)\',origination_caller_id_number="
legA=freeswitch.Session(param..callee.."}user/"..called); while (Adisp~="ANSWER" and legA:ready()) do Adisp = legA:getVariable("endpoint_disposition"); os.execute("sleep 1") end -- waiting for A to answer if (Adisp=="ANSWER") then legB=freeswitch.Session(param..called.."}user/"..callee); freeswitch.bridge(legA,legB); end
The script works but there's no ringback, when A answers and B is ringing. When B answers, we can talk.
This is my log: http://pastebin.freeswitch.org/19745
I know that something stupid is missing but I can't work out where's the error! Any help?
participants (2)
-
Chris B. Ware
-
Michael Jerris