I think I forgot to mention you need to session.setAutoHangup(false) to stop the channel from being auto-hungup<br>when it goes out of scope of the script.<br><br><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>&quot;);<br>
session.setAutoHangup(false);<br></font>session.execute(&quot;transfer&quot;, &quot;<font face="Arial, Helvetica, sans-serif">GINO_ANS XML default</font>&quot;);<br>session = undefined;<br><br><br><font face="Arial, Helvetica, sans-serif"><br>
</font><div class="gmail_quote">On Thu, Apr 9, 2009 at 11:22 AM,  <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;">

<div> <font face="Arial, Helvetica, sans-serif">Hi Tony,<br>
<br>
But I thought we settled on &quot;Janitor.&quot; ;-)<br>
BTW, it was the other point about keeping the FS founders involved or not in the documentation process that concerned much much more. That was the big issue that got me going on that thread.<br>
<br>
Anyway, I appreciate your help and will do some &quot;document engineering&quot; but need one further elaboration on de-referencing the original session object since I tried the execute(&quot;transfer&quot; ...) before and couldn&#39;t get that to work. Can you show me an example and I can then put up both approaches.<br>

<br>
Mark.<br>
</font></div><div><div></div><div class="h5">

<div> <br>
</div>

<div> <br>
</div>
-----Original Message-----<br>
From: Anthony Minessale &lt;<a href="mailto:anthony.minessale@gmail.com" target="_blank">anthony.minessale@gmail.com</a>&gt;<br>
To: <a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a><br>
Sent: Thu, 9 Apr 2009 6:09 am<br>
Subject: Re: [Freeswitch-users] Problem with originate in javascript.<br>
<br>






<div>

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" target="_blank">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" 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>

<br>
</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>
 


<div style="margin: 0px; font-family: Tahoma,Verdana,Arial,Sans-Serif; font-size: 12px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">

<pre style="font-size: 9pt;"><tt>_______________________________________________<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>
</tt></pre>
</div>
 

<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/100126575x1220635155x1201407495/aol?redir=http:%2F%2Fad.doubleclick.net%2Fclk%3B213771973%3B35379628%3Bw" target="_blank">New Deals on Dell Netbooks - Now starting at $299</a></font> </div>

</div></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>