<div dir="ltr">Hi Freeswitch-Users,<div><br></div><div><span style="color:rgb(0,0,0);font-size:13px">We are basically working on a research project on Maternal Health, in which we have to call to women and instruct them about the diet at each stage of their pregnancy to reduce mortality rate due to pregnancy complications.</span><br></div><div><br></div><div>Could anyone please help us in implementing an outbound call? We are trying the following code but we are unable to make an outbound call properly and play a sound file when call get received by the called person.</div><div><br></div><div><b>Code:</b><span style="color:rgb(0,0,0);white-space:pre-wrap"> </span></div><div>--------------------------------------------------------------------------------<span style="color:rgb(0,0,0);white-space:pre-wrap"><br></span></div><div><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap">audio_file_path = "ivr/MESSAGE_TO_PLAY.wav";
<span style="font-family:arial,sans-serif">freeswitch.consoleLog("INFO","Initiating call\n");</span></pre><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap"><b>-- </b>this will call the person and move to next line of call get accepted/rejected etc</pre><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap"><b>session = freeswitch.Session("{ignore_early_media=true}gsmopen/gsm01/03454329512");</b></pre><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap"><b>-- </b>Checking session status
session:consoleLog("info", "checking session status\n");<br></pre><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap">-- Stream audio if session is ready
if(session:ready() == true) then
session:consoleLog("info", "ready to stream\n");
session:streamFile(<span style="font-family:arial,sans-serif">audio_file_path</span><span style="font-family:arial,sans-serif">);</span><br> <span style="font-family:arial,sans-serif">session:sleep(250);
</span><span style="font-family:arial,sans-serif"> session:hangup();
</span><span style="font-family:arial,sans-serif">end</span></pre></div><div>--------------------------------------------------------------------------------</div><div><br></div><div>But the problem isĀ </div><div><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap"><b>session = freeswitch.Session("{ignore_early_media=true}gsmopen/gsm01/03454329512"); </b>is not returning the control to the below code until user disconnect the call. At that time session got invalid. please help, how could we do Call-Out properly. We have posted the following issue n Jira but we remain unable to get our work done.</pre></div><div style><font color="#000000"><a href="https://freeswitch.org/jira/browse/FS-7101">https://freeswitch.org/jira/browse/FS-7101</a></font><br></div><div style><font color="#000000"><a href="https://freeswitch.org/jira/browse/FS-7057">https://freeswitch.org/jira/browse/FS-7057</a><br></font></div><div style><font color="#000000"><br></font></div><div style><font color="#000000">Please help us to make an outbound call and play a audio message. We will be very thankful to you.</font></div><div style><font color="#000000"><br></font></div><div style><font color="#000000">Kind Regards,</font></div><div style><font color="#000000"><br></font></div><div style><font color="#000000">Amna Batool and Abdul Mannan,</font></div><div style><font color="#000000">Information Technology University,</font></div><div style><font color="#000000">Lahore Pakistan</font></div><div style><font color="#000000"><br></font></div><div style><font color="#000000"><br></font></div></div>