[Freeswitch-users] Problem with originate in javascript.

Anthony Minessale anthony.minessale at gmail.com
Thu Apr 9 06:09:27 PDT 2009


The 2nd 2 examples you provided are invalid, they depict the usage of the
originate api command in the context of the constructor
to a JS session.

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
session.execute("transfer", "GINO_ANS XML default");
at which time it would be wise if you deref the session object because its
thread will be running in the new extension.


A better way would be to do both in one with a single call to the originate
api command

apiExecute("originate",
"{id_name='${caller_id_name}',id_number=${caller_id_number}}sofia/gateway/spa3102PSTN/
14082031170 at 10.0.0.5:5061 GINO_ANS XML default");

This never gives you a session object it just creates a channel and
transfers it to the desired extension.


A Documentation Re-factorial Engineer may be able to add it to the relevant
page on the wiki if it is not already present.



On Wed, Apr 8, 2009 at 6:15 PM, <mszlazak at aol.com> wrote:

> I want to run a script with a scheduler but I'm having a problem with how
> to set up the originate in Javascript.
>
> The originate would go something like:
>
> originate
> {id_name='${caller_id_name}',id_number=${caller_id_number}}sofia/gateway/spa3102PSTN/
> 12223334444 at 10.0.0.5:5061 GINO_ANS
>
> I can get this to work:
>
> session = new
> Session("{id_name='${caller_id_name}',id_number=${caller_id_number}}sofia/gateway/spa3102PSTN/
> 14082031170 at 10.0.0.5:5061");
>
> But I want to "drop" that into an extension that runs another script and
> can't get either of these to work:
>
> session = new
> Session("{id_name='${caller_id_name}',id_number=${caller_id_number}}sofia/gateway/spa3102PSTN/
> 14082031170 at 10.0.0.5:5061 GINO_ANS");
>
> session = new
> Session("{id_name='${caller_id_name}',id_number=${caller_id_number}}sofia/gateway/spa3102PSTN/
> 14082031170 at 10.0.0.5:5061 GINO_ANS XML default");
>
> Also, will I have problems running the second script from the first script?
>
> Thanks.
>
>
>
> ------------------------------
> New Deals on Dell Netbooks - Now starting at $299<http://pr.atwola.com/promoclk/100126575x1219939010x1201342897/aol?redir=http:%2F%2Fad.doubleclick.net%2Fclk%3B213771626%3B35379597%3Bw>
>
> _______________________________________________
> Freeswitch-users mailing list
> Freeswitch-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>


-- 
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/

AIM: anthm
MSN:anthony_minessale at hotmail.com <MSN%3Aanthony_minessale at hotmail.com>
GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com<PAYPAL%3Aanthony.minessale at gmail.com>
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888 at conference.freeswitch.org <sip%3A888 at conference.freeswitch.org>
iax:guest at conference.freeswitch.org/888
googletalk:conf+888 at conference.freeswitch.org<googletalk%3Aconf%2B888 at conference.freeswitch.org>
pstn:213-799-1400
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20090409/d2ce6528/attachment-0002.html 


More information about the FreeSWITCH-users mailing list