Is there any way that I can configure FreePBX to “proxy” the RTP streams coming from an upstream Carrier?
Example: Endpoint 1000 (another PBX) → FreePBX → PJSIP Trunk with Carrier → Upstream Carrier OR Upstream Carrier → PJSIP Trunk → FreePBX → PBX with ext. 1000.
By default, my PJSIP Carrier will give me the RTP Server in the SDP from the 200 OK coming from their side. What I want to achieve it’s to pass this directly to the endpoint and not pass it through FreePBX.
Is there any way that I enable/disable this for an extension? I don’t want to make this a global setting.
There is no ability to do this at call setup time. There is only the ability for Asterisk to re-INVITE afterwards to have media go directly which is enabled using the direct_media option HOWEVER it requires conditions to be absolutely perfect. No feature that would require media involvement has to be used. No DTMF features, no transcoding, no Local channels.
So in order for the direct_media to work, I need a “SBC” before, that would act as a SIP Proxy?
I’m asking because I’m testing right now with an extension on the FreePBX where I disabled the Direct Media, and still FreePBX it’s sending it’s own IP Address in the SDP c= field, instead of the endpoint’s c= that it’s sent into the 200OK.
Note that both endpoints must have Direct Media enabled.
I assume that the remote PBX is configured as a trunk on your PBX. If not, please explain.
What device? To work, it must be on a public IP address or have NAT mapping set up so it exactly emulates being on a public IP. This usually requires the NAT router to forward the device’s RTP port range to the device.
Asterisk has special case handling for SIP which allows it to take itself out the media path. Whilst normally everything goes through the Asterisk core, and its SIPness is lost in the process, if both parties use the same SIP channel driver and other conditions are met, there are two further options, a native bridging mode, in which the RTP is forwarded packet for packet, and an external bridging mode (direct media) in which the SDP gives the direct address to the next hop.
In practice, direct media is difficult on FreePBX, because the default configuration supports feature codes, which require the media to pass through Asterisk. Also, many people want to record calls, and, when it comes to queues, FreePBX tends to use local channels.
It’s not just queues. Everything in FreePBX uses Local Channels. With FreePBX it’s almost impossible to get out of the media because of the use of Local Channels everywhere.