Where did you learn how to use js this way?<br>session.originate is being misused here and is depricated and may be removed.<br><br>the first arg to session.originate is either undefined or a *different* session (the a leg)<br>
<br>session1 = new Session();<br>session1.originate(undefined, "{ignore_early_media=true}user/<a href="mailto:1008@192.168.1.122">1008@192.168.1.122</a>");<br><br>session1.setVariable("effective_caller_id_number","fixed0248b");<br>
<br>//once you have session1 when you originate session2 you pass session1 as the arg <br>// the effective_caller_id is taken from session1<br><br>session2 = new Session();<br>session2.originate(session1, "sofia/gateway/halonet/0225490317");<br>
<div id=":1ty" class="ArwC7c ckChnd"><br>Anyway this whole code is depricated in favor of this:<br><br>session1 = new Session("{ignore_early_media=true}user/<a href="mailto:1008@192.168.1.122">1008@192.168.1.122</a>");<br>
</div>if (session1.ready()) {<br> session1.setVariable("effective_caller_id_number","fixed0248b");<br>
session2 = new Session("sofia/gateway/halonet/0225490317", session1);<br>}<br><br>and could be further refactored down to this:<br><br>session1 = new Session("{ignore_early_media=true}user/<a href="mailto:1008@192.168.1.122">1008@192.168.1.122</a>");<br>
if (session1.ready()) {<br>
session1.setVariable("effective_caller_id_number","fixed0248b");<br> session1.execute("bridge", "sofia/gateway/halonet/0225490317");<br>
}<br>
<br>or down to this one line of code that will setup the call detached from the script and exit.<br><br>var result = apiExecute("originate", "{effective_caller_id_number=fixed0248b,origination_caller_id_number=1000,ignore_early_media=true}user/<a href="mailto:1008@192.168.1.122">1008@192.168.1.122</a> bridge:sofia/gateway/halonet/0225490317 inline");<br>
<br>if you dont care about the result and want to exit even before the call is completed.<br><br>var result = apiExecute("bgapi",
"originate {effective_caller_id_number=fixed0248b,origination_caller_id_number=1000,ignore_early_media=true}user/<a href="mailto:1008@192.168.1.122">1008@192.168.1.122</a> bridge:sofia/gateway/halonet/0225490317 inline");<br>
<br><br><br><div class="gmail_quote">On Wed, Feb 4, 2009 at 2:51 AM, Jacek Sokulski <span dir="ltr"><jsokulski@dotsystems.pl></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;">
<br>
We have tried setting both effective_caller_id_number and<br>
origination_caller_id_number:<br>
<br>
session1.originate(session1,"{origination_caller_id_number=fixed0248b}sofia/gateway/halonet/0225490317",15);<br>
but the problem still exists. The solution we have found for the case<br>
when we originate two calls, local and external, is as follow:<br>
<br>
session1 = new Session();<br>
session1.originate(session1,"user/<a href="mailto:1003@192.168.1.122">1003@192.168.1.122</a>",15);//local<br>
if(session1.ready()) {<br>
session1.execute("execute_extension","00930691688627 XML default");//external<br>
}<br>
<br>
so the external call goes through the dialplan.<br>
It does not work if both calls are external. One possible solution could be<br>
to pass the originating call through dialplan (loopback?) but we have not managed<br>
to figure out how to do it.<br>
<br>
Thanks<br>
Jacek<br>
<br>
Dnia 03-02-2009, wto o godzinie 14:31 -0300, Nicolas Brenner pisze:<br>
<div><div></div><div class="Wj3C7c">> Oops! Well, fortunately I don't use that voip provider anymore (nor the script).<br>
><br>
> Thanks Brian.<br>
><br>
> Nicolas<br>
><br>
> On Tue, Feb 3, 2009 at 2:25 PM, Brian West <<a href="mailto:brian@freeswitch.org">brian@freeswitch.org</a>> wrote:<br>
> > YOU should NEVER use this method or call setCallerData at all you<br>
> > should use the correct methods to override the callerid.<br>
> ><br>
> > If its a B-Leg born from an A-Leg you use these on the on the A-Leg:<br>
> ><br>
> > <a href="http://wiki.freeswitch.org/wiki/Channel_Variables#effective_caller_id_name" target="_blank">http://wiki.freeswitch.org/wiki/Channel_Variables#effective_caller_id_name</a><br>
> > <a href="http://wiki.freeswitch.org/wiki/Channel_Variables#effective_caller_id_number" target="_blank">http://wiki.freeswitch.org/wiki/Channel_Variables#effective_caller_id_number</a><br>
> ><br>
> > If you're originating you use this:<br>
> ><br>
> > <a href="http://wiki.freeswitch.org/wiki/Channel_Variables#origination_caller_id_name" target="_blank">http://wiki.freeswitch.org/wiki/Channel_Variables#origination_caller_id_name</a><br>
> > <a href="http://wiki.freeswitch.org/wiki/Channel_Variables#origination_caller_id_number" target="_blank">http://wiki.freeswitch.org/wiki/Channel_Variables#origination_caller_id_number</a><br>
> ><br>
> > /b<br>
><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>
<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>
</div></div></blockquote></div><br><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>