[Freeswitch-users] Setting outbound callerid using js

Anthony Minessale anthony.minessale at gmail.com
Fri Feb 13 06:05:47 PST 2009


1) session.originate is depricated.
2) the first arg to session.originate is *another* session (not the same
one) *or* undefined.....
    session.originate(undefined, "<dial string>");
    session.originate(a_leg_session, "<dial string>");

session.originate(session, "<dial string>") is asking the session to use
itself as it's own a leg which makes no sense.

This is perhaps the 4th time i have seen someone do this, can you point out
where this is incorrectly documented?

BTW

effective_caller_id_name/number are variables you set on the A leg so when
it's used to generate b legs that var is copied instead.

a_leg_session.setVariable("effective_caller_id_number=1234");
b_leg_session = new Session(a_leg_session, "<dial string>");

which is of course pointless because you never need to create the session if
you just use the bridge application.


session.execute("bridge", "<dial string>");

even better just set the dest to a var and exit the script and use that var
in your dialplan.


--- contents of get_dest.js ---
session.setVariable("dial_string", "<dial string>");

-- dialplan --
<action application="javascript" data="get_dest.js"/>
<action application="bridge" data="${dial_string}/>




On Wed, Feb 11, 2009 at 6:26 PM, Michael Collins <msc at freeswitch.org> wrote:

>
> session.originate(session,'{accountcode=54321,ignore_early_media=true,origination_caller_id_number=07630600000,originate_timeout=25}sofia/gateway/mygw/01XXXXXXXXXXX');
> >
> >
> >
> > (this works using lua BTW)
> >
> hmmmm... how about using "effective_caller_id_number" instead? I think
> the JavaScript paradigm is a bit different than the Lua/Perl one. Let
> us know if that works or not.
> -MC
>
> _______________________________________________
> 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/20090213/d378128c/attachment-0002.html 


More information about the FreeSWITCH-users mailing list