LUA script has problem with bridge action?
i set the dialplan to call test.lua by adding <action application="lua" data="test.lua"/> it works fine when placing it before a "bridge" action, like <action application="lua" data="test.lua"/> <action application="bridge" data="user/${dialed_extension}"/> but if i put "lua" after "bridge" <action application="bridge" data="user/${dialed_extension}"/> <action application="lua" data="test.lua"/> then test.lua is not executed, no matter the dialed_extension answered the call or not, my question is: 1. why is this happening? 2. how can i get test.lua get executed after "bridge"?
What exactly is your Lua script doing? Please post your script here at http://pastebin.freeswitch.org. Also go ahead and post your relevent dialplan and reply with links to both posts. - BDF On Jun 10, 2013 12:29 AM, "Vincent Xia" <gmangudai@gmail.com> wrote:
i set the dialplan to call test.lua by adding <action application="lua" data="test.lua"/>
it works fine when placing it before a "bridge" action, like <action application="lua" data="test.lua"/> <action application="bridge" data="user/${dialed_extension}"/>
but if i put "lua" after "bridge" <action application="bridge" data="user/${dialed_extension}"/> <action application="lua" data="test.lua"/>
then test.lua is not executed, no matter the dialed_extension answered the call or not,
my question is: 1. why is this happening? 2. how can i get test.lua get executed after "bridge"?
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
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
my lua script is very simple with just one sentence to print info on freeswitch console, i've post it along with the dialplan anyways. 2013/6/10 Brian Foster <bdfoster@davri.com>
What exactly is your Lua script doing? Please post your script here at http://pastebin.freeswitch.org. Also go ahead and post your relevent dialplan and reply with links to both posts.
- BDF On Jun 10, 2013 12:29 AM, "Vincent Xia" <gmangudai@gmail.com> wrote:
i set the dialplan to call test.lua by adding <action application="lua" data="test.lua"/>
it works fine when placing it before a "bridge" action, like <action application="lua" data="test.lua"/> <action application="bridge" data="user/${dialed_extension}"/>
but if i put "lua" after "bridge" <action application="bridge" data="user/${dialed_extension}"/> <action application="lua" data="test.lua"/>
then test.lua is not executed, no matter the dialed_extension answered the call or not,
my question is: 1. why is this happening? 2. how can i get test.lua get executed after "bridge"?
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
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
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
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
i commented hangup_after_bridge and the problem persists, my lua script: freeswitch.consoleLog("info", "lua===============================================\n" ) dialplan: <extension name="test_lua" continue="false"> <condition field="destination_number" expression="^(10[01][0-9])$"> <action application="export" data="dialed_extension=$1"/> <!--<action application="set" data="hangup_after_bridge=true"/>--> <action application="bridge" data="user/${dialed_extension}"/> <action application="answer"/> <action application="lua" data="test.lua"/> <action application="sleep" data="1000"/> </condition> </extension> 2013/6/10 Vincent Xia <gmangudai@gmail.com>
my lua script is very simple with just one sentence to print info on freeswitch console, i've post it along with the dialplan anyways.
2013/6/10 Brian Foster <bdfoster@davri.com>
What exactly is your Lua script doing? Please post your script here at http://pastebin.freeswitch.org. Also go ahead and post your relevent dialplan and reply with links to both posts.
- BDF On Jun 10, 2013 12:29 AM, "Vincent Xia" <gmangudai@gmail.com> wrote:
i set the dialplan to call test.lua by adding <action application="lua" data="test.lua"/>
it works fine when placing it before a "bridge" action, like <action application="lua" data="test.lua"/> <action application="bridge" data="user/${dialed_extension}"/>
but if i put "lua" after "bridge" <action application="bridge" data="user/${dialed_extension}"/> <action application="lua" data="test.lua"/>
then test.lua is not executed, no matter the dialed_extension answered the call or not,
my question is: 1. why is this happening? 2. how can i get test.lua get executed after "bridge"?
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
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
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
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
Did you do a reloadxml after commenting it out? And can you pastebin the log of the call? -Avi On Mon, Jun 10, 2013 at 8:49 AM, Vincent Xia <gmangudai@gmail.com> wrote:
i commented hangup_after_bridge and the problem persists, my lua script: freeswitch.consoleLog("info", "lua===============================================\n" )
dialplan: <extension name="test_lua" continue="false"> <condition field="destination_number" expression="^(10[01][0-9])$"> <action application="export" data="dialed_extension=$1"/> <!--<action application="set" data="hangup_after_bridge=true"/>--> <action application="bridge" data="user/${dialed_extension}"/> <action application="answer"/> <action application="lua" data="test.lua"/> <action application="sleep" data="1000"/> </condition> </extension>
2013/6/10 Vincent Xia <gmangudai@gmail.com>
my lua script is very simple with just one sentence to print info on freeswitch console, i've post it along with the dialplan anyways.
2013/6/10 Brian Foster <bdfoster@davri.com>
What exactly is your Lua script doing? Please post your script here at http://pastebin.freeswitch.org. Also go ahead and post your relevent dialplan and reply with links to both posts.
- BDF On Jun 10, 2013 12:29 AM, "Vincent Xia" <gmangudai@gmail.com> wrote:
i set the dialplan to call test.lua by adding <action application="lua" data="test.lua"/>
it works fine when placing it before a "bridge" action, like <action application="lua" data="test.lua"/> <action application="bridge" data="user/${dialed_extension}"/>
but if i put "lua" after "bridge" <action application="bridge" data="user/${dialed_extension}"/> <action application="lua" data="test.lua"/>
then test.lua is not executed, no matter the dialed_extension answered the call or not,
my question is: 1. why is this happening? 2. how can i get test.lua get executed after "bridge"?
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
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
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
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
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
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
Do you have <action application="set" data="hangup_after_bridge=true"/> ? (wiki) <https://wiki.freeswitch.org/wiki/Variable_hangup_after_bridge> That's a usual way to run your dialplan and will hangup the channel before the lua script gets called. So you can either not use the hangup_after_bridge, or, use an api_hangup_hook <http://wiki.freeswitch.org/wiki/Variable_api_hangup_hook>. -Avi On Mon, Jun 10, 2013 at 7:19 AM, Vincent Xia <gmangudai@gmail.com> wrote:
i set the dialplan to call test.lua by adding <action application="lua" data="test.lua"/>
it works fine when placing it before a "bridge" action, like <action application="lua" data="test.lua"/> <action application="bridge" data="user/${dialed_extension}"/>
but if i put "lua" after "bridge" <action application="bridge" data="user/${dialed_extension}"/> <action application="lua" data="test.lua"/>
then test.lua is not executed, no matter the dialed_extension answered the call or not,
my question is: 1. why is this happening? 2. how can i get test.lua get executed after "bridge"?
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
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
First of all, as long as the call is bridged, it won't continue to your lua script. If you want to call the lua script if the bridge fails you must set this variable: continue_on_fail=true. If you want to execute the script after normal clearing, make sure to set hangup_after_bridge=false (that's probably the default though). 2013/6/10 Vincent Xia <gmangudai@gmail.com>
i set the dialplan to call test.lua by adding <action application="lua" data="test.lua"/>
it works fine when placing it before a "bridge" action, like <action application="lua" data="test.lua"/> <action application="bridge" data="user/${dialed_extension}"/>
but if i put "lua" after "bridge" <action application="bridge" data="user/${dialed_extension}"/> <action application="lua" data="test.lua"/>
then test.lua is not executed, no matter the dialed_extension answered the call or not,
my question is: 1. why is this happening? 2. how can i get test.lua get executed after "bridge"?
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
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
participants (4)
-
Avi Marcus
-
Brian Foster
-
Peter Olsson
-
Vincent Xia