<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,&nbsp;</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.&nbsp;</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 &nbsp;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>&nbsp;&nbsp;try:</div><div>&nbsp;&nbsp; &nbsp;sessiondata = "{ignore_early_media=true,origination_caller_id_number=" + str(caller_id) + "}sofia/gateway/" + carrier + "/" + phonenum</div><div>&nbsp;&nbsp;&nbsp; new_session = &nbsp;Session(sessiondata)</div><div>&nbsp;&nbsp; &nbsp;if (not new_session.ready()): return(False)</div><div>&nbsp;&nbsp; &nbsp;if (recordfile &lt;&gt; ""): new_session.streamFile(promptfile)</div><div>&nbsp;&nbsp;
 &nbsp;new_session.execute("set","call_timeout=60")</div><div>&nbsp;&nbsp; &nbsp;new_session.execute("set","continue_on_fail=true")</div><div>&nbsp;&nbsp; &nbsp;new_session.execute("set","hangup_after_bridge=false")</div><div>&nbsp;&nbsp; &nbsp;new_session.execute("set", "ringback=%(2000,4000,440.0,480.0)")</div><div>&nbsp;&nbsp; &nbsp;if (not new_session.ready()): return(False)</div><div>&nbsp;&nbsp; &nbsp;if (not session.ready()): return(False)</div><div>&nbsp;&nbsp; &nbsp;bridge(session,new_session)</div><div>&nbsp;&nbsp; &nbsp;new_session.hangup()</div><div>&nbsp;&nbsp;except:</div><div>&nbsp;&nbsp; &nbsp;report_exception()</div><div>&nbsp;&nbsp; &nbsp;return(False)</div><div>&nbsp;&nbsp;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? &nbsp; 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>