INVITE using the wrong IP address in Via

AA
Anthony Alba
Tue, Sep 19, 2017 3:40 PM

Hi,

Just encountered this in master branch:

  1. pjsua is sending the INVITE with Via header still using the local
    IP address, and not the received/rport address (after successful
    REGISTER)

  2. UAC -> kamailio -> UAC

  • make a call
  • send CANCEL
  • INVITE and CANCEL use different IP addresses in Via header
  • SIP proxy rejects CANCEL as not being part of a known transaction

// IP address fixed up after NAT
REGISTER: SIP/2.0/TLS
10.0.0.4:56394;rport;branch=z9hG4bKPjAjmLUcOq.RTRbAbmpU108Yw2PWW5lj.P;alias

// this is the local IP address, pre-NAT!
INVITE:  SIP/2.0/TLS
192.168.0.2:34541;rport;branch=z9hG4bKPjQkOe7VO1tujCMj77tCQUFfZcvtQd8Ydu;alias

// Correct! Uses the same Via line as REGISTER
CANCEL: SIP/2.0/TLS
10.0.0.4:56394;rport;branch=z9hG4bKPjQkOe7VO1tujCMj77tCQUFfZcvtQd8Ydu;alias

This occurs about 30% of the time.

Anthony

Hi, Just encountered this in master branch: 1. pjsua is sending the INVITE with Via header still using the local IP address, and not the received/rport address (after successful REGISTER) 2. UAC -> kamailio -> UAC - make a call - send CANCEL - INVITE and CANCEL use different IP addresses in Via header - SIP proxy rejects CANCEL as not being part of a known transaction // IP address fixed up after NAT REGISTER: SIP/2.0/TLS 10.0.0.4:56394;rport;branch=z9hG4bKPjAjmLUcOq.RTRbAbmpU108Yw2PWW5lj.P;alias // this is the local IP address, pre-NAT! INVITE: SIP/2.0/TLS 192.168.0.2:34541;rport;branch=z9hG4bKPjQkOe7VO1tujCMj77tCQUFfZcvtQd8Ydu;alias // Correct! Uses the same Via line as REGISTER CANCEL: SIP/2.0/TLS 10.0.0.4:56394;rport;branch=z9hG4bKPjQkOe7VO1tujCMj77tCQUFfZcvtQd8Ydu;alias This occurs about 30% of the time. Anthony