• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1190
  • Last Modified:

Asterisk SIP Registration Issues

We have an Asterisk-based PBX system inside a firewall that has two Internet connections. The main Internet connection has an IP of 123.123.123.123 (just for the purposes of this posted question), and the backup connection has 456.456.456.456.

Users at home with softphones (X-Lite, for example) try to connect to the PBX via the backup connection, and registration is successful... sort of. I used WireShark to dump the packets during the SIP registration, and it looks like this: (all the communication is between my IP and the 456.456.456.456 IP)

1. X-Lite asks to be registered.
2. PBX says that it's unauthorized.
3. X-Lite provides authorization info.
4. PBX says "OK" and sends an "OPTIONS" instruction, but tells X-Lite to use the 123.123.123.123 instead of 456.456.456.456.

Here's the excerpt from that packet:
Contact: <sip:Unknown@123.123.123.123:41200>

I -THINK- this should be:
Contact: <sip:Unknown@456.456.456.456:41200>

I think X-Lite is being told to use the 123.123.123.123 address, so when it places calls, it's trying to connect to that IP instead of 456.456.456.456. Packets to 123.123.123.123 wouldn't be routed properly back to the PBX, so communication just doesn't go anywhere at this point.

My question: How do I get Asterisk to change that initial Contact packet or how do I correct the IP address in it? Does Asterisk try to go find its external IP address at startup or something, and then keeps it in memory?
0
gr8gonzo
Asked:
gr8gonzo
1 Solution
 
grbladesCommented:
By default asterisk uses the IP address assigned to the interface the registration came in on.
Some firewalls (cisco pix/asa for example) support SIP and will automatically change the contents of packets to the fix the ip address.
Check to make sure that the routing is correct and that outbound traffic is going via the backup connection.

In asterisks sip.cong configuration file there are options externip= and localnet= where you can specify the local IP range and the asterisk box's real external IP. If asterisk detects the connection is not from a local IP then it will use the external ip configured instead of the ip address of its external interface.
Perhaps this is already configured but with 123.123.123.123 by mistake.
0
 
gr8gonzoConsultantAuthor Commented:
That technically answers the question. However, it didn't solve the problem. Seems like it's an issue with the PBX and the softphone both being behind different NATs. We switched to using IAX2 protocol and a IAX-compatible softphone (Zoiper) and it worked great.
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now