how to terminate session in freeswitch after channel hangup
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
stop your loop if session.ready() is false. On Wed, Jun 25, 2014 at 12:01 PM, Aqs Younas <aqsyounas@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@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Thank for you reply and time.It works like charm. On 26 June 2014 00:59, Christopher Rienzo <cmrienzo@gmail.com> wrote:
stop your loop if session.ready() is false.
On Wed, Jun 25, 2014 at 12:01 PM, Aqs Younas <aqsyounas@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@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (2)
-
Aqs Younas
-
Christopher Rienzo