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 172.16.1.10 and eth1: 10.34.18.250

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 172.16.1.10, 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 10.134.0.0/16 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 172.16.1.10, but 10.34.18.250

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.

    http://forums.asterisk.org/viewtopic.php?f=1&t=84018

    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 172.16.1.10 and the other instance listens on
    10.34.18.250. Maybe this will make the RTP IP in SDP automatically right? But I’m just guessing…

    Here are some instructions for multiple instances:
    http://forums.asterisk.org/viewtopic.php?f=1&tq510

    Regards Markus