<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:'times new roman', 'new york', times, serif;font-size:14pt;color:#000000;"><div><span class="Apple-style-span" style="font-size: medium;">Hello, </span></div><div><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 16px;"><br></span></font></div><div><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 16px;">I'm trying to play a prompt to the B-leg of a bridged call in Python. </span></font></div><div><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 16px;">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.</span></font></div><div><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size:
16px;"><br></span></font></div><div><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 16px;">Here's the code I'm using:</span></font></div><div><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 16px;"><br></span></font></div><div><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 16px;"><div>def bridge_call_with_prompt(session,carrier,caller_id,phonenum,promptfile,recordfile):</div><div> try:</div><div> sessiondata = "{ignore_early_media=true,origination_caller_id_number=" + str(caller_id) + "}sofia/gateway/" + carrier + "/" + phonenum</div><div> new_session = Session(sessiondata)</div><div> if (not new_session.ready()): return(False)</div><div> if (recordfile <> ""): new_session.streamFile(promptfile)</div><div>
new_session.execute("set","call_timeout=60")</div><div> new_session.execute("set","continue_on_fail=true")</div><div> new_session.execute("set","hangup_after_bridge=false")</div><div> new_session.execute("set", "ringback=%(2000,4000,440.0,480.0)")</div><div> if (not new_session.ready()): return(False)</div><div> if (not session.ready()): return(False)</div><div> bridge(session,new_session)</div><div> new_session.hangup()</div><div> except:</div><div> report_exception()</div><div> return(False)</div><div> return(True)</div><div><br></div><div>Does anybody know how I can stop it from crashing, and/or another way to go about this? If I simply do:</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">
        </span>session.execute("bridge","sofia/gateway/" + carrier + "/" + phonenum)<br></div><div><br></div><div>it won't cause FreeSWITCH to crash, but then I can't play my prompt.</div><div><br></div><div>Thanks,</div><div>Marc</div><div><br></div></span></font></div><div style="position:fixed"></div></div></body></html>