Hi Guys
I am bit new to asterisk and trying to bypass the RTP traffic away from my asterisk server. Below is my current setup
VOIP Provider <—INTERNET—> MY ASTERISK SERVER <—INTERNET—>NAT ROUTER—>END USER
Currently in wireshark capture when VOIP Provider passes the SIP 183/200 they use different media servers around the world (which is different from providers SIP proxy address). I want to pass whatever media IP VOIP Provider using to END user so media directly flows between two endpoints.
Anyone can please guide me what to achieve this? It would be really helpful.
Thanks
Ajay
Read about directmedia on sip peer configuration. But keep in mind that using recordings, ivrs, features or even Nat environment can break the setup.
Hi I tried directmedia=yes in sip peer configuration however its not working as expected.
I can see the reinvite from asterisk to softphone telling to send RTP to provider’s media IP address.
My softphone then sends the media directly to provider’s media IP, however instead of receiving the RTP directly from provider’s media server to softphone, i receive the rtp from my asterisk server. Below is my provider and sip peer config.
[xxxxx]
type=peer
host=x.x.x.x
progressinband=never
port=5060
nat=auto
insecure=very
ignoresdpversion=yes
dtmfmode=rfc2833
disallow=all
allow=alaw
allow=ulaw
context=<>
Below is my sip peer config.
[TEST]
type=peer
host=x.x.x.x
context=demo
directmedia=yes
Ok after looking at the capture below is the situation
CALL LEG 1 - Between My Asterisk Server and SIP PEER
CALL LEG 2 - Between My Asterisk Server and SIP PROVIDER
CALL LEG 1
SIP PROXY(1.1.1.1) <----------> SIP PEER (2.2.2.2)
<---------INVITE (SDP MEDIA IP 2.2.2.2)------------
----------183/200OK (SDP MEDIA IP 1.1.1.1)-------->
-----------RE-INVITE (SDP MEDIA IP 5.5.5.5)-------> # THIS IS PROVIDERS MEDIA IP
<----------183/200OK (SDP MEDIA IP 2.2.2.2)--------
CALL LEG 2
SIP PROXY(1.1.1.1) <----------> CARRIER (3.3.3.3)
---------INVITE (SDP MEDIA IP 1.1.1.1)------------>
<----------183/200OK (SDP MEDIA IP 5.5.5.5)-----
-----------RE-INVITE (SDP MEDIA IP 2.2.2.2)-------> # THIS IS MY SIP PEER MEDIA IP
<----------183/200OK (SDP MEDIA IP 5.5.5.5)--------
---------INVITE (SDP MEDIA IP 1.1.1.1)------------> # HERE IT CHANGES THE MEDIA IP TO ITSELF
<----------183/200OK (SDP MEDIA IP 5.5.5.5)-----
Problem is at last set of invite and 183/200ok on call leg two.
Is there a way to avoid it?
Ajay
You will get a re-invite back at the end of the call, as the low level logic doesn’t know that there will not be more dialplan to run. If you are gettting it immediately after the OK, you are going to have to provide more detailed debugging, as Asterisk should see no difference between the two parties.
NB Asterisk is a B2BUA, not a proxy.