Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

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

[Freeswitch-users] Loopback and bypass_media

Goto page Previous  1, 2
 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
rupa at rupa.com
Guest





PostPosted: Wed Aug 12, 2009 11:32 am    Post subject: [Freeswitch-users] Loopback and bypass_media Reply with quote

On Wed, Aug 12, 2009 at 10:22 AM, Phillip Jones<pjintheusa@gmail.com> wrote:
Quote:
Hi there,

Quote:
Quote:
application="originate" data="(sofia/foo/bar|sofia/baz/bar),(sofia/foo/yum|sofia/baz/yum)"

I agree. However, perhaps the ideal is not to specify the carriers at
this level, as carriers are added and removed fairly often as costings
change. So it would be nice to have some sort of proxy that resolves
to a list of carriers:

application="originate" data="sofia/MyCarriers/bar,sofia/MyCarriers/yum"

Quote:
<MyCarriers>
<action application="carrier" data="sofia/foo"/>
<action application="carrier" data="sofia/baz"/>
<action application="carrier" data="sofia/etc"/>
</MyCarriers>


or something similar. This would achieve the same as loopback in this
use case but without dangers of looping? Complicated stuff though.

Well, that is all done by mod_lcr. I was simplifying to narrow down
to just originate.

First we need to see if this is worth pursuing over fixing (modifying,
whatever) loopback to handle bypass media. If it is, then I'll modify
mod_lcr to deal with the situation in question (comma or pipe sep list
of numbers to call. mod_lcr would then group as appropriate).

Right now, my bridge is setup in a small javascript script that builds
the appropriate dialstring (using loopback for external calls, user/
for internal calls) and then when doing the loopback call to mod_lcr
to get the dialstring with all providers in the right order.

Quote:
Quote:
Quote:
Perhaps have an on answer hook that tries to enable bypass media (re-invite) after the call is setup?

That's a good idea - I will look into that.


Thanks again.


Phillip

Let us know how it works for you...

--
-Rupa

_______________________________________________
FreeSWITCH-users mailing list
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
pjintheusa at gmail.com
Guest





PostPosted: Thu Aug 13, 2009 6:05 pm    Post subject: [Freeswitch-users] Loopback and bypass_media Reply with quote

Rupa / all,

Just a quick follow up to this.

This is appears to a timing issue. If I try and do a "uuid_media off +
uuid" in "api_after_bridge" it fails with "CHAN_NOT_IMPLEMENTED"
and the call is dropped.

If appears to be trying to do a SIP reinvite on the loopback channel
which is of course just about to / has disappear/ed.

So I tried this, after the call is established, at the commend line, I
do "show calls" and using the uuid shown, type "uuid_media off uuid".
The SIP REINVITE is issued and works.

I think the switch_ivr_nomedia function in switch_ivr_c is getting the
loopback uuid when it calls "other_uuid =
switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE)"

That's why the SIP REINVITE fails.

So... in api_after_bridge I issue:

"sched_api", "+3 none uuid_media off " + uuid. This calls the
switch_ivr_nomedia function 3 seconds after the calls bridge is
established.


And it works, Not nice - not scalable or production ready - but the
SIP-REINVITE is successful and at least now I understand what is going
on.

Make sense?

Thanks


Phil


On Wed, Aug 12, 2009 at 12:21 PM, Rupa Schomaker<rupa@rupa.com> wrote:
Quote:
On Wed, Aug 12, 2009 at 10:22 AM, Phillip Jones<pjintheusa@gmail.com> wrote:
Quote:
Hi there,

Quote:
Quote:
application="originate" data="(sofia/foo/bar|sofia/baz/bar),(sofia/foo/yum|sofia/baz/yum)"

I agree. However, perhaps the ideal is not to specify the carriers at
this level, as carriers are added and removed fairly often as costings
change. So it would be nice to have some sort of proxy that resolves
to a list of carriers:

application="originate" data="sofia/MyCarriers/bar,sofia/MyCarriers/yum"

