Hi,<div><br></div><div>&nbsp;&nbsp; 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]=&quot;39841799874&quot;;</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]=&quot;39894929942&quot;;</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&lt;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,
&quot;{ignore_early_media=true}sofia/default/&quot;+array[i]+&quot;@<a href="http://172.20.191.228">172.20.191.228</a>&quot;);</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(&quot;session.uuid&quot;, &quot;Session
OUTPUT: &quot; + 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(&quot;notice&quot;, &quot;Disconnect
cause: &quot; + 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(&quot;info&quot;, &quot;Disconnect
cause: &quot; + 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(&quot;notice&quot;, &quot;Session UUID: &quot; +
session.uuid + &quot;\n&quot;);</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(&quot;info&quot;, &quot;Disconnect cause: &quot;
+ session.cause + &quot;\n&quot;);</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(&quot;notice&quot;, &quot;Disconnect Code: &quot;
+ session.causecode + &quot;\n&quot;);</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(&quot;sleep&quot;,&quot;5000000&quot;);</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(&quot;notice&quot;, &quot;Session UUID: &quot; +
session.uuid + &quot;\n&quot;);</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(&quot;info&quot;, &quot;Disconnect cause: &quot;
+ session.cause + &quot;\n&quot;);</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(&quot;notice&quot;, &quot;Disconnect Code: &quot;
+ session.causecode + &quot;\n&quot;);</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.&nbsp;</span></p></span>-- <br>Thank you &nbsp;with regards,<br>Gopal,<br><br>
</div>