I am trying to perform a third-party registration (ie. on behalf of someone else) to a SIP proxy that is running Asterisk. The registration works OK, but for some reason, the proxy’s Asterisk server sends all INVITEs for the registered URI to my server, not to the Contact that I put in the header. It looks like Asterisk thinks that my server is the router/firewall (ie. a NAT device) for the Contact , but that isn’t the case.
Specifically, I am trying to set up a situation where all calls to firstname.lastname@example.org. The message I am sending to the proxy is shown below. Note that my server’s IP address is 126.96.36.199 (which you can see in the message).
REGISTER sip:proxy.freecall.net.au SIP/2.0
Via: SIP/2.0/UDP 188.8.131.52:2340;branch=z9hG4bK298002862
CSeq: 1 REGISTER
When I actually make a call to email@example.com. Instead, it actually goes to port 2340 on my server (184.108.40.206), which is not expecting inbound INVITEs… it is merely performing a third-party registration (and not even listening on 2340 any more). If I set up netcat to listen on UDP port 2340 on my server, I can see the INVITE message coming in (see below).
INVITE sip:firstname.lastname@example.org SIP/2.0
Via: SIP/2.0/UDP 220.127.116.11:5060;branch=z9hG4bK50a99f0c;rport
From: "anonymous" <sip:email@example.com>;tag=as5cc16b96
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Date: Tue, 03 Oct 2006 03:03:03 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
As I understand it, proxy.freecall.net.au should be sending the INVITE directly to the Contact - firstname.lastname@example.org. I know that OpenSER has some NAT traversal helpers that look at the originating IP address/port and compare them to the Contact URI… if they are different, it just makes the blind assumption that it must have come from a NAT device. Does Asterisk do a similar thing? If so, how might I go about actually getting it to honour a third-party registration??
Any thoughts or advice would be much appreciated. Thanks a lot.