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

Christopher Rienzo cmrienzo at gmail.com
Wed Jun 25 23:59:36 MSD 2014


stop your loop if session.ready() is false.



On Wed, Jun 25, 2014 at 12:01 PM, Aqs Younas <aqsyounas at gmail.com> wrote:

> 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
>
> _________________________________________________________________________
> 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/20140625/fe841ebd/attachment.html 


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