Bypass media

Status
Not open for further replies.

Incubugs

Member
Apr 7, 2018
175
10
18
49
Hi guys, so we are close now to releasing our hosted fusion setup, idea is this we have a few cloud servers running multi tenant fusionpbx systems, all ok so far we estimate to put about 20 - 30 customers per pbx with apporx 10 - 20 handsets per customer, however i would like to keep the rtp streams on the customers own lans and only use fusion for signalling, i presume most functions will work ok, ie transfer, voicemail access and call forwards and groups etc, i understand things like call recording wont work which is fine as if they require call recording we will offer an on site setup to capture the rtp. Now the question is how do i get fusionpbx to bypass the rtp when it can ? is it the inbound-bypass-media in sip profile i need to set ? also what other consequences could this have for the users as things like blf should be fine etc etc.. PS we will be using ASTPP as the gateways for billing etc... proxy works fine on astpp so far..
thanks in advance
K
 

smn

Member
Jul 18, 2017
201
20
18
Not sure but I don't think any media services will work if you use inbound-bypass-media. So voicemail, call recording etc. You can proxy rtp for being able to do that but it defeats the purpose of direct media.
 

Incubugs

Member
Apr 7, 2018
175
10
18
49
Hmm i see your point, its a pity that you cant bypass the media until you need MOH or VM etc then it redirect back via the switch, that could take like 80% of the load of a switch, mind you i think our hosted server with the above users shoudl cope fine it was just an idea for testing..

Thanks
 

markjcrane

Active Member
Staff member
Jul 22, 2018
499
177
43
49
Hmm i see your point, its a pity that you cant bypass the media until you need MOH or VM etc then it redirect back via the switch, that could take like 80% of the load of a switch, mind you i think our hosted server with the above users shoudl cope fine it was just an idea for testing..

Thanks

Its possible
 

KonradSC

Active Member
Mar 10, 2017
166
99
28
If you are running a hosted platform in the cloud and all of a client's phones are behind the same public NAT, you can turn on bypass_media with this dialplan step. It will check the IP's of leg_a and leg_b. If they match, then the feature is enabled. You need to test and may have to tweak it according to your environment. MoH may have issues. I can't remember the exact behavior.

Code:
<extension name="local_bypass_media" continue="true" uuid="279f0212-23ab-4a8b-b5ca-370ace75406e">
    <condition field="${call_direction}" expression="^local$">
        <action application="set" data="called_contact=${sofia_contact(*/${destination_number}@${domain_name})}" inline="true"/>
        <action application="set" data="calling_contact=${sofia_contact(*/${caller_id_number}@${domain_name})}" inline="true"/>
    </condition>
     <condition field="${calling_contact}" expression="^.*sofia.*sofia.*$" break="on-true"/>     <condition field="${called_contact}" expression="^.*sofia.*sofia.*$" break="on-true"/>    <condition field="${called_contact}" expression="^.*sip:.*@(\b(?:\d{1,3}\.){3}\d{1,3}\b)" break="never">
        <action application="set" data="called_contact_ip=$1" inline="true"/>
        <anti-action application="set" data="called_contact_ip=unknown" inline="true"/>
    </condition>
    <condition field="${calling_contact}" expression="^.*sip:.*@(\b(?:\d{1,3}\.){3}\d{1,3}\b)" break="never">
        <action application="set" data="calling_contact_ip=$1" inline="true"/>
        <anti-action application="set" data="calling_contact_ip=unknown" inline="true"/>
    </condition>
    <condition field="${called_contact}" expression="^.*fs_path=sip%3A\d+%40((?:\d{1,3}\.){3}\d{1,3})%" break="never">
        <action application="set" data="called_contact_ip=$1" inline="true"/>
    </condition>
    <condition field="${calling_contact}" expression="^.*fs_path=sip%3A\d+%40((?:\d{1,3}\.){3}\d{1,3})%" break="never">
        <action application="set" data="calling_contact_ip=$1" inline="true"/>
    </condition>
    <condition field="${called_contact_ip}" expression="^${calling_contact_ip}$">
        <action application="set" data="bypass_media_after_bridge=true"/>
        <action application="set" data="bypass_media_resume_on_hold=true"/>
        <action application="set" data="bypass_media_after_hold=true"/>
        <action application="set" data="api_on_answer=uuid_debug_media"/>
        <action application="set" data="rtp_manual_rtp_bugs=ALWAYS_AUTO_ADJUST"/>
    </condition>
</extension>
 
  • Like
Reactions: babak

babak

Member
Dec 4, 2016
39
3
8
51
@KonradSC thanks for Clever solution.
Usually hosted pbx providers use a proxy like a Opensips+rtpengine in front of Freeswitch.
In this case is there still a way we use this intelligence and bypass media for clients behaind same public NAT ?

Regards
 

KonradSC

Active Member
Mar 10, 2017
166
99
28
@babak I have a LUA based script that will issue a "uuid_media off" command based off matching IP addresses in the SDP portions of the call. I use this with clients that are using OpenSIPS as a mid-registrar. I don't use rtpengine, so I'm not sure I have a solution for that.

The script looks at the SDP IP for a-leg and b-leg, if they match then I shut off media.
a_sdp = api:executeString("uuid_getvar " .. uuid .. " switch_r_sdp");
b_sdp = api:executeString("uuid_getvar " .. uuid .. " switch_m_sdp");
 
  • Like
Reactions: babak

absg-scott

New Member
Jul 8, 2018
3
0
1
42
I'm circled here a year later, finding my own threads in battling SIP signaling.

With media bypassed on endpoints, each time a caller is placed on hold, Freeswitch sends a call REinvite.

During this invite it would seem logical to update the RTP address with the media servers address rather than the endpoints, this would allow the call to bridge to the media server during the period of HOLD. When the call is placed off hold and reconnected, again an invite is sent, this invite would update to the endpoints address re-establishing direct media. Is there a way to force the invites sent when placing a caller on hold to bring media back to Freeswitch during the period a caller is holding?
 

absg-scott

New Member
Jul 8, 2018
3
0
1
42
I'm circled here a year later, finding my own threads in battling SIP signaling.

With media bypassed on endpoints, each time a caller is placed on hold, Freeswitch sends a call REinvite.

During this invite it would seem logical to update the RTP address with the media servers address rather than the endpoints, this would allow the call to bridge to the media server during the period of HOLD. When the call is placed off hold and reconnected, again an invite is sent, this invite would update to the endpoints address re-establishing direct media. Is there a way to force the invites sent when placing a caller on hold to bring media back to Freeswitch during the period a caller is holding?
I think I found something this morning on the Internal SIP profile at


<!--<param name="media-option" value="resume-media-on-hold"/>
 
Status
Not open for further replies.