Quote:
<MyCarriers>
<action application="carrier" data="sofia/foo"/>
<action application="carrier" data="sofia/baz"/>
<action application="carrier" data="sofia/etc"/>
</MyCarriers>


or something similar. This would achieve the same as loopback in this
use case but without dangers of looping? Complicated stuff though.

Well, that is all done by mod_lcr.  I was simplifying to narrow down
to just originate.

First we need to see if this is worth pursuing over fixing (modifying,
whatever) loopback to handle bypass media.  If it is, then I'll modify
mod_lcr to deal with the situation in question (comma or pipe sep list
of numbers to call.  mod_lcr would then group as appropriate).

Right now, my bridge is setup in a small javascript script that builds
the appropriate dialstring (using loopback for external calls, user/
for internal calls) and then when doing the loopback call to mod_lcr
to get the dialstring with all providers in the right order.

Quote:
Quote:
Quote:
Perhaps have an on answer hook that tries to enable bypass media (re-invite) after the call is setup?

That's a good idea - I will look into that.


Thanks again.


Phillip

Let us know how it works for you...

--
-Rupa

_______________________________________________
FreeSWITCH-users mailing list
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
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
mrene_lists at avgs.ca
Guest





PostPosted: Thu Aug 13, 2009 6:59 pm    Post subject: [Freeswitch-users] Loopback and bypass_media Reply with quote

Hi All,

The reason it works when you wait 3 seconds is that mod_loopback bails
out of the equation as soon as it detects a bridge.
It'll call switch_ivr_uuid_bridge() and you'll end up with 2 sofia
channels.

Now the reason why you can't do uuid_media over a loopback channel is
because it doesn't pass on SWITCH_MESSAGE_INDICATE_MEDIA and
SWITCH_MESSAGE_INDICATE_NOMEDIA onto the underlying channel.
The handler for those two events require accessing channel variables
on the both channels to get the ip+port of where the audio should go
through, so that mod_sofia can send a re-invite.
Since mod_loopback is a completely different channel, it has its own
channel variables, independent from mod_sofia (provided you have sofia
channels on both side). That's why even sofia<>loopback won't do
bypass media.

On another note, mod_sofia will behave differently when it detects its
being bridge with another sofia channel, providing optimizations when
both call legs are SIP.

My personal opinion is not to use mod_loopback unless absolutely
necessary, FreeSWITCH's core is very flexible and there's often a
(better) way than using mod_loopback.

Mathieu Rene
Avant-Garde Solutions Inc
Office: + 1 (514) 664-1044 x100
Cell: +1 (514) 664-1044 x200
mrene@avgs.ca




On 13-Aug-09, at 6:59 PM, Phillip Jones wrote:

Quote:
Rupa / all,

Just a quick follow up to this.

This is appears to a timing issue. If I try and do a "uuid_media off +
uuid" in "api_after_bridge" it fails with "CHAN_NOT_IMPLEMENTED"
and the call is dropped.

If appears to be trying to do a SIP reinvite on the loopback channel
which is of course just about to / has disappear/ed.

So I tried this, after the call is established, at the commend line, I
do "show calls" and using the uuid shown, type "uuid_media off uuid".
The SIP REINVITE is issued and works.

I think the switch_ivr_nomedia function in switch_ivr_c is getting the
loopback uuid when it calls "other_uuid =
switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE)"

That's why the SIP REINVITE fails.

So... in api_after_bridge I issue:

"sched_api", "+3 none uuid_media off " + uuid. This calls the
switch_ivr_nomedia function 3 seconds after the calls bridge is
established.


And it works, Not nice - not scalable or production ready - but the
SIP-REINVITE is successful and at least now I understand what is going
on.

Make sense?

Thanks


Phil


On Wed, Aug 12, 2009 at 12:21 PM, Rupa Schomaker<rupa@rupa.com> wrote:
Quote:
On Wed, Aug 12, 2009 at 10:22 AM, Phillip
Jones<pjintheusa@gmail.com> wrote:
Quote:
Hi there,

