Changing default SIP & RTP ports

How do you change the default SIP and RTP settings?

I’m running two separate Asterisk servers behind my router, unless I’m missing something I’ll need to use two different ports for SIP. I’ll port forward one (5060) to server A and the other (5070) to server B. I’ll need to do something similar for RTP.

I imagine I can set the different rtp ports in rtp.conf, but what about SIP? I was thinking sip_general_additional.conf is the place but it tells me not to edit that file.

Please advise.

Thanks!

do not edit the sip_general_additional.conf. As that is owned by FreePBX and will be regenerated and replaced.

I think you are making the problem harder then it needs to be. Why not jsut make the router take port 5070 from outside and forward it to 5060 on server B.

otherwise edit the sip_general_custom.conf file on the second server and put this line in: bindport=5070
you will need to reload sip or restart asterisk.

I think you may be right about over complicating it. The registrar server will send its reply to the REGISTER to the same port that was specified as source in the UDP packet so I’ll have to arrange my iptables so that port 5060 from Server B gets sent out from port 5070 on the router, but that seems reasonable - I should have posted earlier, too bad!!

Thanks,