Why are you using js to begin with? You don&#39;t really gain anything by performing the transfer from within a js script. In fact, when you do it this way the js instance stays active for the entire call. A happy medium might be to session.execute(&quot;transfer&quot;,&quot;2223334444 XML custom&quot;); and then have a custom dp context handle the bridge. That way you could do whatever it is you need to do inside of js and still let the dialplan do its thing.<div>
<br></div><div>-MC<br><br><div class="gmail_quote">On Wed, Jun 1, 2011 at 5:17 PM, Yungwei Chen <span dir="ltr">&lt;<a href="mailto:yungwei@resolvity.com">yungwei@resolvity.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Using bridge in the dialplan directly works.<br>
<br>
I tried putting only the following line in transfer.js, but it doesn&#39;t work.<br>
       session.execute(&quot;bridge&quot;, &quot;sofia/gateway/broadvoice/2223334444&quot;);<br>
<br>
Putting the following instead doesn&#39;t work either.<br>
       session.execute(&quot;bridge&quot;, &quot;{ignore_early_media=true}sofia/gateway/broadvoice/2223334444&quot;);<br>
<br>
Using the following instead doesn&#39;t work either.<br>
       session.answer();<br>
       session.execute(&quot;bridge&quot;, &quot;{ignore_early_media=true}sofia/gateway/broadvoice/2223334444&quot;);<br>