Quote:
Quote:
application="originate" data="(sofia/foo/bar|sofia/baz/bar),
(sofia/foo/yum|sofia/baz/yum)"

I agree. However, perhaps the ideal is not to specify the carriers
at
this level, as carriers are added and removed fairly often as
costings
change. So it would be nice to have some sort of proxy that resolves
to a list of carriers:

application="originate" data="sofia/MyCarriers/bar,sofia/
MyCarriers/yum"

Quote:
<MyCarriers>
<action application="carrier" data="sofia/foo"/>
<action application="carrier" data="sofia/baz"/>
<action application="carrier" data="sofia/etc"/>
</MyCarriers>


or something similar. This would achieve the same as loopback in
this
use case but without dangers of looping? Complicated stuff though.

Well, that is all done by mod_lcr. I was simplifying to narrow down
to just originate.

First we need to see if this is worth pursuing over fixing
(modifying,
whatever) loopback to handle bypass media. If it is, then I'll
modify
mod_lcr to deal with the situation in question (comma or pipe sep
list
of numbers to call. mod_lcr would then group as appropriate).

Right now, my bridge is setup in a small javascript script that
builds
the appropriate dialstring (using loopback for external calls, user/
for internal calls) and then when doing the loopback call to mod_lcr
to get the dialstring with all providers in the right order.

Quote:
Quote:
Quote:
Perhaps have an on answer hook that tries to enable bypass media
(re-invite) after the call is setup?

That's a good idea - I will look into that.


Thanks again.


Phillip

Let us know how it works for you...

--
-Rupa

_______________________________________________
FreeSWITCH-users mailing list
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
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
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
pjintheusa at gmail.com
Guest





PostPosted: Thu Aug 13, 2009 10:56 pm    Post subject: [Freeswitch-users] Loopback and bypass_media Reply with quote

Quote:
The reason it works when you wait 3 seconds is that mod_loopback bails
out of the equation as soon as it detects a bridge.
It'll call switch_ivr_uuid_bridge() and you'll end up with 2 sofia
channels.

Is there a hook that is fired when when that switch_ivr_uuid_bridge()
successfully executes? So the uuid_media off is called on the
appropriate sofia channels? Is "api_after_bridge" behaving correctly -
should that only be called on the sofia channels and not the loopback?
Is it being fired to early?



On Thu, Aug 13, 2009 at 4:54 PM, Mathieu Rene<mrene_lists@avgs.ca> wrote:
Quote:
Hi All,

The reason it works when you wait 3 seconds is that mod_loopback bails
out of the equation as soon as it detects a bridge.
It'll call switch_ivr_uuid_bridge() and you'll end up with 2 sofia
channels.

Now the reason why you can't do uuid_media over a loopback channel is
because it doesn't pass on SWITCH_MESSAGE_INDICATE_MEDIA and
SWITCH_MESSAGE_INDICATE_NOMEDIA onto the underlying channel.
The handler for those two events require accessing channel variables
on the both channels to get the ip+port of where the audio should go
through, so that mod_sofia can send a re-invite.
Since mod_loopback is a completely different channel, it has its own
channel variables, independent from mod_sofia (provided you have sofia
channels on both side).  That's why even sofia<>loopback won't do
bypass media.

On another note, mod_sofia will behave differently when it detects its
being bridge with another sofia channel, providing optimizations when
both call legs are SIP.

My personal opinion is not to use mod_loopback unless absolutely
necessary, FreeSWITCH's core is very flexible and there's often a
(better) way than using mod_loopback.

Mathieu Rene
Avant-Garde Solutions Inc
Office: + 1 (514) 664-1044 x100
Cell: +1 (514) 664-1044 x200
mrene@avgs.ca




On 13-Aug-09, at 6:59 PM, Phillip Jones wrote:

Quote:
Rupa / all,

Just a quick follow up to this.

This is appears to a timing issue. If I try and do a "uuid_media off +
uuid"  in  "api_after_bridge"  it fails with "CHAN_NOT_IMPLEMENTED"
and  the call is dropped.

