Hello all,

We are facing an issue while configuring TOPOS in Kamailio P-CSCF (running under Docker). Our objective is to strip Via, Record-Route, and Route headers for both INVITE and 180 Ringing responses. However, we observe unexpected behavior when handling the 180 Ringing/200 OK responses.

Call Flow & Issue Description:
Note: Public IP and Private IP mapping using the below configuration.
listen=udp:Local_IP:5060 name "internal"
listen=udp:Local_IP:6070 advertise Public_IP:6070 name "external"

Call Flow (INVITE): A-Party --> Kamailio P-CSCF (Public IP) --> Kamailio P-CSCF (Private IP) --> Kamailio S-CSCF (Private IP) -->  Kamailio P-CSCF (Private IP) -->  Kamailio P-CSCF (Public IP) --> B-Party
For an incoming INVITE (A-Party → B-Party), TOPOS successfully strips the headers when the message flows through the P-CSCF, ensuring proper privacy of routing information.

Issue : When B-Party sends a 180 Ringing, we observe that Kamailio P-CSCF (Private IP) adds a Record-Route header before forwarding the message to A-Party.
Call Flow (180 Ringing):  B-Party --> Kamailio P-CSCF (Public IP) --> Kamailio P-CSCF (Private IP) --> Kamailio S-CSCF (Private IP)

We need to ensure that the Record-Route and Via headers are stripped properly in both directions.

Please guide us how to achieve and what we are doing wrong.

TOPOS module is configured as follows:
modparam("ndb_redis", "server", "name=srv1;addr=127.0.0.1;port=6379")
modparam("topos_redis", "serverid", "srv1")
modparam("topos", "storage", "redis")
modparam("topos", "contact_mode", 1)
modparam("topos", "rr_update", 1)

RR module is configured as follows:
modparam("rr", "enable_full_lr", 1)
modparam("rr", "append_fromtag", 1)

configured the below event_route:
event_route[topos:msg-outgoing] {
xlog("L_INFO","[topos:msg-outgoing]");
if(is_request() and $sndto(ip)=="SCSCF_PRIVATE_IP") {
xlog("L_INFO","[topos:msg-outgoing] TOPOS \n");
drop;
}
}


Thanks,
Vinayak Makwana



Disclaimer
In addition to generic Disclaimer which you have agreed on our website, any views or opinions presented in this email are solely those of the originator and do not necessarily represent those of the Company or its sister concerns. Any liability (in negligence, contract or otherwise) arising from any third party taking any action, or refraining from taking any action on the basis of any of the information contained in this email is hereby excluded.

Confidentiality
This communication (including any attachment/s) is intended only for the use of the addressee(s) and contains information that is PRIVILEGED AND CONFIDENTIAL. Unauthorized reading, dissemination, distribution, or copying of this communication is prohibited. Please inform originator if you have received it in error.

Caution for viruses, malware etc.
This communication, including any attachments, may not be free of viruses, trojans, similar or new contaminants/malware, interceptions or interference, and may not be compatible with your systems. You shall carry out virus/malware scanning on your own before opening any attachment to this e-mail. The sender of this e-mail and Company including its sister concerns shall not be liable for any damage that may incur to you as a result of viruses, incompleteness of this message, a delay in receipt of this message or any other computer problems.