Hi,
I have an IMS core deployed using kamailio 5.0.2. Calls from clients are reaching the core pcscf from a freeswitch (with address A.A.A.A) + a kamailio acting as proxy (with address B.B.B.B), so the INVITE request looks
like this:
INVITE sip:1111111111@mnc001.mcc001.3gppnetwork.org SIP/2.0
Record-Route: <sip:A.A.A.A;lr>
Via: SIP/2.0/UDP A.A.A.A;branch=z9hG4bK8735.ef7a61e110f335b2e92a8c1d430de585.0
Via: SIP/2.0/UDP B.B.B.B:5080;received=B.B.B.B;rport=5080;branch=z9hG4bKHpB704ZaXSKtm
Max-Forwards: 65
From: "222222222" <sip:222222222@B.B.B.B>;tag=eytD49ymQr71S
To: <sip:1111111111@mnc001.mcc001.3gppnetwork.org>
Call-ID: 77d249c0-487c-1236-1997-00163edbaa97
CSeq: 115249948 INVITE
Contact: <sip:mod_sofia@B.B.B.B:5080>
User-Agent: FreeSWITCH-mod_sofia/1.6.19+git~20170927T175834Z~38f568d343~64bit
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY
Supported: timer, path, replaces
Allow-Events: talk, hold, conference, refer
Content-Type: application/sdp
Content-Disposition: session
Content-Length: 224
P-Charge-Info: <sip:222222222@mobile.tuenti.int>;npi=ISDN;noa=4
X-FS-Support: update_display,send_info
Remote-Party-ID: "222222222" <sip:222222222@B.B.B.B>;party=calling;screen=yes;privacy=off
If the client cancels the request, the CANCEL request that gets to the core pcscf looks like this:
CANCEL sip:1111111111@mnc001.mcc001.3gppnetwork.org SIP/2.0
Via: SIP/2.0/UDP A.A.A.A;branch=z9hG4bK8735.ef7a61e110f335b2e92a8c1d430de585.0
Max-Forwards: 65
From: "222222222" <sip:222222222@B.B.B.B>;tag=eytD49ymQr71S
To: <sip:1111111111@mnc001.mcc001.3gppnetwork.org>
Call-ID: 77d249c0-487c-1236-1997-00163edbaa97
CSeq: 115249948 CANCEL
Content-Length: 0
Reason: Q.850;cause=16;text="Normal Call Clearing"
The processing of the CANCEL at the pcscf is eventually reaching the t_check_trans() function, but the logs return “no CANCEL matching found!” and thus the processing ends. I have followed the code up to the via_matching
function in the t_lookup.c file of the tm module source and added some logs. The via matching is failing at the port comparison (the port stored for the INVITE is “5060”, the port stored for the CANCEL is “0”.
The flow works ok with a different client (connected directly to the core) which includes the port in the Via headers.
¿Can this be a bug in kamailio or am I doing something wrong?. AFAIK The RFC 3261 does not mandate to include the ports in the sent-by element of the Via header
Thanks!
Carlos