If appears to be trying to do a SIP reinvite on the loopback channel
which is of course just about to / has disappear/ed.

So I tried this, after the call is established, at the commend line, I
do "show calls" and using the uuid shown, type "uuid_media off  uuid".
The SIP REINVITE is issued and works.

I think the switch_ivr_nomedia function in switch_ivr_c is getting the
loopback uuid when it calls "other_uuid =
switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE)"

That's why the SIP REINVITE fails.

So... in api_after_bridge I issue:

"sched_api", "+3 none uuid_media off " + uuid. This calls the
switch_ivr_nomedia function 3 seconds after the calls bridge is
established.


And it works, Not nice - not scalable or production ready - but the
SIP-REINVITE is successful and at least now I understand what is going
on.

Make sense?

Thanks


Phil


On Wed, Aug 12, 2009 at 12:21 PM, Rupa Schomaker<rupa@rupa.com> wrote:
Quote:
On Wed, Aug 12, 2009 at 10:22 AM, Phillip
Jones<pjintheusa@gmail.com> wrote:
Quote:
Hi there,

Quote:
Quote:
application="originate" data="(sofia/foo/bar|sofia/baz/bar),
(sofia/foo/yum|sofia/baz/yum)"

I agree. However, perhaps the ideal is not to specify the carriers
at
this level, as carriers are added and removed fairly often as
costings
change. So it would be nice to have some sort of proxy that resolves
to a list of carriers:

application="originate" data="sofia/MyCarriers/bar,sofia/
MyCarriers/yum"

Quote:
<MyCarriers>
<action application="carrier" data="sofia/foo"/>
<action application="carrier" data="sofia/baz"/>
<action application="carrier" data="sofia/etc"/>
</MyCarriers>


or something similar. This would achieve the same as loopback in
this
use case but without dangers of looping? Complicated stuff though.

Well, that is all done by mod_lcr.  I was simplifying to narrow down
to just originate.

First we need to see if this is worth pursuing over fixing
(modifying,
whatever) loopback to handle bypass media.  If it is, then I'll
modify
mod_lcr to deal with the situation in question (comma or pipe sep
list
of numbers to call.  mod_lcr would then group as appropriate).

Right now, my bridge is setup in a small javascript script that
builds
the appropriate dialstring (using loopback for external calls, user/
for internal calls) and then when doing the loopback call to mod_lcr
to get the dialstring with all providers in the right order.

Quote:
Quote:
Quote:
Perhaps have an on answer hook that tries to enable bypass media
(re-invite) after the call is setup?

That's a good idea - I will look into that.


Thanks again.


Phillip

Let us know how it works for you...

--
-Rupa

_______________________________________________
FreeSWITCH-users mailing list
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
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
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
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
rupa at rupa.com
Guest





PostPosted: Fri Aug 14, 2009 1:42 am    Post subject: [Freeswitch-users] Loopback and bypass_media Reply with quote

On Thu, Aug 13, 2009 at 6:54 PM, Mathieu Rene<mrene_lists@avgs.ca> wrote:
Quote:
Hi All,

The reason it works when you wait 3 seconds is that mod_loopback bails

[snip]

Thanks for that explanation. It umm.. explains a lot. Smile

Quote:
On another note, mod_sofia will behave differently when it detects its
being bridge with another sofia channel, providing optimizations when
both call legs are SIP.

My personal opinion is not to use mod_loopback unless absolutely
necessary, FreeSWITCH's core is very flexible and there's often a
(better) way than using mod_loopback.

So, I think the temp solution is to use loopback+delayed no media.

but the real "solution" is to either drive the forked dialing logic
externally (event socket) or consider supporting groupings in the
bridge which.. umm... is gonna be a pain and will need buy in from
from Tony and other core devs since that is a core (no pun intended)
piece of code that nearly everything uses.

I'm not sure I want to take a wack at it.

--
-Rupa

_______________________________________________
FreeSWITCH-users mailing list
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
pjintheusa at gmail.com
Guest





PostPosted: Fri Aug 14, 2009 2:24 pm    Post subject: [Freeswitch-users] Loopback and bypass_media Reply with quote

