Hi,<div><br></div><div> I am trying to execute the following script, its working fine for call origination, but cant able to get the status for dialed numbers, able to get only the last dialed number not for both the numbers. The script as follows,</div>
<div><br></div><div><span class="Apple-style-span" style="font-weight: bold;">Javascript</span></div><div><span class="Apple-style-span" style="font-weight: bold;"><p style="mso-outline-level:1;margin:0in;font-family:Verdana;font-size:10.0pt">
<span class="Apple-style-span" style="font-weight: normal;">var
array = [2];</span></p>
<p style="mso-outline-level:1;margin:0in;font-family:Verdana;font-size:10.0pt"><span class="Apple-style-span" style="font-weight: normal;">array[0]="39841799874";</span></p>
<p style="mso-outline-level:1;margin:0in;font-family:Verdana;font-size:10.0pt"><span class="Apple-style-span" style="font-weight: normal;">array[1]="39894929942";</span></p>
<p style="mso-outline-level:1;margin:0in;font-family:Verdana;font-size:10.0pt"><span class="Apple-style-span" style="font-weight: normal;">for(var
i=0;i<array.length;i++)</span></p>
<p style="mso-outline-level:1;margin:0in;font-family:Verdana;font-size:10.0pt"><span class="Apple-style-span" style="font-weight: normal;">{</span></p>
<p style="mso-outline-level:2;margin:0in;margin-left:.5in;font-family:Verdana;
font-size:10.0pt"><span class="Apple-style-span" style="font-weight: normal;">session = new Session();</span></p>
<p style="mso-outline-level:2;margin:0in;margin-left:.5in;font-family:Verdana;
font-size:10.0pt"><span class="Apple-style-span" style="font-weight: normal;">session.originate(session,
"{ignore_early_media=true}sofia/default/"+array[i]+"@<a href="http://172.20.191.228">172.20.191.228</a>");</span></p>
<p style="mso-outline-level:2;margin:0in;margin-left:.5in;font-family:Verdana;
font-size:10.0pt"><span class="Apple-style-span" style="font-weight: normal;">if (session.ready())</span></p>
<p style="mso-outline-level:2;margin:0in;margin-left:.5in;font-family:Verdana;
font-size:10.0pt"><span class="Apple-style-span" style="font-weight: normal;">{</span></p>
<p style="mso-outline-level:2;margin:0in;margin-left:.5in;font-family:Verdana;
font-size:10.0pt"><span class="Apple-style-span" style="font-weight: normal;">//session.setVariable("session.uuid", "Session
OUTPUT: " + session.uuid);</span></p>
<p style="mso-outline-level:2;margin:0in;margin-left:.5in;font-family:Verdana;
font-size:10.0pt"><span class="Apple-style-span" style="font-weight: normal;">//session.setVariable("notice", "Disconnect
cause: " + session.cause);</span></p>
<p style="mso-outline-level:2;margin:0in;margin-left:.5in;font-family:Verdana;
font-size:10.0pt"><span class="Apple-style-span" style="font-weight: normal;">//session.setVariable("info", "Disconnect
cause: " + session.causecode);</span></p>
<p style="mso-outline-level:2;margin:0in;margin-left:.5in;font-family:Verdana;
font-size:10.0pt"><span class="Apple-style-span" style="font-weight: normal;">console_log("notice", "Session UUID: " +
session.uuid + "\n");</span></p>
<p style="mso-outline-level:2;margin:0in;margin-left:.5in;font-family:Verdana;
font-size:10.0pt"><span class="Apple-style-span" style="font-weight: normal;">console_log("info", "Disconnect cause: "
+ session.cause + "\n");</span></p>
<p style="mso-outline-level:2;margin:0in;margin-left:.5in;font-family:Verdana;
font-size:10.0pt"><span class="Apple-style-span" style="font-weight: normal;">console_log("notice", "Disconnect Code: "
+ session.causecode + "\n");</span></p>
<p style="mso-outline-level:2;margin:0in;margin-left:.5in;font-family:Verdana;
font-size:10.0pt"><span class="Apple-style-span" style="font-weight: normal;">}</span></p>
<p style="mso-outline-level:1;margin:0in;font-family:Verdana;font-size:10.0pt"><span class="Apple-style-span" style="font-weight: normal;">}</span></p>
<p style="mso-outline-level:2;margin:0in;margin-left:.5in;font-family:Verdana;
font-size:10.0pt"><span class="Apple-style-span" style="font-weight: normal;">if (session.answer())</span></p>
<p style="mso-outline-level:2;margin:0in;margin-left:.5in;font-family:Verdana;
font-size:10.0pt"><span class="Apple-style-span" style="font-weight: normal;">{</span></p>
<p style="mso-outline-level:2;margin:0in;margin-left:.5in;font-family:Verdana;
font-size:10.0pt"><span class="Apple-style-span" style="font-weight: normal;">session.execute("sleep","5000000");</span></p>
<p style="mso-outline-level:2;margin:0in;margin-left:.5in;font-family:Verdana;
font-size:10.0pt"><span class="Apple-style-span" style="font-weight: normal;">console_log("notice", "Session UUID: " +
session.uuid + "\n");</span></p>
<p style="mso-outline-level:2;margin:0in;margin-left:.5in;font-family:Verdana;
font-size:10.0pt"><span class="Apple-style-span" style="font-weight: normal;">console_log("info", "Disconnect cause: "
+ session.cause + "\n");</span></p>
<p style="mso-outline-level:2;margin:0in;margin-left:.5in;font-family:Verdana;
font-size:10.0pt"><span class="Apple-style-span" style="font-weight: normal;">console_log("notice", "Disconnect Code: "
+ session.causecode + "\n");</span></p>
<p style="mso-outline-level:2;margin:0in;margin-left:.5in;font-family:Verdana;
font-size:10.0pt"><span class="Apple-style-span" style="font-weight: normal;">}</span></p></span><div><br></div><span class="Apple-style-span" style="font-weight: bold;">The steps as follows,</span></div><div><span class="Apple-style-span" style="font-weight: bold;"><p style="mso-outline-level:1;margin:0in;font-family:Verdana;font-size:10.0pt">
<span class="Apple-style-span" style="font-weight: normal;">1.
enter into the array - </span>working fine</p>
<p style="mso-outline-level:1;margin:0in;font-family:Verdana;font-size:10.0pt"><span class="Apple-style-span" style="font-weight: normal;">2.
take each number to the originate session via for loop - </span>working fine</p>
<p style="mso-outline-level:1;margin:0in;font-family:Verdana;font-size:10.0pt"><span class="Apple-style-span" style="font-weight: normal;">3.
the call has to be answered by the session - </span>working fine</p>
<p style="mso-outline-level:1;margin:0in;font-family:Verdana;font-size:10.0pt"><span class="Apple-style-span" style="font-weight: normal;">4.
the call status need to be printed in console for each call - </span>printing only for the last dialed call</p><p style="mso-outline-level:1;margin:0in;font-family:Verdana;font-size:10.0pt"><br></p><p style="mso-outline-level:1;margin:0in;font-family:Verdana;font-size:10.0pt">
<span class="Apple-style-span" style="font-weight: normal;">Any suggestion would help us. </span></p></span>-- <br>Thank you with regards,<br>Gopal,<br><br>
</div>