<div dir="ltr">Sine conference is a blocking call that only ends when you exit the conference, The next line of code after you execute conference is basically a hangup hook. If you test if the channel is still up you should be able to tell the difference between hangup and transfer.<div>
<br></div><div>Calling a conference from inside a lua script is a bit resource intensive compared to exiting the lua, calling the conference from the regular dialplan and going back to lua in an api_hangup_hook instead.</div>
<div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Nov 15, 2013 at 3:58 AM, Melanie Treitinger <span dir="ltr"><<a href="mailto:treitinger@as-infodienste.de" target="_blank">treitinger@as-infodienste.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<font face="Helvetica, Arial, sans-serif">Hi, <br>
<br>
I have the following scenario: When using a script in the
conference caller controls, the hangup hook gets destroyed.<br>
Affected script languages: Lua, Spidermonkey, Python, Perl<br>
<br>
You can easily reproduce this effect using the below Lua scripts
and adding the script application to the caller controls.<br>
This is what happens:<br>
- hangup without pressing a digit: hangup hook is called<br>
- press a digit without script call, then hangup: hangup hook is
called<br>
- press a digit with script call, then hangup: hangup hook is not
called<br>
<br>
Looking into the source code of session_destroy, you can see that
the hangup hook is in fact removed - which shold not happen when
calling a script.<br>
And there is no way to set it again after pressing the "*" digit.<br>
<br>
Any ideas on this?<br>
<br>
<br>
Thanks,<br>
Melanie</font><br>
<br>
<br>
<br>
<font face="Courier New, Courier, monospace">test-conferece.lua:</font><br>
<font face="Courier New, Courier, monospace">--------------</font><br>
<font face="Courier New, Courier, monospace">function
session_hangup_hook(status)</font><br>
<font face="Courier New, Courier, monospace">
freeswitch.consoleLog("NOTICE", "Session hangup: " .. status ..
"\n")</font><br>
<font face="Courier New, Courier, monospace"> error()</font><br>
<font face="Courier New, Courier, monospace">end</font><br>
<font face="Courier New, Courier, monospace"><br>
session:answer();</font><br>
<font face="Courier New, Courier, monospace">session:setHangupHook("session_hangup_hook")</font><br>
<font face="Courier New, Courier, monospace">conf_num = "3000"</font><br>
<font face="Courier New, Courier, monospace">session:execute("conference",
string.format("%s@default", conf_num))</font><br>
<font face="Courier New, Courier, monospace">session:hangup()</font><br>
<font face="Courier New, Courier, monospace"><br>
</font><br>
<font face="Courier New, Courier, monospace">caller_controls.lua:</font><br>
<font face="Courier New, Courier, monospace">--------------------</font><br>
<font face="Courier New, Courier, monospace">freeswitch.consoleLog("NOTICE","----
DTMF detect ----\n");</font><br>
<font face="Courier New, Courier, monospace"><br>
</font><br>
<font face="Courier New, Courier, monospace">conference.conf.xml:</font><br>
<font face="Courier New, Courier, monospace">--------------------</font><br>
<font face="Courier New, Courier, monospace"><caller-controls></font><br>
<font face="Courier New, Courier, monospace"><group
name="default"></font><br>
<font face="Courier New, Courier, monospace"> <control
action="mute" digits="0"/></font><br>
<font face="Courier New, Courier, monospace"> <control
action="execute_application" digits="*" data="lua
caller_controls.lua"/></font><br>
<font face="Courier New, Courier, monospace"> <control
action="energy up" digits="9"/></font><br>
<font face="Courier New, Courier, monospace"> <control
action="energy equ" digits="8"/></font><br>
<font face="Courier New, Courier, monospace"> <control
action="energy dn" digits="7"/></font><br>
<font face="Courier New, Courier, monospace"> <control
action="vol talk up" digits="3"/></font><br>
<font face="Courier New, Courier, monospace"> <control
action="vol talk zero" digits="2"/></font><br>
<font face="Courier New, Courier, monospace"> <control
action="vol talk dn" digits="1"/></font><br>
<font face="Courier New, Courier, monospace"> <control
action="vol listen up" digits="6"/></font><br>
<font face="Courier New, Courier, monospace"> <control
action="vol listen zero" digits="5"/></font><br>
<font face="Courier New, Courier, monospace"> <control
action="vol listen dn" digits="4"/></font><br>
<font face="Courier New, Courier, monospace"> <control
action="hangup" digits="#"/></font><br>
<font face="Courier New, Courier, monospace"></group> </font>
</div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-dev mailing list<br>
<a href="mailto:FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
Twitter: <a href="http://twitter.com/FreeSWITCH_wire">http://twitter.com/FreeSWITCH_wire</a><br><br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>
pstn:+19193869900
</div>