can you press f8 for debug and try that apiExecute and post the results?<br><br><div class="gmail_quote">On Wed, Feb 4, 2009 at 8:46 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;">
Thanks Anthony,<br>
the js snippets are very instructive.<br>
A couple of points:<br>
1. The code with apiExecute does not work (local phone is connected, but<br>
after picking up it hungs up immediately), other examples are working<br>
fine.<br>
<br>
2. It does not show how initiate external call without existing session.<br>
<br>
3. How can one pass the call through dialplan?<br>
<br>
Jacek<br>
<br>
PS.<br>
we got the code probable from wiki or from this mialing list.<br>
<br>
Dnia 04-02-2009, śro o godzinie 08:09 -0600, Anthony Minessale pisze:<br>
<div><div></div><div class="Wj3C7c">> Where did you learn how to use js this way?<br>
> session.originate is being misused here and is depricated and may be<br>
> removed.<br>
><br>
> the first arg to session.originate is either undefined or a<br>
> *different* session (the a leg)<br>
><br>
> session1 = new Session();<br>
> session1.originate(undefined,<br>
> "{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<br>
> 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>
><br>
> Anyway this whole code is depricated in favor of this:<br>
><br>
> session1 = new<br>
> Session("{ignore_early_media=true}user/<a href="mailto:1008@192.168.1.122">1008@192.168.1.122</a>");<br>
><br>
> if (session1.ready()) {<br>
> session1.setVariable("effective_caller_id_number","fixed0248b");<br>
> session2 = new Session("sofia/gateway/halonet/0225490317",<br>
> session1);<br>
> }<br>
><br>
> and could be further refactored down to this:<br>
><br>
> session1 = new<br>
> 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<br>
> from the script and exit.<br>
><br>
> var result = apiExecute("originate",<br>
> "{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<br>
> call is completed.<br>
><br>
> var result = apiExecute("bgapi", "originate<br>
> {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>
> On Wed, Feb 4, 2009 at 2:51 AM, Jacek Sokulski<br>
> <jsokulski@dotsystems.pl> wrote:<br>
><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<br>
> 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<br>
> 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<br>
> solution could be<br>
> to pass the originating call through dialplan (loopback?) but<br>
> 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<br>
> pisze:<br>
><br>
> > Oops! Well, fortunately I don't use that voip provider<br>
> anymore (nor the script).<br>
> ><br>
> > Thanks Brian.<br>
> ><br>
> > Nicolas<br>
> ><br>
> > On Tue, Feb 3, 2009 at 2:25 PM, Brian West<br>
> <<a href="mailto:brian@freeswitch.org">brian@freeswitch.org</a>> wrote:<br>
> > > YOU should NEVER use this method or call setCallerData at<br>
> 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<br>
> the A-Leg:<br>
> > ><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>
> > ><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>
> > ><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>
> > ><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>
> ><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> ><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>
><br>
><br>
><br>
><br>
><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">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" target="_blank">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" target="_blank">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>
> _______________________________________________<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 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>