<br>
Still don&#39;t understand why.<br>
<br>
From: <a href="mailto:freeswitch-users-bounces@lists.freeswitch.org">freeswitch-users-bounces@lists.freeswitch.org</a> [<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org">freeswitch-users-bounces@lists.freeswitch.org</a>] On Behalf Of Michael Collins [<a href="mailto:msc@freeswitch.org">msc@freeswitch.org</a>]<br>

Sent: Wednesday, June 01, 2011 4:32 PM<br>
To: FreeSWITCH Users Help<br>
Subject: Re: [Freeswitch-users] Transferring to a cell phone<br>
<br>
<br>
I&#39;m not really sure what&#39;s happening here. The first BYE message that I see comes in at line #548 from the provider side of what I assume is the A leg.<br>
<br>
<br>
For now I would try using a very simple bridge app right in the public context and avoid all the javascript so that you can get the simplest scenario. SImply route the A leg to the bridge app and bridge it to the broadvoice gateway:<br>

&lt;extension name=&quot;route DID&quot;&gt;<br>
  &lt;condition field=&quot;destination_number&quot; expression=&quot;^(INCOMING_DID_NUMBER)$&quot;&gt;<br>
    &lt;action application=&quot;bridge&quot; data=&quot;sofia/gateway/broadvoice/2223334444&quot;/&gt;<br>
  &lt;/condition&gt;<br>
&lt;/extension&gt;<br>
<br>
<br>
<br>
A call coming in from one SIP endpoint and being bridged to another SIP endpoint is pretty much the core and fundamental functionality of FreeSWITCH, so I&#39;m thinking that the javascript is doing something unintended.<br>

<br>
<br>
-MC<br>
<br>
<br>
On Wed, Jun 1, 2011 at 9:52 AM, Yungwei Chen &lt;<a href="mailto:yungwei@resolvity.com">yungwei@resolvity.com</a>&gt; wrote:<br>
<br>
Here&#39;s the log with siptrace.<br>
<a href="http://pastebin.freeswitch.org/16424" target="_blank">http://pastebin.freeswitch.org/16424</a><br>
<br>
Here&#39;s the content of transfer.js:<br>
   session.answer();<br>
   if (session.ready())<br>
   {<br>
       session.execute(&quot;bridge&quot;, &quot;{ignore_early_media=true}sofia/gateway/broadvoice/2223334444&quot;);<br>
   }<br>
<br>
<br>
<br>
<br>
From: <a href="mailto:freeswitch-users-bounces@lists.freeswitch.org">freeswitch-users-bounces@lists.freeswitch.org</a> [<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org">freeswitch-users-bounces@lists.freeswitch.org</a>] On Behalf Of Michael Collins [<a href="mailto:msc@freeswitch.org">msc@freeswitch.org</a>]<br>

Sent: Friday, May 27, 2011 6:21 PM<br>
<br>
To: FreeSWITCH Users Help<br>
Subject: Re: [Freeswitch-users] Transferring to a cell phone<br>
<br>
<br>
<br>
Something is not right with the outbound leg of the call. It looks like there is an immediate hangup after the b leg answers. Get a siptrace of that traffic and look to see what is causing the hangup.<br>
<br>
<br>
-MC<br>
<br>
<br>
On Fri, May 27, 2011 at 2:27 PM, Yungwei Chen &lt;<a href="mailto:yungwei@resolvity.com">yungwei@resolvity.com</a>&gt; wrote:<br>
<br>
The whole picture looks like the following:<br>
A land-line&lt;--&gt;SIP provider A&lt;--&gt;FS&lt;--&gt;SIP provider A&lt;--&gt;a cell phone<br>
<br>
Is there any configuration setting that needs to be enabled or set differently so that those 2 endpoints can talk to each other?<br>
Btw, the same scenario works with Asterisk so my SIP provider shouldn&#39;t be the problem.<br>
<br>
From: <a href="mailto:freeswitch-users-bounces@lists.freeswitch.org">freeswitch-users-bounces@lists.freeswitch.org</a> [mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org">freeswitch-users-bounces@lists.freeswitch.org</a>] On Behalf Of Yungwei Chen<br>

Sent: Friday, May 27, 2011 11:34 AM<br>
To: FreeSWITCH Users Help<br>
Subject: Re: [Freeswitch-users] Transferring to a cell phone<br>
<br>
Here&#39;s the debug log, <a href="http://pastebin.freeswitch.org/16398" target="_blank">http://pastebin.freeswitch.org/16398</a><br>
<br>
From: <a href="mailto:freeswitch-users-bounces@lists.freeswitch.org">freeswitch-users-bounces@lists.freeswitch.org</a> [mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org">freeswitch-users-bounces@lists.freeswitch.org</a>] On Behalf Of Michael Collins<br>

Sent: Friday, May 27, 2011 10:08 AM<br>
To: FreeSWITCH Users Help<br>
Subject: Re: [Freeswitch-users] Transferring to a cell phone<br>
<br>
You need to put a debug log on <a href="http://pastebin.freeswitch.org" target="_blank">pastebin.freeswitch.org</a>. Be sure to use &quot;FreeSWITCH Log&quot; for the syntax highlighting.<br>
-MC<br>
On Fri, May 27, 2011 at 7:41 AM, Yungwei Chen &lt;<a href="mailto:yungwei@resolvity.com">yungwei@resolvity.com</a>&gt; wrote:<br>
No.<br>
<br>
I just verified that making an outbound call to my cell phone still works.<br>
I even recorded the session just to make sure, and in the recording I hear things both ways.<br>
I first dial 9911 from my SIP client (behind freeswitch), and this leads to the javascript program below.<br>
  session.answer();<br>
  var new_session = new Session(&quot;{ignore_early_media=true}sofia/gateway/sip_provider/1231231234&quot;);<br>
  session.hangup(16); // disconnects the session between the SIP client and freeswitch<br>
  new_session.execute(&quot;record_session&quot;, &quot;/tmp/call-from-js-to-cell.wav&quot;);<br>
  while (new_session.ready())<br>
  {<br>
      new_session.streamFile(&quot;/path/to/local/wav/file&quot;);<br>
  }<br>
<br>
Now back to the case I&#39;m having problem with.<br>
In this case, I first make a call from a landline to freeswitch through my sip provider, and then a javascript program takes over.<br>
I want to transfer the call to a cell phone so that the landline and the cell phone can communicate with each other.<br>
Here&#39;s the javascript program:<br>
  session.answer();<br>
<br>
  if (session.ready())<br>
  {<br>
      session.execute(&quot;bridge&quot;, &quot;{ignore_early_media=true}sofia/gateway/sip_provider/1231231234&quot;);<br>
  }<br>
<br>
So what am I missing here?<br>
<br>
-----Original Message-----<br>
From: <a href="mailto:freeswitch-users-bounces@lists.freeswitch.org">freeswitch-users-bounces@lists.freeswitch.org</a> [mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org">freeswitch-users-bounces@lists.freeswitch.org</a>] On Behalf Of mazilo<br>

Sent: Friday, May 27, 2011 7:28 AM<br>
To: <a href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a><br>
Subject: Re: [Freeswitch-users] Transferring to a cell phone<br>
<br>
<br>
Yungwei Chen wrote:<br>
&gt;<br>
&gt; Thanks for your reply. Using bridge fixed the problem. But I cannot hear<br>
&gt; anything both ways. Any idea?<br>
After switching to using bridge function, does this also happen when you<br>
make an outbound call to your cell phone using your javascript?<br>
<br>
-----<br>
FreeSWITCH hosted on a Seagate DockStar with OpenWRT and ONLY consumes 3 Watts of electricity.<br>
--<br>
View this message in context: <a href="http://freeswitch-users.2379917.n2.nabble.com/Transferring-to-a-cell-phone-tp6408246p6410887.html" target="_blank">http://freeswitch-users.2379917.n2.nabble.com/Transferring-to-a-cell-phone-tp6408246p6410887.html</a><br>

Sent from the freeswitch-users mailing list archive at Nabble.com.<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>
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>
<br>
<br>
<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>
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>
</blockquote></div><br></div>