[Freeswitch-users] how to terminate session in freeswitch after channel hangup

Aqs Younas aqsyounas at gmail.com
Wed Jun 25 20:01:01 MSD 2014


I run a python script that keeps on running until user presses * in while
loop and it works fine with *.

def handler(session, args):
        session.answer()
        digits=session.read(1, 1, "http://localhost/dtmf/dtmf.wav", 300,
"#")
        session.execute("curl","http://127.0.0.1/info.php post lang=%s"
%digits)
        cur=session.getVariable("curl_response_data")
        rec='';
        if (digits!='0'):
                while True:
                        session.execute("curl","http://127.0.0.1/info2.php
post currentshout=%s" %rec)
                        rec=session.getVariable("curl_response_data")
                        ex=session.read(1, 1, "
http://localhost/reciters//%s.mp3" %rec, 1, "#")
                        if (ex=='*'):
                                break
                        ex=session.read(1, 1, "
http://localhost/languages/%s/%s.mp3" %(cur,rec), 1, "#")
                        if (ex=='*'):
                                 break

But in while loop ig user hangup call(channel hangup) i keep getting this
error.

"channel is hangup and curl does not have zombie exec flag."

how can i terminate session on channel hangup.?

Any help in this regard would be appreciated.

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20140625/3c0bee31/attachment-0001.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list