[Serusers] Where does SER get the public IP of a NATed uac from for sending as STATUS message?

'Jan Janak' jan at iptel.org
Tue Dec 13 11:56:41 CET 2005


On 12-12-2005 21:19, Frank Fischer wrote:
> Hi Jan
> Hi all
> 
> > > I have a problem with NATed UACs in my setup. Therefor i 
> > would like to know
> > > where SER takes the public IP of a NATed UAC from, a 
> > request is forwarded to
> > > (using the reply handler) if i call fix_nated_contact() to 
> > rewrite the NATed
> > > UACs contact header. Is it always taken form the received 
> > field in the
> > > location record? 
> > 
> >   From the source IP of the packet.
> 
> Maybe my question was not asked clear enough. Just for clarification: SER
> receives a BYE from the called UAC and has to relay it to the calling UAC.
> Both UACs are natted. Now, where does SER get the public ip address from for
> the calling UAC that the BYE has to be relayed too? It sure can't be the
> source address of the received BYE request since this would be called UAC
> that sent the BYE. So I guess it would have to be read out from some field
> in the BYE request?

  This will be the value of Contact header field from INVITE request,
  rewritten by fix_nated_contact. Thus you need to rewrite the Contact
  value of INVITE before forwarding it. The same for 200 OK if the
  callee is behind NAT too.

> I'm asking this, because i have a reproducable situation with different UACs
> (swissvoice ip10s and patton-inalp smartnodes) where SER relays the BYE to
> the PRIVATE ip address of the calling UAC instead to it's public ip address.
> With snom100 the BYE is relayed to the correct public ip addresse but to the
> port of the private address (meaning to port 5060). In the same BYE request
> i also find that the Request-Line contains the public IP address for the
> natted UAC (where i expected to find the private ip address) and the contact
> hf was not rewritten and contains the public ip address of the UAC). This is
> the second indication that there is something wrong with NAT handling.

  The Request-URI of BYE (or any in-dialog request) usualy contains the
  URI from Contact header from INVITE or 200 OK (depending on the BYE
  direction).

> The nat-related (and most other too) parts of the script are taken from the
> onsip getting started document. There is no firewall or SIP ALG anywhere
> between SER and the natted UACs. I use mediaproxy in combination with
> nathelper. The call is successfully established and the voice channels work
> both way. The only effect you get on the phone from this behaviour is, that
> if the callee ends the phone, the caller doesn't get informed about that
> (since the BYE never arrives). 

  You should look at Contact headers of INVITE and 200 OK. This is where
  user agents take the URIs that will be put in BYE from. SER should
  rewrite them in both directions properly, otherwise the BYE would not
  get through, just like you described.

    Jan.




More information about the sr-users mailing list