try setting bypass_media_after_bridge=true on the session in your confirm script
On Thu, Jul 2, 2009 at 11:53 AM, Phillip Jones <[email protected]> wrote: > Thanks for responding and for your help. > > 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. > > To get round this I am trying to manually bypass_media in the confirm.js > script with apiExecute("uuid_media", "off " + session.uuid);. However only > the B leg is reinvited (and media is routed correctly). I don't see the A > leg reinvite, and then a BYE is issueed on both legs. > > <extension name="public_did"> > <condition field="destination_number" expression="^(12125553666)$"> > > <action application="set" data="domain_name=$${domain}"/> > <action application="set" data="call_timeout=60"/> > <action application="set" data="group_confirm_key=exec"/> > <action application="set" data="group_confirm_file=javascript > confirm.js"/>< > <action application="bridge" data="[leg_confirm=y] > sofia/gateway/broadvox/6095553828"/> > > </condition> > </extension> > </include> > > This is the confirm.js: > > // confirm.js - FreeSwitch call confirmation script > // (c) 2009 - St‚phane Alnet > // License: GPL2 or above > console_log("info", "Destination: "+ session.destination + "\n"); > if(!session.getVariable('leg_confirm')) > { > console_log("info", "No need to confirm, connect the call!\n"); > exit(); > } > var confirmed = false; > var confirmation_digit = "1"; > var try_count = 6; > var prompt_file = "prompts/ToAcceptThisCallPress1.wav"; > function onInput( session, type, data, arg ) { > if ( type == "dtmf" ) { > console_log( "info", "Got digit " + data.digit + "\n" ); > if ( data.digit == confirmation_digit ) { > confirmed = true; > console_log( "info", "Confirming session..\n" ); > return(false); > } > } > return(true); > } > if ( session.ready() ) > { > session.answer(); > session.flushDigits(); > console_log("info", "Starting confirmation\n"); > var count = try_count; > while( session.ready() && ! confirmed && count-- > 0 ) > { > session.execute("sleep","200"); > session.streamFile( prompt_file, onInput ); > } > > if( ! confirmed ) > { > console_log("info", "Not confirmed\n"); > session.hangup(); > } > else > { > *apiExecute("uuid_media", "off " + session.uuid);* > console_log("info", "Confirmed\n"); > } > } > else > { > console_log("info", "Session is not ready.\n"); > } > > > > > On Thu, Jul 2, 2009 at 12:19 PM, Anthony Minessale < > [email protected]> wrote: > >> I would need to know more details about what you are doing. >> >> 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 >> to press the key. >> >> >> >> On Thu, Jul 2, 2009 at 10:41 AM, Phillip Jones <[email protected]>wrote: >> >>> Thanks for that. >>> >>> 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 "bye" on both >>> legs. >>> >>> Do I have to do something to reinvite that A leg? >>> >>> On Wed, Jul 1, 2009 at 7:06 PM, Anthony Minessale < >>> [email protected]> wrote: >>> >>>> try >>>> apiExecute("uuid_media", "off " + session.uuid); >>>> >>>> >>>> >>>> On Wed, Jul 1, 2009 at 3:22 PM, Phillip Jones >>>> <[email protected]>wrote: >>>> >>>>> Hi there, >>>>> >>>>> I was wondering whether it is possible to have FreeSwitch go into >>>>> bypass_media mode on demand? >>>>> >>>>> 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. >>>>> >>>>> Currently I am issuing the following from my js script that prompts for >>>>> the 1: >>>>> >>>>> session.apiExecute("uuid_media",session.uuid); >>>>> >>>>> Not working however. >>>>> >>>>> Any help to get me going would be appreciated. >>>>> >>>>> Thanks >>>>> >>>>> Phillip Jones. >>>>> >>>>> _______________________________________________ >>>>> Freeswitch-users mailing list >>>>> [email protected] >>>>> 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:[email protected] <msn%[email protected]> >>>> GTALK/JABBER/PAYPAL:[email protected]<paypal%[email protected]> >>>> IRC: irc.freenode.net #freeswitch >>>> >>>> FreeSWITCH Developer Conference >>>> sip:[email protected] <sip%[email protected]> >>>> iax:[email protected]/888 >>>> googletalk:[email protected]<googletalk%3aconf%[email protected]> >>>> pstn:213-799-1400 >>>> >>>> _______________________________________________ >>>> Freeswitch-users mailing list >>>> [email protected] >>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users >>>> UNSUBSCRIBE: >>>> http://lists.freeswitch.org/mailman/options/freeswitch-users >>>> http://www.freeswitch.org >>>> >>>> >>> >>> _______________________________________________ >>> Freeswitch-users mailing list >>> [email protected] >>> 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:[email protected] <msn%[email protected]> >> GTALK/JABBER/PAYPAL:[email protected]<paypal%[email protected]> >> IRC: irc.freenode.net #freeswitch >> >> FreeSWITCH Developer Conference >> sip:[email protected] <sip%[email protected]> >> iax:[email protected]/888 >> googletalk:[email protected]<googletalk%3aconf%[email protected]> >> pstn:213-799-1400 >> >> _______________________________________________ >> Freeswitch-users mailing list >> [email protected] >> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users >> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users >> http://www.freeswitch.org >> >> > > _______________________________________________ > Freeswitch-users mailing list > [email protected] > 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:[email protected] <msn%[email protected]> GTALK/JABBER/PAYPAL:[email protected]<paypal%[email protected]> IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:[email protected] <sip%[email protected]> iax:[email protected]/888 googletalk:[email protected]<googletalk%3aconf%[email protected]> pstn:213-799-1400
_______________________________________________ Freeswitch-users mailing list [email protected] http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
