<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Vorformatiert Zchn";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Sprechblasentext Zchn";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        color:black;}
span.HTMLVorformatiertZchn
        {mso-style-name:"HTML Vorformatiert Zchn";
        mso-style-priority:99;
        mso-style-link:"HTML Vorformatiert";
        font-family:Consolas;
        color:black;}
span.E-MailFormatvorlage19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.SprechblasentextZchn
        {mso-style-name:"Sprechblasentext Zchn";
        mso-style-priority:99;
        mso-style-link:Sprechblasentext;
        font-family:"Tahoma","sans-serif";
        color:black;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body bgcolor=white lang=DE-AT link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Morning,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>i had the same problem a while ago, reported the jira below and anthm made some changes tu mod_lua.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>If you put &#8220;error()&#8221; as last command in your hangup handler (see <a href="http://wiki.freeswitch.org/wiki/Mod_lua#session:setHangupHook">http://wiki.freeswitch.org/wiki/Mod_lua#session:setHangupHook</a>)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>No error is dumped in the log.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Both &#8216;return &#8220;exit&#8221;&#8217; and &#8216;return &#8220;die&#8221;&#8217; leave an error in the logfiles.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>A little bit misleading in my opinion, but if you know how to handle it&#8230;it works.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Tried 15mins ago with latest git FreeSWITCH Version 1.0.head (git-ea975c3 2012-02-28 19-21-04 -0500)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Regards<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>gw<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>Von:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> freeswitch-users-bounces@lists.freeswitch.org [mail</span><span lang=DE style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>to:freeswitch-users-bounces@lists.freeswitch.org] <b>Im Auftrag von </b>Adam Kelloway<br><b>Gesendet:</b> Dienstag, 06. März 2012 18:36<br><b>An:</b> FreeSWITCH Users Help<br><b>Betreff:</b> Re: [Freeswitch-users] Any alternative to repetitive lua session:ready() calls?<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Kind of, all of those solutions consider the script exiting an 'error'. I am looking for something that exits without considering it an error and thus does not emit an [ERR] log.<br><br>On 3:59 PM, Peter Olsson wrote: <o:p></o:p></p><pre>Maybe this is what you are looking for?<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>commit 09ad887948f7513725ca8b53bdfe721d9008e73b<o:p></o:p></pre><pre>Author: Anthony Minessale <a href="mailto:anthm@freeswitch.org">&lt;anthm@freeswitch.org&gt;</a><o:p></o:p></pre><pre>Date:   Fri Jan 27 19:03:04 2012 -0600<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>    FS-3841 --resolve ok return the string &quot;die&quot; or &quot;exit&quot; from hanguphook to cause an error or call s:destroy(&quot;any err message&quot;); either should now halt the script<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>________________________________________<o:p></o:p></pre><pre>Från: <a href="mailto:freeswitch-users-bounces@lists.freeswitch.org">freeswitch-users-bounces@lists.freeswitch.org</a> [<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org">freeswitch-users-bounces@lists.freeswitch.org</a>] f&amp;#246;r Adam Kelloway [<a href="mailto:adam.kelloway@newpace.ca">adam.kelloway@newpace.ca</a>]<o:p></o:p></pre><pre>Skickat: den 6 mars 2012 17:22<o:p></o:p></pre><pre>Till: FreeSWITCH Users Help<o:p></o:p></pre><pre>Ämne: [Freeswitch-users] Any alternative to repetitive lua      session:ready() calls?<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Hi there,<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>If I am running a lua script during a call, and the call terminates<o:p></o:p></pre><pre>(caller hangs up, for instance), the lua script continues to execute<o:p></o:p></pre><pre>while the session has already been terminated. This causes ERR entries<o:p></o:p></pre><pre>in the freeswitch log, which I would like to try and minimize. The only<o:p></o:p></pre><pre>way I can see doing this is to frequently call session:ready() before<o:p></o:p></pre><pre>doing anything that could break the script. Is there a better way to<o:p></o:p></pre><pre>exit a script cleanly, without having to add X number of session:ready()<o:p></o:p></pre><pre>calls scattered about the script? Currently, I only call it once (at the<o:p></o:p></pre><pre>beginning of the script). I tried using the hangup hook, but I'm not<o:p></o:p></pre><pre>sure how I can get it to immediately exit the script.<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Thanks,<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Adam<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>_________________________________________________________________________<o:p></o:p></pre><pre>Professional FreeSWITCH Consulting Services:<o:p></o:p></pre><pre><a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><o:p></o:p></pre><pre><a href="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</a><o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>FreeSWITCH-powered IP PBX: The CudaTel Communication Server<o:p></o:p></pre><pre><a href="http://www.cudatel.com">http://www.cudatel.com</a><o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Official FreeSWITCH Sites<o:p></o:p></pre><pre><a href="http://www.freeswitch.org">http://www.freeswitch.org</a><o:p></o:p></pre><pre><a href="http://wiki.freeswitch.org">http://wiki.freeswitch.org</a><o:p></o:p></pre><pre><a href="http://www.cluecon.com">http://www.cluecon.com</a><o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>FreeSWITCH-users mailing list<o:p></o:p></pre><pre><a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><o:p></o:p></pre><pre><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><o:p></o:p></pre><pre>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><o:p></o:p></pre><pre><a href="http://www.freeswitch.org">http://www.freeswitch.org</a><o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>!DSPAM:4f56388f32766945510869!<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><p class=MsoNormal><o:p>&nbsp;</o:p></p><div><p class=MsoNormal>-- <br>Adam<br clear=all>-- <br clear=all><o:p></o:p></p><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 style='color:rgb(61, 35,&#13;&#10;        22)' id=signature><tr><td rowspan=2 style='padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal align=center style='text-align:center'><span style='font-size:10.0pt'><img border=0 width=50 height=50 id="_x0000_i1025" src="cid:image001.png@01CCFC41.808DEB40" alt="NewPace Logo"><o:p></o:p></span></p></td><td rowspan=5 style='padding:.75pt .75pt .75pt .75pt'></td><td style='padding:.75pt .75pt .75pt .75pt'></td><td rowspan=5 style='padding:.75pt .75pt .75pt .75pt'></td><td style='padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal><b><span style='font-size:11.0pt'>Adam Kelloway</span></b><span style='font-size:10.0pt'><o:p></o:p></span></p></td></tr><tr><td rowspan=4 style='background:#A8CF38;padding:.75pt .75pt .75pt .75pt'></td><td style='padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal><span style='font-size:10.0pt'>Software Engineer, NewPace<o:p></o:p></span></p></td></tr><tr><td style='padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal align=right style='text-align:right'><span style='font-size:10.0pt'>phone<o:p></o:p></span></p></td><td style='padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal><span style='font-size:10.0pt'>+1&nbsp;(902)&nbsp;406&#8211;8375&nbsp;&nbsp;x1031<o:p></o:p></span></p></td></tr><tr><td style='padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal align=right style='text-align:right'><span style='font-size:10.0pt'>email<o:p></o:p></span></p></td><td style='padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal><span style='font-size:10.0pt'><a href="mailto:Adam.Kelloway@newpace.com"><span style='color:#3D2316;text-decoration:none'>Adam.Kelloway@NewPace.com</span></a><o:p></o:p></span></p></td></tr><tr><td style='padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal align=right style='text-align:right'><span style='font-size:10.0pt'><a href="aim:GoIm?screenname=Adam.Kelloway@newpace.com"><span style='color:#3D2316;text-decoration:none'>aim</span></a>/<a href="msnim:chat?contact=Adam.Kelloway@newpace.com"><span style='color:#3D2316;text-decoration:none'>msn</span></a><o:p></o:p></span></p></td><td style='padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal><span style='font-size:10.0pt'><a href="aim:GoIm?screenname=Adam.Kelloway@newpace.ca"><span style='color:#3D2316;text-decoration:none'>Adam.Kelloway</span></a>@NewPace.ca<o:p></o:p></span></p></td></tr></table><p class=MsoNormal><span style='color:windowtext'><o:p>&nbsp;</o:p></span></p></div></div></body></html>