<div dir="ltr">Sorry if this mail is sent twice. In my case, the session is not already created. <br><br>&nbsp;My actual requirement is similar to a call center setup - <br><br>&nbsp;&nbsp;&nbsp; 1.Park calls coming to extension 800 in mod_fifo.<br>
&nbsp;&nbsp;&nbsp; 2. Originate calls to a group of extensions simultanously <br>
&nbsp;&nbsp;&nbsp; 3. After an extension answers, bridge that call with a call pulled out of mod_fifo.<br><br>For
this, wrote some event_socket code to listen to fifo events and when a
call is pushed into the queue, i do a jsrun command to originate calls
to the number and bridge it with a call in fifo queue. Unfortunately
for me, the code didn&#39;t work as expected. I am enclosing the code below
- <br>
<br><b>Dial Plan: </b><br><br>&lt;extension name=&quot;callcentre&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;condition field=&quot;${destination_number}&quot; expression=&quot;^800$&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;set&quot; data=&quot;tts_engine=flite&quot;/&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div dir="ltr">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;set&quot; data=&quot;tts_voice=kal&quot;/&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;fifo&quot; data=&quot;callcentre_queue in nowait
E:/othersounds/holdmusic.mp3 E:/othersounds/holdmusic.mp3&quot; /&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/condition&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/extension&gt;<br><br><b>Event Socket (It uses Ray&#39;s event socket php code in contrib section) : </b><br><br>&lt;?php<br>require_once(&#39;fs_sock.php&#39;);<br><br>$connectionInfo = array(<br>

&#39;host&#39;=&gt;&#39;localhost&#39;,<br>&#39;port&#39;=&gt;&#39;8021&#39;,<br>&#39;pass&#39;=&gt;&#39;ClueCon&#39;,<br>&#39;timeout&#39;=&gt;3,<br>&#39;stream_timeout&#39;=&gt;0.5<br>);<br><br>$fsObj = new fs_sock($connectionInfo);<br>

<br>if ($fsObj -&gt; auth != true) {<br>&nbsp;&nbsp;&nbsp; die(printf(&quot;Unable to authenticate\r\n&quot;));<br>}<br><br>if (!$fsObj -&gt; subscribe_events(&#39;plain CUSTOM fifo::info&#39;)) {<br>&nbsp;&nbsp;&nbsp; die(printf(&quot;Unable to subscribe to events&quot;));<br>

}<br><br>while(1) {<br>&nbsp; $output = $fsObj -&gt; wait_for_event();<br>&nbsp; if($output != null &amp;&amp; isset ($output[&#39;Body&#39;][&#39;FIFO-Action&#39;]) &amp;&amp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $output[&#39;Body&#39;][&#39;FIFO-Action&#39;] == &quot;push&quot;) {<br>

&nbsp;&nbsp;&nbsp; //Send the command to run the javascript. <br>&nbsp;&nbsp;&nbsp; $fsObj-&gt;bgapi_command(&quot;jsrun CallConnect.js&quot;);<br>&nbsp; }<br>}<br><br>$fsObj -&gt; sock_close();<br><br>?&gt;<br><br><b>JavaScript: </b><br><br>newSession = new Session();<br>

done = false;<br><br>var extensions = new Array(&#39;user/<a href="mailto:1001@10.1.1.202" target="_blank">1001@10.1.1.202</a>&#39;,&#39;user/<a href="mailto:1002@10.1.1.202" target="_blank">1002@10.1.1.202</a>&#39;,&#39;user/<a href="mailto:1004@10.1.1.202" target="_blank">1004@10.1.1.202</a>&#39;,&#39;user/<a href="mailto:1005@10.1.1.202" target="_blank">1005@10.1.1.202</a>&#39;);<br>

var i = 0;<br>while(!done) {<br>&nbsp; result = newSession.originate(session, extensions[i] + &quot;,user/<a href="mailto:9999@10.1.1.202" target="_blank">9999@10.1.1.202</a>&quot;,2); //It does not originate call to 9999 but timeout works<br>

//&nbsp; result = newSession.originate(session, extensions[i] ,2); //timeout does not work<br>&nbsp; if(result) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; newSession.answer();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; newSession.execute( &quot;fifo&quot;, &quot;callcentre_queue out wait undef undef&quot; );<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; done = true;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>&nbsp; }<br>&nbsp; i = (i &gt;= extensions.length) ?&nbsp; 0&nbsp; : i+1;<br>}<br><br>My
requirement is for the js to originate multiple calls simulatnously
like how bridge does it. If that is not possible, i would ring each
extension for a second until someone picks up. <br>
<br>Thanks.<br><br clear="all">B Karthik<br></div><br><br>
<br><br><div class="gmail_quote">On Mon, Aug 18, 2008 at 9:30 PM,  <span dir="ltr">&lt;<a href="mailto:freeswitch-users-request@lists.freeswitch.org">freeswitch-users-request@lists.freeswitch.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Send Freeswitch-users mailing list submissions to<br>
 &nbsp; &nbsp; &nbsp; &nbsp;<a href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
 &nbsp; &nbsp; &nbsp; &nbsp;<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
or, via email, send a message with subject or body &#39;help&#39; to<br>
 &nbsp; &nbsp; &nbsp; &nbsp;<a href="mailto:freeswitch-users-request@lists.freeswitch.org">freeswitch-users-request@lists.freeswitch.org</a><br>
<br>
You can reach the person managing the list at<br>
 &nbsp; &nbsp; &nbsp; &nbsp;<a href="mailto:freeswitch-users-owner@lists.freeswitch.org">freeswitch-users-owner@lists.freeswitch.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than &quot;Re: Contents of Freeswitch-users digest...&quot;<br>
<br>Today&#39;s Topics:<br>
<br>
 &nbsp; 1. Re: Problem using originate (Anthony Minessale)<br>
<br><br>---------- Forwarded message ----------<br>From:&nbsp;&quot;Anthony Minessale&quot; &lt;<a href="mailto:anthony.minessale@gmail.com">anthony.minessale@gmail.com</a>&gt;<br>To:&nbsp;<a href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a><br>
Date:&nbsp;Mon, 18 Aug 2008 10:52:17 -0500<br>Subject:&nbsp;Re: [Freeswitch-users] Problem using originate<br><div dir="ltr">the originate method should only be called on a session that was created with no arguments to the constructor.<br>
<br>For an existing session you should use session.execute(&quot;bridge&quot;, &quot;&lt;originate string&gt;&quot;);<br>
<br>the timeout can be set inside the originate string with the {} variables.<br><br>&quot;{call_timeout=5}sofia/dest/<a href="mailto:user@host.com" target="_blank">user@host.com</a>&quot;<br><br>Everything inside the originate string is identical to anything that takes the originate arg, including the originate CLI FSAPI command, the bridge app and that originate method to embedded langs.<br>

<br><br><br><br><br><div class="gmail_quote">On Mon, Aug 18, 2008 at 9:00 AM, Brian West <span dir="ltr">&lt;<a href="mailto:brian@freeswitch.org" target="_blank">brian@freeswitch.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Can you clarify what you&#39;re doing. &nbsp;Create a small test case and post<br>
that along with instructions on how you&#39;re create this scenario that<br>
will help greatly on my part.<br>
<br>
/b<br>
<div><br>
On Aug 18, 2008, at 8:57 AM, B Karthik wrote:<br>
<br>
&gt; Can someone &nbsp;help me on this please....<br>
&gt;<br>
&gt; Thanks.<br>
&gt;<br>
&gt; B Karthik<br>
<br>
</div><font color="#888888">Brian West<br>
<a href="mailto:sip%3Abrian@freeswitch.org" target="_blank">sip:brian@freeswitch.org</a><br>
</font><div><div></div><div><br>
<br>
<br>
<br>
_______________________________________________<br>
Freeswitch-users mailing list<br>
<a href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">Freeswitch-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br>

<br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com" target="_blank">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com" target="_blank">PAYPAL:anthony.minessale@gmail.com</a><br>

IRC: <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org" target="_blank">sip:888@conference.freeswitch.org</a><br>
<a href="http://iax:guest@conference.freeswitch.org/888" target="_blank">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org" target="_blank">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:213-799-1400<br>
</div>
<br>_______________________________________________<br>
Freeswitch-users mailing list<br>
<a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>