Hi Rupa,

What about my suggestion above introduce a "api_after_bridge" event
that fires when the switch_ivr_uuid_bridge() bridges to the two sofia
channels that Mathieu mentioned?

Is that suggestion just way off the mark? If possible that would allow
me to move forward - although I agree that supporting groupings of
carriers is would be the most elegant solution.

Let me know if I am just talking rubbish re the api_after_bridge" event.

Thanks!


Phillip Jones


On Fri, Aug 14, 2009 at 2:33 AM, Rupa Schomaker<rupa@rupa.com> wrote:
Quote:
On Thu, Aug 13, 2009 at 6:54 PM, Mathieu Rene<mrene_lists@avgs.ca> wrote:
Quote:
Hi All,

The reason it works when you wait 3 seconds is that mod_loopback bails

[snip]

Thanks for that explanation.  It umm.. explains a lot. Smile

Quote:
On another note, mod_sofia will behave differently when it detects its
being bridge with another sofia channel, providing optimizations when
both call legs are SIP.

My personal opinion is not to use mod_loopback unless absolutely
necessary, FreeSWITCH's core is very flexible and there's often a
(better) way than using mod_loopback.

So, I think the temp solution is to use loopback+delayed no media.

but the real "solution" is to either drive the forked dialing logic
externally (event socket) or consider supporting groupings in the
bridge which.. umm...  is gonna be a pain and will need buy in from
from Tony and other core devs since that is a core (no pun intended)
piece of code that nearly everything uses.

I'm not sure I want to take a wack at it.

--
-Rupa

_______________________________________________
FreeSWITCH-users mailing list
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
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
pjintheusa at gmail.com
Guest





PostPosted: Fri Aug 21, 2009 3:02 pm    Post subject: [Freeswitch-users] Loopback and bypass_media Reply with quote

Hi there,

I created a feature request to cover this issue:

http://jira.freeswitch.org/browse/FSCORE-422 - The ability to support
Call FollowMe (or Call Blast) and multiple termination carriers -
without Loopback

If anybody wants comment on its merits and/or make the request clearer
- that would be great.

Thanks for every bodies help on this.

Phillip Jones

On Fri, Aug 14, 2009 at 3:17 PM, Phillip Jones<pjintheusa@gmail.com> wrote:
Quote:
Hi Rupa,

What about my suggestion above introduce a "api_after_bridge" event
that fires when the switch_ivr_uuid_bridge() bridges to the two sofia
channels that Mathieu mentioned?

Is that suggestion just way off the mark? If possible that would allow
me to move forward - although I agree that supporting groupings of
carriers is would be the most elegant solution.

Let me know if I am just talking rubbish re the api_after_bridge" event.

Thanks!


Phillip Jones


On Fri, Aug 14, 2009 at 2:33 AM, Rupa Schomaker<rupa@rupa.com> wrote:
Quote:
On Thu, Aug 13, 2009 at 6:54 PM, Mathieu Rene<mrene_lists@avgs.ca> wrote:
Quote:
Hi All,

The reason it works when you wait 3 seconds is that mod_loopback bails

[snip]

Thanks for that explanation.  It umm.. explains a lot. Smile

Quote:
On another note, mod_sofia will behave differently when it detects its
being bridge with another sofia channel, providing optimizations when
both call legs are SIP.

My personal opinion is not to use mod_loopback unless absolutely
necessary, FreeSWITCH's core is very flexible and there's often a
(better) way than using mod_loopback.

So, I think the temp solution is to use loopback+delayed no media.

but the real "solution" is to either drive the forked dialing logic
externally (event socket) or consider supporting groupings in the
bridge which.. umm...  is gonna be a pain and will need buy in from
from Tony and other core devs since that is a core (no pun intended)
piece of code that nearly everything uses.

I'm not sure I want to take a wack at it.

--
-Rupa

_______________________________________________
FreeSWITCH-users mailing list
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
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
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
Goto page Previous  1, 2
Page 2 of 2

 
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