<span lang="EN">
<div>Thanks for responding and for your help.</div>
<div> </div>
<div>The xml and confirm.js are attached below. Basically trying to bypass_media after the leg B presses 1 to accept the call. I tried, using bypass_media_after_bridge=true, but the re-invite appears to be done before the confirm.js, So the media is successfully rerouted, but BEFORE the leg b never gets hear a prompt or gets the opportunity to press 1. </div>

<div> </div>
<div>To get round this I am trying to manually bypass_media in the confirm.js script with apiExecute(&quot;uuid_media&quot;, &quot;off &quot; + session.uuid);. However only the B leg is reinvited (and media is routed correctly). I don&#39;t see the A leg reinvite, and then a BYE is issueed on both legs.</div>

<div> </div>
<div>&lt;extension name=&quot;public_did&quot;&gt;</div>
<div>&lt;condition field=&quot;destination_number&quot; expression=&quot;^(12125553666)$&quot;&gt;</div>
<div> </div>
<div>&lt;action application=&quot;set&quot; data=&quot;domain_name=$${domain}&quot;/&gt;</div>
<div><font face="Times New Roman">&lt;action application=&quot;set&quot; data=&quot;call_timeout=60&quot;/&gt;</font></div>
<div><font face="Times New Roman">&lt;action application=&quot;set&quot; data=&quot;group_confirm_key=exec&quot;/&gt;</font></div>
<div><font face="Times New Roman">&lt;action application=&quot;set&quot; data=&quot;group_confirm_file=javascript confirm.js&quot;/&gt;&lt;</font></div>
<div><font face="Times New Roman">&lt;action application=&quot;bridge&quot; data=&quot;[leg_confirm=y]<font size="2">sofia/gateway/broadvox/6095553828</font>&quot;/&gt; </font></div><font size="2">
<div> </div>
<div>&lt;/condition&gt;</div>
<div>&lt;/extension&gt;</div>
<div>&lt;/include&gt;</div></font></span>
<div> </div>
<div>This is the confirm.js:</div>
<div> </div>
<div>// confirm.js - FreeSwitch call confirmation script<br>// (c) 2009 - St‚phane Alnet<br>// License: GPL2 or above</div>
<div>console_log(&quot;info&quot;, &quot;Destination: &quot;+ session.destination + &quot;\n&quot;);<br>if(!session.getVariable(&#39;leg_confirm&#39;))<br>{<br>console_log(&quot;info&quot;, &quot;No need to confirm, connect the call!\n&quot;);<br>
exit();<br>}</div>
<div>var confirmed = false;<br>var confirmation_digit = &quot;1&quot;;<br>var try_count = 6;<br>var prompt_file = &quot;prompts/ToAcceptThisCallPress1.wav&quot;;</div>
<div>function onInput( session, type, data, arg ) {<br>if ( type == &quot;dtmf&quot; ) {<br>console_log( &quot;info&quot;, &quot;Got digit &quot; + data.digit + &quot;\n&quot; );<br>if ( data.digit == confirmation_digit ) {<br>
confirmed = true;<br>console_log( &quot;info&quot;, &quot;Confirming session..\n&quot; );<br>return(false);<br>}<br>}<br>return(true);<br>}</div>
<div>if ( session.ready() ) <br>{<br>session.answer();<br>session.flushDigits();<br>console_log(&quot;info&quot;, &quot;Starting confirmation\n&quot;);<br>var count = try_count;<br>while( session.ready() &amp;&amp; ! confirmed &amp;&amp; count-- &gt; 0 )<br>
{<br>session.execute(&quot;sleep&quot;,&quot;200&quot;);<br>session.streamFile( prompt_file, onInput );<br>}</div>
<div><br>if( ! confirmed )<br>{</div>
<div>console_log(&quot;info&quot;, &quot;Not confirmed\n&quot;);<br>session.hangup();</div>
<div>}<br>else<br>{</div>
<div><strong>apiExecute(&quot;uuid_media&quot;, &quot;off &quot; + session.uuid);</strong><br>console_log(&quot;info&quot;, &quot;Confirmed\n&quot;);</div>
<div>}<br>}<br>else<br>{<br>console_log(&quot;info&quot;, &quot;Session is not ready.\n&quot;);<br>}</div>
<div> </div>
<div><br><br> </div>
<div class="gmail_quote">On Thu, Jul 2, 2009 at 12:19 PM, Anthony Minessale <span dir="ltr">&lt;<a href="mailto:anthony.minessale@gmail.com">anthony.minessale@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">I would need to know more details about what you are doing.<br><br>you could set the variable bypass_media_after_bridge=true on the a leg before you call the b leg and use the group_confirm feature to get the caller<br>
to press the key. 
<div>
<div></div>
<div class="h5"><br><br><br>
<div class="gmail_quote">On Thu, Jul 2, 2009 at 10:41 AM, Phillip Jones <span dir="ltr">&lt;<a href="mailto:pjintheusa@gmail.com" target="_blank">pjintheusa@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<div>Thanks for that.</div>
<div> </div>
<div>That seems to successfully re-invite and re-route the the B leg - but does not reinvite the A leg and then immediately issues a &quot;bye&quot; on both legs.</div>
<div> </div>
<div>Do I have to do something to reinvite that A leg?<br><br></div>
<div>
<div></div>
<div>
<div class="gmail_quote">On Wed, Jul 1, 2009 at 7:06 PM, Anthony Minessale <span dir="ltr">&lt;<a href="mailto:anthony.minessale@gmail.com" target="_blank">anthony.minessale@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<div>try<br>apiExecute(&quot;uuid_media&quot;, &quot;off &quot; + session.uuid);</div>
<div> </div><br><br>
<div class="gmail_quote">
<div>
<div></div>
<div>On Wed, Jul 1, 2009 at 3:22 PM, Phillip Jones <span dir="ltr">&lt;<a href="mailto:pjintheusa@gmail.com" target="_blank">pjintheusa@gmail.com</a>&gt;</span> wrote:<br></div></div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<div>
<div></div>
<div>
<div>Hi there,</div>
<div> </div>
<div>I was wondering whether it is possible to have FreeSwitch go into bypass_media mode on demand?</div>
<div> </div>
<div>For instance, leg a bridges to leg b - leg b is invited to accept the call by pressing 1. I want to go to bypass_media (do a SIP reinvite to reroute the media) after the one is pressed.</div>
<div> </div>
<div>Currently I am issuing the following from my js script that prompts for the 1:</div>
<div> </div>
<div>session.apiExecute(&quot;uuid_media&quot;,session.uuid);</div>
<div> </div>
<div>Not working however. </div>
<div> </div>
<div>Any help to get me going would be appreciated.</div>
<div> </div>
<div>Thanks</div>
<div> </div><font color="#888888">
<div>Phillip Jones.</div></font><br></div></div>_______________________________________________<br>Freeswitch-users mailing list<br><a href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">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></blockquote></div><br><br clear="all"><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" target="_blank">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com" target="_blank">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" target="_blank">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" target="_blank">googletalk:conf+888@conference.freeswitch.org</a><br>
pstn:213-799-1400<br><br>_______________________________________________<br>Freeswitch-users mailing list<br><a href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">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></blockquote></div><br></div></div><br>_______________________________________________<br>Freeswitch-users mailing list<br><a href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">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></blockquote></div><br><br clear="all"><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" target="_blank">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com" target="_blank">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" target="_blank">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" target="_blank">googletalk:conf+888@conference.freeswitch.org</a><br>
pstn:213-799-1400<br></div></div><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></blockquote></div><br>