<div dir="ltr">In my case, the session is not already created. <br><br> My actual requirement is similar to a call center setup - <br><br> 1.Park calls coming to extension 800 in mod_fifo.<br> 2. Originate calls to a group of extensions simultanously <br>
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't work as expected. I am enclosing the code below - <br>
<br><b>Dial Plan: </b><br><br><extension name="callcentre"><br> <condition field="${destination_number}" expression="^800$"><br> <action application="set" data="tts_engine=flite"/> <br>
<action application="set" data="tts_voice=kal"/> <br> <action application="fifo" data="callcentre_queue in nowait E:/othersounds/holdmusic.mp3 E:/othersounds/holdmusic.mp3" /><br>
</condition><br> </extension><br><br><b>Event Socket (It uses Ray's event socket php code in contrib section) : </b><br><br><?php<br>require_once('fs_sock.php');<br><br>$connectionInfo = array(<br>
'host'=>'localhost',<br>'port'=>'8021',<br>'pass'=>'ClueCon',<br>'timeout'=>3,<br>'stream_timeout'=>0.5<br>);<br><br>$fsObj = new fs_sock($connectionInfo);<br>
<br>if ($fsObj -> auth != true) {<br> die(printf("Unable to authenticate\r\n"));<br>}<br><br>if (!$fsObj -> subscribe_events('plain CUSTOM fifo::info')) {<br> die(printf("Unable to subscribe to events"));<br>
}<br><br>while(1) {<br> $output = $fsObj -> wait_for_event();<br> if($output != null && isset ($output['Body']['FIFO-Action']) && <br> $output['Body']['FIFO-Action'] == "push") {<br>
//Send the command to run the javascript. <br> $fsObj->bgapi_command("jsrun CallConnect.js");<br> }<br>}<br><br>$fsObj -> sock_close();<br><br>?><br><br><b>JavaScript: </b><br><br>newSession = new Session();<br>
done = false;<br><br>var extensions = new Array('user/<a href="mailto:1001@10.1.1.202">1001@10.1.1.202</a>','user/<a href="mailto:1002@10.1.1.202">1002@10.1.1.202</a>','user/<a href="mailto:1004@10.1.1.202">1004@10.1.1.202</a>','user/<a href="mailto:1005@10.1.1.202">1005@10.1.1.202</a>');<br>
var i = 0;<br>while(!done) {<br> result = newSession.originate(session, extensions[i] + ",user/<a href="mailto:9999@10.1.1.202">9999@10.1.1.202</a>",2); //It does not originate call to 9999 but timeout works<br>
// result = newSession.originate(session, extensions[i] ,2); //timeout does not work<br> if(result) {<br> newSession.answer();<br> newSession.execute( "fifo", "callcentre_queue out wait undef undef" );<br>
done = true;<br> break;<br> }<br> i = (i >= extensions.length) ? 0 : 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><br>
<br><br><div class="gmail_quote">On Mon, Aug 18, 2008 at 9:30 PM, <span dir="ltr"><<a href="mailto:freeswitch-users-request@lists.freeswitch.org">freeswitch-users-request@lists.freeswitch.org</a>></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>
<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>
<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 'help' to<br>
<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>
<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 "Re: Contents of Freeswitch-users digest..."<br>
<br>Today's Topics:<br>
<br>
1. Re: Problem using originate (Anthony Minessale)<br>
<br><br>---------- Forwarded message ----------<br>From: "Anthony Minessale" <<a href="mailto:anthony.minessale@gmail.com">anthony.minessale@gmail.com</a>><br>To: <a href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a><br>
Date: Mon, 18 Aug 2008 10:52:17 -0500<br>Subject: 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("bridge", "<originate string>");<br>
<br>the timeout can be set inside the originate string with the {} variables.<br><br>"{call_timeout=5}sofia/dest/<a href="mailto:user@host.com" target="_blank">user@host.com</a>"<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"><<a href="mailto:brian@freeswitch.org" target="_blank">brian@freeswitch.org</a>></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're doing. Create a small test case and post<br>
that along with instructions on how you'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>
> Can someone help me on this please....<br>
><br>
> Thanks.<br>
><br>
> 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>