Bridging sessions from two separate lua scripts; uuid_bridge? intercept?
Hi. I have two sessions running in two separate Lua scripts, and I want to bridge them so that the bridged call is being controlled by the first (a-leg) script. If I simply use uuid_bridge, I get no error but the calls don't bridge. I've tried intercept, but I don't understand how it should be used; nothing I try seems to work. Here's what I have: function bridge_calls(session,api,b_leg_uuid, call_len) session:setAutoHangup(false) session:execute("sched_hangup","+" .. tostring(call_len) .. " " .. tostring(session.uuid)) session:execute("set","continue_on_fail=true") api:executeString("intercept -bleg " .. tostring(b_leg_uuid)) api:executeString("uuid_bridge " .. tostring(session.uuid) .. " " .. tostring(b_leg_uuid)) end I'd really appreciate any help. Thanks, Adam
Pastebin a debug log so we can see what is happening when the script runs. -MC Sent from my iPhone On Feb 7, 2010, at 8:31 PM, Adam Wilt <wiltingtree@gmail.com> wrote:
Hi. I have two sessions running in two separate Lua scripts, and I want to bridge them so that the bridged call is being controlled by the first (a-leg) script. If I simply use uuid_bridge, I get no error but the calls don't bridge. I've tried intercept, but I don't understand how it should be used; nothing I try seems to work. Here's what I have:
function bridge_calls(session,api,b_leg_uuid, call_len) session:setAutoHangup(false) session:execute("sched_hangup","+" .. tostring(call_len) .. " " .. tostring(session.uuid)) session:execute("set","continue_on_fail=true") api:executeString("intercept -bleg " .. tostring(b_leg_uuid)) api:executeString("uuid_bridge " .. tostring(session.uuid) .. " " .. tostring(b_leg_uuid)) end
I'd really appreciate any help.
Thanks, Adam
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch- users http://www.freeswitch.org
Thanks Michael for the reply. Here's the pastebin link: http://pastebin.freeswitch.org/12084 On Sun, Feb 7, 2010 at 9:50 PM, Michael S Collins <msc@freeswitch.org>wrote:
Pastebin a debug log so we can see what is happening when the script runs.
-MC
Sent from my iPhone
On Feb 7, 2010, at 8:31 PM, Adam Wilt <wiltingtree@gmail.com> wrote:
Hi. I have two sessions running in two separate Lua scripts, and I want to bridge them so that the bridged call is being controlled by the first (a-leg) script. If I simply use uuid_bridge, I get no error but the calls don't bridge. I've tried intercept, but I don't understand how it should be used; nothing I try seems to work. Here's what I have:
function bridge_calls(session,api,b_leg_uuid, call_len) session:setAutoHangup(false) session:execute("sched_hangup","+" .. tostring(call_len) .. " " .. tostring(session.uuid)) session:execute("set","continue_on_fail=true") api:executeString("intercept -bleg " .. tostring(b_leg_uuid)) api:executeString("uuid_bridge " .. tostring(session.uuid) .. " " .. tostring(b_leg_uuid)) end
I'd really appreciate any help.
Thanks, Adam
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
One other thing I should mention. I'm running FreeSWITCH version 1.4 (build 14460) in Windows. Brian suggested I upgrade to the build in the http://files-sync.freeswitch.org/windows_installer/ folder, but it turned out to be the exact same build I already had. I'd love to try upgrade to 1.5 in case this problem has been fixed already. On Sun, Feb 7, 2010 at 10:29 PM, Adam Wilt <wiltingtree@gmail.com> wrote:
Thanks Michael for the reply. Here's the pastebin link: http://pastebin.freeswitch.org/12084
On Sun, Feb 7, 2010 at 9:50 PM, Michael S Collins <msc@freeswitch.org>wrote:
Pastebin a debug log so we can see what is happening when the script runs.
-MC
Sent from my iPhone
On Feb 7, 2010, at 8:31 PM, Adam Wilt <wiltingtree@gmail.com> wrote:
Hi. I have two sessions running in two separate Lua scripts, and I want to bridge them so that the bridged call is being controlled by the first (a-leg) script. If I simply use uuid_bridge, I get no error but the calls don't bridge. I've tried intercept, but I don't understand how it should be used; nothing I try seems to work. Here's what I have:
function bridge_calls(session,api,b_leg_uuid, call_len) session:setAutoHangup(false) session:execute("sched_hangup","+" .. tostring(call_len) .. " " .. tostring(session.uuid)) session:execute("set","continue_on_fail=true") api:executeString("intercept -bleg " .. tostring(b_leg_uuid)) api:executeString("uuid_bridge " .. tostring(session.uuid) .. " " .. tostring(b_leg_uuid)) end
I'd really appreciate any help.
Thanks, Adam
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
1.4? how does the future look, report back… http://files-sync.freeswitch.org/windows_installer/freepbx_svn.exe I think this has latest FreeSWITCH in it to, Carlos, can you confirm that? Mike On Feb 8, 2010, at 10:37 AM, Adam Wilt wrote:
One other thing I should mention. I'm running FreeSWITCH version 1.4 (build 14460) in Windows. Brian suggested I upgrade to the build in the http://files-sync.freeswitch.org/windows_installer/ folder, but it turned out to be the exact same build I already had. I'd love to try upgrade to 1.5 in case this problem has been fixed already.
On Sun, Feb 7, 2010 at 10:29 PM, Adam Wilt <wiltingtree@gmail.com> wrote: Thanks Michael for the reply. Here's the pastebin link: http://pastebin.freeswitch.org/12084
On Sun, Feb 7, 2010 at 9:50 PM, Michael S Collins <msc@freeswitch.org> wrote: Pastebin a debug log so we can see what is happening when the script runs.
-MC
Sent from my iPhone
On Feb 7, 2010, at 8:31 PM, Adam Wilt <wiltingtree@gmail.com> wrote:
Hi. I have two sessions running in two separate Lua scripts, and I want to bridge them so that the bridged call is being controlled by the first (a-leg) script. If I simply use uuid_bridge, I get no error but the calls don't bridge. I've tried intercept, but I don't understand how it should be used; nothing I try seems to work. Here's what I have:
function bridge_calls(session,api,b_leg_uuid, call_len) session:setAutoHangup(false) session:execute("sched_hangup","+" .. tostring(call_len) .. " " .. tostring(session.uuid)) session:execute("set","continue_on_fail=true") api:executeString("intercept -bleg " .. tostring(b_leg_uuid)) api:executeString("uuid_bridge " .. tostring(session.uuid) .. " " .. tostring(b_leg_uuid)) end
I'd really appreciate any help.
Thanks, Adam
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Thanks again for the help Michael. I'm now upgraded to version 1.5, but I'm still getting the same problem. When I try to bridge sessions from two separate lua scripts, both sessions hang up on me. I think maybe I don't understand how "intercept" works. Anyway, I posted the debug trace here: http://pastebin.freeswitch.org/12121 And I also put together a small example which exhibits the problem. The first script is started by an inbound call and starts the second script. The second script places an outbound call and tries to bridge the two sessions together: Inbound script: http://pastebin.freeswitch.org/12122 Outbound script: http://pastebin.freeswitch.org/12123 Thanks, Adam On 2/9/10, Michael Jerris <mike@jerris.com> wrote:
1.4? how does the future look, report back…
http://files-sync.freeswitch.org/windows_installer/freepbx_svn.exe
I think this has latest FreeSWITCH in it to, Carlos, can you confirm that?
Mike
On Feb 8, 2010, at 10:37 AM, Adam Wilt wrote:
One other thing I should mention. I'm running FreeSWITCH version 1.4 (build 14460) in Windows. Brian suggested I upgrade to the build in the http://files-sync.freeswitch.org/windows_installer/ folder, but it turned out to be the exact same build I already had. I'd love to try upgrade to 1.5 in case this problem has been fixed already.
On Sun, Feb 7, 2010 at 10:29 PM, Adam Wilt <wiltingtree@gmail.com> wrote: Thanks Michael for the reply. Here's the pastebin link: http://pastebin.freeswitch.org/12084
On Sun, Feb 7, 2010 at 9:50 PM, Michael S Collins <msc@freeswitch.org> wrote: Pastebin a debug log so we can see what is happening when the script runs.
-MC
Sent from my iPhone
On Feb 7, 2010, at 8:31 PM, Adam Wilt <wiltingtree@gmail.com> wrote:
Hi. I have two sessions running in two separate Lua scripts, and I want to bridge them so that the bridged call is being controlled by the first (a-leg) script. If I simply use uuid_bridge, I get no error but the calls don't bridge. I've tried intercept, but I don't understand how it should be used; nothing I try seems to work. Here's what I have:
function bridge_calls(session,api,b_leg_uuid, call_len) session:setAutoHangup(false) session:execute("sched_hangup","+" .. tostring(call_len) .. " " .. tostring(session.uuid)) session:execute("set","continue_on_fail=true") api:executeString("intercept -bleg " .. tostring(b_leg_uuid)) api:executeString("uuid_bridge " .. tostring(session.uuid) .. " " .. tostring(b_leg_uuid)) end
I'd really appreciate any help.
Thanks, Adam
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
http://wiki.freeswitch.org/wiki/Mod_lua#session:setAutoHangup But I don't get why you're doing this in such a convoluted way... I'm still not clear why you're going at the task in this manner. Can you clearly outline what exactly you're trying to accomplish? /b On Feb 12, 2010, at 9:04 PM, Adam Wilt wrote:
Thanks again for the help Michael.
I'm now upgraded to version 1.5, but I'm still getting the same problem. When I try to bridge sessions from two separate lua scripts, both sessions hang up on me. I think maybe I don't understand how "intercept" works. Anyway, I posted the debug trace here:
http://pastebin.freeswitch.org/12121
And I also put together a small example which exhibits the problem. The first script is started by an inbound call and starts the second script. The second script places an outbound call and tries to bridge the two sessions together:
Inbound script: http://pastebin.freeswitch.org/12122 Outbound script: http://pastebin.freeswitch.org/12123
Thanks, Adam
One or the other of intercept or uuid_bridge not both. Either uuid_bridge uuid1 uuid2 or Execute intercept on session1 with uuid2 Or uuid_transfer to intercept:uuid2 inline When you uuid_bridge you must exit the script. When you intercept the call will block until the bridge is over unless its bypass media otherwise exit the script If either session was created inside the script use session:setAutoHangup(0) on them first. On Feb 12, 2010 9:11 PM, "Adam Wilt" <wiltingtree@gmail.com> wrote: Thanks again for the help Michael. I'm now upgraded to version 1.5, but I'm still getting the same problem. When I try to bridge sessions from two separate lua scripts, both sessions hang up on me. I think maybe I don't understand how "intercept" works. Anyway, I posted the debug trace here: http://pastebin.freeswitch.org/12121 And I also put together a small example which exhibits the problem. The first script is started by an inbound call and starts the second script. The second script places an outbound call and tries to bridge the two sessions together: Inbound script: http://pastebin.freeswitch.org/12122 Outbound script: http://pastebin.freeswitch.org/12123 Thanks, Adam On 2/9/10, Michael Jerris <mike@jerris.com> wrote:
1.4? how does the future look, report back...
Thanks Anthony and Brian. setAutoHangup was specified in the script calling intercept, but not the other script. When I add it to the other script, neither side hangs up, but the call is not bridged. Neither party can hear the other party. From your description, intercept sounds like what I want to do. I made sure bypass media was off. Does the session being intercepted have to be in a certain state for the intercept to work? In my example, a prompt is being played during the time it is intercepted, but I tried having it sleep instead with the same result. The reason I'm doing it this way is because both parties have to go through a bunch of different states before they are allowed to speak to each other. I tried controlling both legs from the same script previously, but sometimes one session would block waiting for the other session. Thanks, Adam On Sat, Feb 13, 2010 at 10:14 AM, Anthony Minessale < anthony.minessale@gmail.com> wrote:
One or the other of intercept or uuid_bridge not both.
Either uuid_bridge uuid1 uuid2 or Execute intercept on session1 with uuid2 Or uuid_transfer to intercept:uuid2 inline
When you uuid_bridge you must exit the script.
When you intercept the call will block until the bridge is over unless its bypass media otherwise exit the script
If either session was created inside the script use session:setAutoHangup(0) on them first.
On Feb 12, 2010 9:11 PM, "Adam Wilt" <wiltingtree@gmail.com> wrote:
Thanks again for the help Michael.
I'm now upgraded to version 1.5, but I'm still getting the same problem. When I try to bridge sessions from two separate lua scripts, both sessions hang up on me. I think maybe I don't understand how "intercept" works. Anyway, I posted the debug trace here:
http://pastebin.freeswitch.org/12121
And I also put together a small example which exhibits the problem. The first script is started by an inbound call and starts the second script. The second script places an outbound call and tries to bridge the two sessions together:
Inbound script: http://pastebin.freeswitch.org/12122 Outbound script: http://pastebin.freeswitch.org/12123
Thanks, Adam
On 2/9/10, Michael Jerris <mike@jerris.com> wrote:
1.4? how does the future look, report back...
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Here's a new debug log which shows what happens using only intercept and having setAutoHangup(false) on both sides: http://pastebin.freeswitch.org/12124 <http://pastebin.freeswitch.org/12124>And here's my updated bridge function: function bridge_calls(session,api,b_leg_uuid, call_len) freeswitch.consoleLog("info","A leg - Bridging " .. tostring(b_leg_uuid) .. " with " .. tostring(session.uuid) .. "\n") session:setAutoHangup(false) session:execute("set","continue_on_fail=true") api:executeString("uuid_media " .. tostring(b_leg_uuid)) api:executeString("uuid_media " .. tostring(session.uuid)) api:executeString("intercept -bleg " .. tostring(b_leg_uuid)) end Thanks, Adam On Sat, Feb 13, 2010 at 1:18 PM, Adam Wilt <wiltingtree@gmail.com> wrote:
Thanks Anthony and Brian.
setAutoHangup was specified in the script calling intercept, but not the other script. When I add it to the other script, neither side hangs up, but the call is not bridged. Neither party can hear the other party. From your description, intercept sounds like what I want to do.
I made sure bypass media was off. Does the session being intercepted have to be in a certain state for the intercept to work? In my example, a prompt is being played during the time it is intercepted, but I tried having it sleep instead with the same result.
The reason I'm doing it this way is because both parties have to go through a bunch of different states before they are allowed to speak to each other. I tried controlling both legs from the same script previously, but sometimes one session would block waiting for the other session.
Thanks, Adam
On Sat, Feb 13, 2010 at 10:14 AM, Anthony Minessale < anthony.minessale@gmail.com> wrote:
One or the other of intercept or uuid_bridge not both.
Either uuid_bridge uuid1 uuid2 or Execute intercept on session1 with uuid2 Or uuid_transfer to intercept:uuid2 inline
When you uuid_bridge you must exit the script.
When you intercept the call will block until the bridge is over unless its bypass media otherwise exit the script
If either session was created inside the script use session:setAutoHangup(0) on them first.
On Feb 12, 2010 9:11 PM, "Adam Wilt" <wiltingtree@gmail.com> wrote:
Thanks again for the help Michael.
I'm now upgraded to version 1.5, but I'm still getting the same problem. When I try to bridge sessions from two separate lua scripts, both sessions hang up on me. I think maybe I don't understand how "intercept" works. Anyway, I posted the debug trace here:
http://pastebin.freeswitch.org/12121
And I also put together a small example which exhibits the problem. The first script is started by an inbound call and starts the second script. The second script places an outbound call and tries to bridge the two sessions together:
Inbound script: http://pastebin.freeswitch.org/12122 Outbound script: http://pastebin.freeswitch.org/12123
Thanks, Adam
On 2/9/10, Michael Jerris <mike@jerris.com> wrote:
1.4? how does the future look, report back...
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Sigh On Feb 13, 2010 1:38 PM, "Adam Wilt" <wiltingtree@gmail.com> wrote: Here's a new debug log which shows what happens using only intercept and having setAutoHangup(false) on both sides: http://pastebin.freeswitch.org/12124 <http://pastebin.freeswitch.org/12124>And here's my updated bridge function:
function bridge_calls(session,api,b_leg_uuid, call_len) freeswitch.consoleLog("info","A leg - Bridging " .. tostring(b_leg_uuid) .. " with " .. tostring(session.uuid) .. "\n") session:setAutoHangup(false)
session:execute("set","continue_on_fail=true") api:executeString("uuid_media " .. tostring(b_leg_uuid)) api:executeString("uuid_media " .. tostring(session.uuid))
api:executeString("intercept -bleg " .. tostring(b_leg_uuid)) end
Thanks, Adam On Sat, Feb 13, 2010 at 1:18 PM, Adam Wilt <wiltingtree@gmail.com> wrote:
Thanks Anthony and ...
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Does "sigh" mean that it's a problem with FreeSWITCH, or perhaps that I did something stupid? On Sat, Feb 13, 2010 at 3:39 PM, Anthony Minessale < anthony.minessale@gmail.com> wrote:
Sigh
On Feb 13, 2010 1:38 PM, "Adam Wilt" <wiltingtree@gmail.com> wrote:
Here's a new debug log which shows what happens using only intercept and having setAutoHangup(false) on both sides:
http://pastebin.freeswitch.org/12124
<http://pastebin.freeswitch.org/12124>And here's my updated bridge function:
function bridge_calls(session,api,b_leg_uuid, call_len) freeswitch.consoleLog("info","A leg - Bridging " .. tostring(b_leg_uuid) .. " with " .. tostring(session.uuid) .. "\n") session:setAutoHangup(false)
session:execute("set","continue_on_fail=true") api:executeString("uuid_media " .. tostring(b_leg_uuid)) api:executeString("uuid_media " .. tostring(session.uuid))
api:executeString("intercept -bleg " .. tostring(b_leg_uuid)) end
Thanks, Adam
On Sat, Feb 13, 2010 at 1:18 PM, Adam Wilt <wiltingtree@gmail.com> wrote:
Thanks Anthony and ...
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
You need to stop trying to do everything manually. You know FreeSWITCH does a lot of things for you so you can just work with the call but you seem to be trying WAY too hard to accomplish your task. Let FreeSWITCH do the hard work for you... api:executeString("intercept -bleg " .. tostring(b_leg_uuid)) This line is 100% WRONG. Intercept is an application NOT an API call. Just do session:execute("intercept", "");, Those uuid_media calls are pointless just set the bypass_media_after_bridge variable if you want to go bypass after the bridge. I would give you my extended you're trying too hard speech but I think you get the picture. /b On Feb 13, 2010, at 3:03 PM, Adam Wilt wrote:
Does "sigh" mean that it's a problem with FreeSWITCH, or perhaps that I did something stupid?
participants (5)
-
Adam Wilt
-
Anthony Minessale
-
Brian West
-
Michael Jerris
-
Michael S Collins