[Freeswitch-users] Any alternative to repetitive lua session:ready() calls?

Gerald Weber gerald.weber at besharp.at
Wed Mar 7 11:14:12 MSK 2012


Morning,

i had the same problem a while ago, reported the jira below and anthm made some changes tu mod_lua.
If you put "error()" as last command in your hangup handler (see http://wiki.freeswitch.org/wiki/Mod_lua#session:setHangupHook)
No error is dumped in the log.
Both 'return "exit"' and 'return "die"' leave an error in the logfiles.
A little bit misleading in my opinion, but if you know how to handle it...it works.

Tried 15mins ago with latest git FreeSWITCH Version 1.0.head (git-ea975c3 2012-02-28 19-21-04 -0500)

Regards
gw

Von: freeswitch-users-bounces at lists.freeswitch.org [mailto:freeswitch-users-bounces at lists.freeswitch.org] Im Auftrag von Adam Kelloway
Gesendet: Dienstag, 06. März 2012 18:36
An: FreeSWITCH Users Help
Betreff: Re: [Freeswitch-users] Any alternative to repetitive lua session:ready() calls?

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.

On 3:59 PM, Peter Olsson wrote:

Maybe this is what you are looking for?



commit 09ad887948f7513725ca8b53bdfe721d9008e73b

Author: Anthony Minessale <anthm at freeswitch.org><mailto:anthm at freeswitch.org>

Date:   Fri Jan 27 19:03:04 2012 -0600



    FS-3841 --resolve ok return the string "die" or "exit" from hanguphook to cause an error or call s:destroy("any err message"); either should now halt the script





________________________________________

Från: freeswitch-users-bounces at lists.freeswitch.org<mailto:freeswitch-users-bounces at lists.freeswitch.org> [freeswitch-users-bounces at lists.freeswitch.org<mailto:freeswitch-users-bounces at lists.freeswitch.org>] f&#246;r Adam Kelloway [adam.kelloway at newpace.ca<mailto:adam.kelloway at newpace.ca>]

Skickat: den 6 mars 2012 17:22

Till: FreeSWITCH Users Help

Ämne: [Freeswitch-users] Any alternative to repetitive lua      session:ready() calls?



Hi there,



If I am running a lua script during a call, and the call terminates

(caller hangs up, for instance), the lua script continues to execute

while the session has already been terminated. This causes ERR entries

in the freeswitch log, which I would like to try and minimize. The only

way I can see doing this is to frequently call session:ready() before

doing anything that could break the script. Is there a better way to

exit a script cleanly, without having to add X number of session:ready()

calls scattered about the script? Currently, I only call it once (at the

beginning of the script). I tried using the hangup hook, but I'm not

sure how I can get it to immediately exit the script.



Thanks,



Adam



_________________________________________________________________________

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



!DSPAM:4f56388f32766945510869!







--
Adam
--
[NewPace Logo]

Adam Kelloway


Software Engineer, NewPace

phone

+1 (902) 406-8375  x1031

email

Adam.Kelloway at NewPace.com<mailto:Adam.Kelloway at newpace.com>

aim<aim:GoIm?screenname=Adam.Kelloway at newpace.com>/msn<msnim:chat?contact=Adam.Kelloway at newpace.com>

Adam.Kelloway<aim:GoIm?screenname=Adam.Kelloway at newpace.ca>@NewPace.ca


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20120307/3bf5ed35/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 4620 bytes
Desc: image001.png
Url : http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20120307/3bf5ed35/attachment-0001.png 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list