SIP And RTP On Different IP’s

Home » Asterisk Users » SIP And RTP On Different IP’s
Asterisk Users 5 Comments

Hello Folks, I am looking for a way that makes Asterisk tell remote SIP
party that the IP where they will send RTP is not the same as the one I am comunicating via SIP

Can this be done anyhow?

I can try and explain:

We have placed a asterisk box in our partners office.

It has eth0 with IP and eth1:

linux has its routes set so it can comunicate with several networks in their offices.

now there is a cisco call manager that we need to communicate with. Normally via our IP, however seems that this cisco uses some sort of ‘directmedya=yes’ and sets both ends speaking RTP with themselves.

There are some extensions in cisco that have a network that we can only comunicate via eth1

thus when calling cisco (always via eth0) sometimes we need to say that OUR
IP to recieve RTP is not, but

can this be done?

5 thoughts on - SIP And RTP On Different IP’s

  • This is a routing issue, not asterisk I think. You are saying you route to cisco via eth0, it sets up connections to its end points and then drops out of the media flow, but the end points have no route to the eth0 address so they fail

    Linux usually sorts this out and asterisk replies on the address of the interface it sends out with. So for the most part the response in my experience if its going out eth1 should use the eth1 ip address.

    If you can get to it via eth0 and thats the preferred route then it will have the eth0 address. If so why can’t you change your routing table to use eth1 when you need to go to the cisco then you will have the right address and the far extensions can respond to you correctly

    Or change the cisco network endpoints so they can successfully access your address on eth0

  • linux does sort this out and asterisk listens in both interfaces. however asterisk connects and tells remote end to send rtp back at the same IP
    where sip is going trough…

    remote end does try to send it but gets stopped in a firewall.. thus if asterisk did present a different IP to recieve RTP in its SIP header, this would not happen!

  • I think this is outside of asterisk’s natural ability

    You may need a proxy server in between you and the Cisco to achieve this if you can’t change the firewall.

    Have you tried making the preferred route to these addresses go out eth1, thus getting the required address?

    Ultimately seems odd the firewall allows access in but not out, guessing you have no control over that?

    Good luck

    Cheers Duncan

  • Am 25.11.2012 15:41, schrieb Tiago Geada:

    How about two Asterisk instances with different bindaddr= settings? One instance listens on and the other instance listens on Maybe this will make the RTP IP in SDP automatically right? But I’m just guessing…

    Here are some instructions for multiple instances:

    Regards Markus