Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] FreeSWITCH crashes when bridging two calls in python script


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
marc at kasteris.com
Guest





PostPosted: Fri Aug 14, 2009 5:36 pm    Post subject: [Freeswitch-users] FreeSWITCH crashes when bridging two call Reply with quote

Hello,


I'm trying to play a prompt to the B-leg of a bridged call in Python.
I place the call to the B-leg, play the prompt, and then bridge it with the A-Leg, but then FreeSWITCH crashes when the call is completed.


Here's the code I'm using:


def bridge_call_with_prompt(session,carrier,caller_id,phonenum,promptfile,recordfile):
try:
sessiondata = "{ignore_early_media=true,origination_caller_id_number=" + str(caller_id) + "}sofia/gateway/" + carrier + "/" + phonenum
new_session = Session(sessiondata)
if (not new_session.ready()): return(False)
if (recordfile <> ""): new_session.streamFile(promptfile)
new_session.execute("set","call_timeout=60")
new_session.execute("set","continue_on_fail=true")
new_session.execute("set","hangup_after_bridge=false")
new_session.execute("set", "ringback=%(2000,4000,440.0,480.0)")
if (not new_session.ready()): return(False)
if (not session.ready()): return(False)
bridge(session,new_session)
new_session.hangup()
except:
report_exception()
return(False)
return(True)


Does anybody know how I can stop it from crashing, and/or another way to go about this? If I simply do:


session.execute("bridge","sofia/gateway/" + carrier + "/" + phonenum)



it won't cause FreeSWITCH to crash, but then I can't play my prompt.


Thanks,
Marc
Back to top
mike at jerris.com
Guest





PostPosted: Fri Aug 14, 2009 10:21 pm    Post subject: [Freeswitch-users] FreeSWITCH crashes when bridging two call Reply with quote

Please open a bug on jira.freeswitch.org

mike

On Aug 14, 2009, at 6:27 PM, Marc Orenberg wrote:
Quote:
Hello,


I'm trying to play a prompt to the B-leg of a bridged call in Python.
I place the call to the B-leg, play the prompt, and then bridge it with the A-Leg, but then FreeSWITCH crashes when the call is completed.


Here's the code I'm using:


def bridge_call_with_prompt(session,carrier,caller_id,phonenum,promptfile,recordfile):
try:
sessiondata = "{ignore_early_media=true,origination_caller_id_number=" + str(caller_id) + "}sofia/gateway/" + carrier + "/" + phonenum
new_session = Session(sessiondata)
if (not new_session.ready()): return(False)
if (recordfile <> ""): new_session.streamFile(promptfile)
new_session.execute("set","call_timeout=60")
new_session.execute("set","continue_on_fail=true")
new_session.execute("set","hangup_after_bridge=false")
new_session.execute("set", "ringback=%(2000,4000,440.0,480.0)")
if (not new_session.ready()): return(False)
if (not session.ready()): return(False)
bridge(session,new_session)
new_session.hangup()
except:
report_exception()
return(False)
return(True)


Does anybody know how I can stop it from crashing, and/or another way to go about this? If I simply do:


session.execute("bridge","sofia/gateway/" + carrier + "/" + phonenum)



it won't cause FreeSWITCH to crash, but then I can't play my prompt.


Thanks,
Marc



Back to top
mrene_lists at avgs.ca
Guest





PostPosted: Fri Aug 14, 2009 10:25 pm    Post subject: [Freeswitch-users] FreeSWITCH crashes when bridging two call Reply with quote

Hi,

Can you provide us with a backtrace of the crash? you can open a bug report on http://jira.freeswitch.org/


Also, if you want to play a prompt file and wait for a dtmf to accept the call, there are variables called group_confirm_file and group_confirm_key that will make the core take care of that for you.


Mathieu Rene
Avant-Garde Solutions Inc
Office: + 1 (514) 664-1044 x100
Cell: +1 (514) 664-1044 x200
mrene@avgs.ca (mrene@avgs.ca)








On 14-Aug-09, at 6:27 PM, Marc Orenberg wrote:
Quote:
Hello,


I'm trying to play a prompt to the B-leg of a bridged call in Python.
I place the call to the B-leg, play the prompt, and then bridge it with the A-Leg, but then FreeSWITCH crashes when the call is completed.


Here's the code I'm using:


def bridge_call_with_prompt(session,carrier,caller_id,phonenum,promptfile,recordfile):
try:
sessiondata = "{ignore_early_media=true,origination_caller_id_number=" + str(caller_id) + "}sofia/gateway/" + carrier + "/" + phonenum
new_session = Session(sessiondata)
if (not new_session.ready()): return(False)
if (recordfile <> ""): new_session.streamFile(promptfile)
new_session.execute("set","call_timeout=60")
new_session.execute("set","continue_on_fail=true")
new_session.execute("set","hangup_after_bridge=false")
new_session.execute("set", "ringback=%(2000,4000,440.0,480.0)")
if (not new_session.ready()): return(False)
if (not session.ready()): return(False)
bridge(session,new_session)
new_session.hangup()
except:
report_exception()
return(False)
return(True)


Does anybody know how I can stop it from crashing, and/or another way to go about this? If I simply do:


session.execute("bridge","sofia/gateway/" + carrier + "/" + phonenum)



it won't cause FreeSWITCH to crash, but then I can't play my prompt.


Thanks,
Marc





_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (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

Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services