[asterisk-users] Reinvite and NAT -> Problem

Roger Schreiter roger at planinternet.de
Tue Jul 18 05:46:39 MST 2006


Hi,

I have following setup:

+------------+         +------------+
| asterisk A |---------| asterisk B |----------> PSTN-gateways ...
+------------+         +------------+
       |                     .|
       |                  .
=Router (NAT)=========.==============
       |            .
+------------+  .
| SIP phone  |-
+------------+


asterisk A should do registration and call setup ...,
and asterisk B should handle the media.
Thus asterisk A should reinivite SIP phone and asterisk B
on any call.

I have asterisk 1.0.10, and on asterisk A the users are
stored in mysql/sipfriends, which works fine. I already
bugfixed in the source code, that chan_sip ignores the canreinvite-
setting from sip.conf, and now calls from SIP phone to the
PSTN gateway work perfekt:

Reinvite occours, and using tcpdump I can see, that after
call setup IP traffic is only between the router and asterisk
B, but no more between router and asterisk A (besides hangup).


The problem occours in the other direction, PSTN gateway
to SIP phone:

asterisk B is calling asterisk A, and than asterisk A is
calling the SIP phone, as intended.
Also as intended reinvite is taking place.
But unfortunately, asterisk B is addressing the private
(to be NATed) IP address of the SIP phone.
Thus, audio data are flowing from SIP phone to asterisk B, but
no audio data are flowing from asterisk B to SIP phone.
The NAT workaround of asterisk is not working as desired.

I assume, with a little source code modification the problem
would be solved (like the sipfriends/canreinvite problem).

Unfortunately I do not understand, who has to care about the
NAT workaround.
Is it asterisk A, who has to tell the right (SIP phones public) IP
address to asterisk B
(i.e. the one, where it gets IP traffic from instead of the one
SIP phone tells),
or is it asterisk B, who has to ignore the IP address, which SIP
phone tells, but has to take the IP address, where traffic
is coming from?


Please explain how reinvite with NAT workaround should work!


Roger.




More information about the asterisk-users mailing list