nicthenothing created an issue (kamailio/kamailio#4436)

Description

When using Kamailio IMS (from docker_open5gs setup) as the P-CSCF, SIP calls 
fail to initiate when the UE’s signaling (“ear” channel) and media (“mouth” 
channel) are bound to different ports or sockets.
In the captured logs, the Request-URI and the Destination-URI differ in both 
port and alias parameters, resulting in the INVITE not being routed properly 
through the IPSec tunnel.

It seems that Kamailio does not correctly resolve the IPSec tunnel when the 
UE’s contact and destination information differ (possibly due to alias handling 
or flag configuration).
This issue may relate to improper handling of the alias parameter or flag 
mismatch between use_dst_uri and use_contact.


---

Troubleshooting

Reproduction

1. Deploy the default IMS setup from herlesupreeth/docker_open5gs (Kamailio + 
Open5GS).


2. Attach a UE over IPSec where its signaling and media sockets differ (e.g., 
TCP vs UDP port mismatch).


3. Initiate a SIP INVITE from UE-A to UE-B.


4. Observe that INVITE fails to reach the destination.



Debugging Data

N/A (default Docker config used)

Log Messages

2025-10-15T13:21:33.638305291Z Destination URI: 
sip:10.20.7.216:42602;transport=tcp
2025-10-15T13:21:33.638307845Z Request URI: 
sip:[email protected]:42078


---

SIP Traffic

Request-Line: INVITE 
sip:[email protected]:40404;alias=10.20.7.228~43426~2
 SIP/2.0
Request-URI: 
sip:[email protected]:40404;alias=10.20.7.228~43426~2
Request-URI User Part: 578da559-1f6e-430f-a953-8e4dfc99918e
Request-URI Host Part: 10.20.7.228
Request-URI Host Port: 40404


---

Possible Solutions

Validate handling of alias parameter in IPSec tunnel search logic.

Verify if flag 4 (Use destination URI for IPSec tunnel search) or flag 8 (Use 
new R-URI for IPSec tunnel search) needs adjustment in modparam("ipsec", 
"flag", X) for correct behavior.

Potential fix may involve extending alias resolution to new R-URI before tunnel 
lookup.



---

Additional Information

Kamailio Version:

version: kamailio 5.7.x (from docker_open5gs)

Operating System:

Ubuntu 22.04 (containerized)
Linux 5.15.0-122-generic


-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4436
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/issues/[email protected]>
_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to