[Freeswitch-users] Stale channel that cannot be killed, session created from a running Lua scripts.
Abaci
abaci64 at gmail.com
Thu Apr 11 22:25:31 MSD 2013
Can you please document this on the wiki.
On 4/10/2013 5:13 PM, Johny Kadarisman Kwan wrote:
> Cool, Thank you
>
> It works now! no more stale session
>
> session:destroy() and assigned nullable after transfer seems enough on
> this case
>
> =================== SimpleDialer.lua (after suggestion from Anthony)
> ============
>
> local threadName = "SimpleDialer"
>
> while true do
> freeswitch.consoleLog("info", threadName.." ticking\n")
> -- task run here
> local new_session = freeswitch.Session('sofia/gateway/vox/+150
> <tel:%2B15085895115>88888888')
> new_session:transfer("echo", "XML", "default")
> new_session:destroy()
> new_session = nil
>
> freeswitch.msleep(60000)
> end
>
>
> On Wed, Apr 10, 2013 at 4:17 PM, Anthony Minessale
> <anthony.minessale at gmail.com <mailto:anthony.minessale at gmail.com>> wrote:
>
> try
>
> new_session:setAutoHangup(0);
> new_session:destroy();
>
> before you transfer it.
> and
>
> new_session = undefined;
>
> after you transfer it.
>
> The sessions are tied to the garbage collector so until the script
> frees the script version of the session the core can't free the
> real version.
>
> the :destroy() method detaches the 2 so the channel can hangup on
> its own and you only save the shell of the wrapper in your GC.
>
>
>
>
>
>
>
>
>
> On Wed, Apr 10, 2013 at 2:34 PM, Johny Kadarisman Kwan
> <jkr888 at gmail.com <mailto:jkr888 at gmail.com>> wrote:
>
> I have lua 'background' script that wake up every few seconds,
> and check to perform specific task, one of it to established call.
> Calls are then initiated then transfer to some extension in
> dialplan. The scripts has been running and works as expected.
> But after session ended(hangup), channels is not released and
> can be seen using cli "show channels". and trying to kill such
> channel result in "-ERR No Such Channel!"
>
> This seems being reported before, but I can't seems to find
> any resolution.
>
> Following simple script could replicate the issues :
>
> freeswitch> luarun SimpleDialer.lua
>
> =================== SimpleDialer.lua
>
> local threadName = "SimpleDialer"
>
> while true do
> freeswitch.consoleLog("info", threadName.." ticking\n")
> -- task run here
> local new_session =
> freeswitch.Session('sofia/gateway/vox/+150
> <tel:%2B15085895115>88888888')
> new_session:transfer("echo", "XML", "default")
>
> freeswitch.msleep(60000)
> end
>
> ============= dialplan entry
>
> <extension name="echo">
> <condition field="destination_number" expression="^echo$">
> <action application="echo" data=""/>
> </condition>
> </extension>
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org <mailto:consulting at freeswitch.org>
> http://www.freeswitchsolutions.com
>
>
>
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> <mailto:FreeSWITCH-users at lists.freeswitch.org>
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
>
>
> --
> Anthony Minessale II
>
> FreeSWITCH http://www.freeswitch.org/
> ClueCon http://www.cluecon.com/
> Twitter: http://twitter.com/FreeSWITCH_wire
>
> AIM: anthm
> MSN:anthony_minessale at hotmail.com
> <mailto:MSN%3Aanthony_minessale at hotmail.com>
> GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com
> <mailto:PAYPAL%3Aanthony.minessale at gmail.com>
> IRC: irc.freenode.net <http://irc.freenode.net> #freeswitch
>
> FreeSWITCH Developer Conference
> sip:888 at conference.freeswitch.org
> <mailto:sip%3A888 at conference.freeswitch.org>
> googletalk:conf+888 at conference.freeswitch.org
> <mailto:googletalk%3Aconf%2B888 at conference.freeswitch.org>
> pstn:+19193869900 <tel:%2B19193869900>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org <mailto:consulting at freeswitch.org>
> http://www.freeswitchsolutions.com
>
>
>
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> <mailto:FreeSWITCH-users at 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 at freeswitch.org
> http://www.freeswitchsolutions.com
>
>
>
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130411/c7a7e327/attachment-0001.html
Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users
mailing list