The 2nd 2 examples you provided are invalid, they depict the usage of the originate api command in the context of the constructor<br>to a JS session.<br><br>If you want to send the call to another extension you have to create the channel like you did in the first example followed by<br>
session.execute(&quot;transfer&quot;, &quot;<font face="Arial, Helvetica, sans-serif">GINO_ANS XML default</font>&quot;);<br>at which time it would be wise if you deref the session object because its thread will be running in the new extension.<br>
<br><br>A better way would be to do both in one with a single call to the originate api command<br><br>apiExecute(&quot;originate&quot;, <font face="Arial, Helvetica, sans-serif">&quot;{id_name=&#39;${caller_id_name}&#39;,id_number=${caller_id_number}}sofia/gateway/spa3102PSTN/<a href="http://14082031170@10.0.0.5:5061/" target="_blank">14082031170@10.0.0.5:5061</a>
GINO_ANS XML default&quot;</font>);<br><br>This never gives you a session object it just creates a channel and transfers it to the desired extension.<br><br><br>A Documentation Re-factorial Engineer may be able to add it to the relevant page on the wiki if it is not already present.<br>

<br><br><br><div class="gmail_quote">On Wed, Apr 8, 2009 at 6:15 PM,  <span dir="ltr">&lt;<a href="mailto:mszlazak@aol.com">mszlazak@aol.com</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;">
<font face="Arial, Helvetica, sans-serif">I want to run a script with a scheduler but I&#39;m having a problem with how to set up the originate in Javascript.<br>
<br>
The originate would go something like:<br>
<br>
originate {id_name=&#39;${caller_id_name}&#39;,id_number=${caller_id_number}}sofia/gateway/spa3102PSTN/<a href="http://12223334444@10.0.0.5:5061" target="_blank">12223334444@10.0.0.5:5061</a> GINO_ANS<br>
<br>
I can get this to work:<br>
<br>
session = new Session(&quot;{id_name=&#39;${caller_id_name}&#39;,id_number=${caller_id_number}}sofia/gateway/spa3102PSTN/<a href="http://14082031170@10.0.0.5:5061" target="_blank">14082031170@10.0.0.5:5061</a>&quot;);<br>

<br>
But I want to &quot;drop&quot; that into an extension that runs another script and can&#39;t get either of these to work:<br>
<br>
session = new Session(&quot;{id_name=&#39;${caller_id_name}&#39;,id_number=${caller_id_number}}sofia/gateway/spa3102PSTN/<a href="http://14082031170@10.0.0.5:5061" target="_blank">14082031170@10.0.0.5:5061</a> GINO_ANS&quot;); <br>

<br>
</font><font face="Arial, Helvetica, sans-serif">session = new
Session(&quot;{id_name=&#39;${caller_id_name}&#39;,id_number=${caller_id_number}}sofia/gateway/spa3102PSTN/<a href="http://14082031170@10.0.0.5:5061" target="_blank">14082031170@10.0.0.5:5061</a>
GINO_ANS XML default&quot;);<br>
<br>
Also, will I have problems running the second script from the first script?<br>
<br>
Thanks.<br>
<br>
<br>
</font><div><br><font style="color: black; font-family: arial,san-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"> <hr style="margin-top: 10px;">
<a href="http://pr.atwola.com/promoclk/100126575x1219939010x1201342897/aol?redir=http:%2F%2Fad.doubleclick.net%2Fclk%3B213771626%3B35379597%3Bw" target="_blank">New Deals on Dell Netbooks - Now starting at $299</a></font> </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><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
<br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="http://iax:guest@conference.freeswitch.org/888">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:213-799-1400<br>