Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] SIP re-invite / bypass_media


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
pjintheusa at gmail.com
Guest





PostPosted: Wed Jul 01, 2009 3:28 pm    Post subject: [Freeswitch-users] SIP re-invite / bypass_media Reply with quote

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.
Back to top
anthony.minessale at g...
Guest





PostPosted: Wed Jul 01, 2009 6:08 pm    Post subject: [Freeswitch-users] SIP re-invite / bypass_media Reply with quote

try
apiExecute("uuid_media", "off " + session.uuid);
 


On Wed, Jul 1, 2009 at 3:22 PM, Phillip Jones <pjintheusa@gmail.com (pjintheusa@gmail.com)> wrote:
Quote:
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
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
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:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400
Back to top
pjintheusa at gmail.com
Guest





PostPosted: Thu Jul 02, 2009 10:42 am    Post subject: [Freeswitch-users] SIP re-invite / bypass_media Reply with quote

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 <anthony.minessale@gmail.com (anthony.minessale@gmail.com)> wrote:
Quote:
try
apiExecute("uuid_media", "off " + session.uuid);
 



On Wed, Jul 1, 2009 at 3:22 PM, Phillip Jones <pjintheusa@gmail.com (pjintheusa@gmail.com)> wrote:


Quote:

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
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
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:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400

_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

Back to top
anthony.minessale at g...
Guest





PostPosted: Thu Jul 02, 2009 11:21 am    Post subject: [Freeswitch-users] SIP re-invite / bypass_media Reply with quote

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 <pjintheusa@gmail.com (pjintheusa@gmail.com)> wrote:
Quote:
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 <anthony.minessale@gmail.com (anthony.minessale@gmail.com)> wrote:
Quote:
try
apiExecute("uuid_media", "off " + session.uuid);
 



On Wed, Jul 1, 2009 at 3:22 PM, Phillip Jones <pjintheusa@gmail.com (pjintheusa@gmail.com)> wrote:


Quote:

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
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
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:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400

_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
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
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
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:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400
Back to top
pjintheusa at gmail.com
Guest





PostPosted: Thu Jul 02, 2009 11:57 am    Post subject: [Freeswitch-users] SIP re-invite / bypass_media Reply with quote

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 <anthony.minessale@gmail.com (anthony.minessale@gmail.com)> wrote:
Quote:
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 <pjintheusa@gmail.com (pjintheusa@gmail.com)> wrote:
Quote:
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 <anthony.minessale@gmail.com (anthony.minessale@gmail.com)> wrote:
Quote:
try
apiExecute("uuid_media", "off " + session.uuid);
 



On Wed, Jul 1, 2009 at 3:22 PM, Phillip Jones <pjintheusa@gmail.com (pjintheusa@gmail.com)> wrote:


Quote:

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
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
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:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400

_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
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
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
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:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400



_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

Back to top
anthony.minessale at g...
Guest





PostPosted: Thu Jul 02, 2009 12:06 pm    Post subject: [Freeswitch-users] SIP re-invite / bypass_media Reply with quote

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 <pjintheusa@gmail.com (pjintheusa@gmail.com)> wrote:
Quote:
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 <anthony.minessale@gmail.com (anthony.minessale@gmail.com)> wrote:
Quote:
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 <pjintheusa@gmail.com (pjintheusa@gmail.com)> wrote:
Quote:
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 <anthony.minessale@gmail.com (anthony.minessale@gmail.com)> wrote:
Quote:
try
apiExecute("uuid_media", "off " + session.uuid);
 



On Wed, Jul 1, 2009 at 3:22 PM, Phillip Jones <pjintheusa@gmail.com (pjintheusa@gmail.com)> wrote:


Quote:

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
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
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:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400

_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
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
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
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:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400



_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
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
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
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:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400
Back to top
pjintheusa at gmail.com
Guest





PostPosted: Thu Jul 02, 2009 12:30 pm    Post subject: [Freeswitch-users] SIP re-invite / bypass_media Reply with quote

Used:
 
session.execute("set","bypass_media_after_bridge=true");

in the confirm.js script and that works perfectly!
 
Thank you for you help!

On Thu, Jul 2, 2009 at 1:05 PM, Anthony Minessale <anthony.minessale@gmail.com (anthony.minessale@gmail.com)> wrote:
Quote:
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 <pjintheusa@gmail.com (pjintheusa@gmail.com)> wrote:
Quote:
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 <anthony.minessale@gmail.com (anthony.minessale@gmail.com)> wrote:
Quote:
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 <pjintheusa@gmail.com (pjintheusa@gmail.com)> wrote:
Quote:
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 <anthony.minessale@gmail.com (anthony.minessale@gmail.com)> wrote:
Quote:
try
apiExecute("uuid_media", "off " + session.uuid);
 



On Wed, Jul 1, 2009 at 3:22 PM, Phillip Jones <pjintheusa@gmail.com (pjintheusa@gmail.com)> wrote:


Quote:

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
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
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:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400

_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
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
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
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:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400



_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
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
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
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:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400



_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

Back to top
anthony.minessale at g...
Guest





PostPosted: Thu Jul 02, 2009 12:41 pm    Post subject: [Freeswitch-users] SIP re-invite / bypass_media Reply with quote

no problem


On Thu, Jul 2, 2009 at 12:27 PM, Phillip Jones <pjintheusa@gmail.com (pjintheusa@gmail.com)> wrote:
Quote:
Used:
 
session.execute("set","bypass_media_after_bridge=true");

in the confirm.js script and that works perfectly!
 
Thank you for you help!


On Thu, Jul 2, 2009 at 1:05 PM, Anthony Minessale <anthony.minessale@gmail.com (anthony.minessale@gmail.com)> wrote:
Quote:
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 <pjintheusa@gmail.com (pjintheusa@gmail.com)> wrote:
Quote:
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 <anthony.minessale@gmail.com (anthony.minessale@gmail.com)> wrote:
Quote:
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 <pjintheusa@gmail.com (pjintheusa@gmail.com)> wrote:
Quote:
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 <anthony.minessale@gmail.com (anthony.minessale@gmail.com)> wrote:
Quote:
try
apiExecute("uuid_media", "off " + session.uuid);
 



On Wed, Jul 1, 2009 at 3:22 PM, Phillip Jones <pjintheusa@gmail.com (pjintheusa@gmail.com)> wrote:


Quote:

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
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
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:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400

_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
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
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
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:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400



_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
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
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
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:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400



_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
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
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
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:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services