Scenario: endpoint (bob) <-> kamailio proxy (5.1.3) <-> kamailio backend (5.1.2)
Both kamailio instances are running the topos module (mysql backend). Call setup is fine, but forwarding BYEs fail.
With a call from endpoint to kamailio, topos on the proxy scrambles Contact to kamailio backend. But in responses from backend contact remains untouched. In the ACK to the 200, topos on the proxy does nothing. If the caller hangsup, the BYE will loop internally till max hops is exceeded (483 which will be send to caller eventually).
When the backend initiates the call to the endpoint, topos appears to work, but the BYE from the endpoint on hangup get a 404 Not here from the proxy (route[WITHINDLG]).
Disabling topos on the proxy will result in a functioning proxy (config attached).
Is there something wrong with my config? Or is this an unforseen scenario that just doesn't work with topos?
* Endpoint to backend scenario
endpoint:5060 -> proxy:5060 INVITE sip:callee@sip.pocos.nl;transport=tcp SIP/2.0 Via: SIP/2.0/UDP endpoint:5060;rport;branch=... Max-Forwards: 70 Route: sip:proxy:5060;lr Contact: sip:bob@endpoint:5060;ob
proxy:5060 -> backend:5060 INVITE sip:callee@sip.itco.nl;transport=tcp SIP/2.0 Via: SIP/2.0/UDP proxy;branch=... CSeq: 29848 INVITE Route: sip:proxy:5060;lr Contact: sip:btpsh-5af5972d-bf5e-2@proxy
backend:5060 -> proxy:5060 SIP/2.0 200 OK Via: SIP/2.0/UDP proxy;branch=... Contact: sip:atpsh-5af19bf0-9f94-7@backend
proxy:5060 -> endpoint:5060 SIP/2.0 200 OK Contact: sip:atpsh-5af19bf0-9f94-7@backend Via: SIP/2.0/UDP endpoint:5060;received=endpoint;rport=5060;branch=... Record-Route: sip:proxy;lr
endpoint:5060 -> proxy:5060 ACK sip:atpsh-5af19bf0-9f94-7@backend SIP/2.0 Via: SIP/2.0/UDP endpoint:5060;rport;branch=... Route: sip:proxy;lr
proxy:5060 -> backend:5060 ACK sip:atpsh-5af19bf0-9f94-7@backend SIP/2.0 Via: SIP/2.0/UDP proxy;branch=... Via: SIP/2.0/UDP endpoint:5060;received=endpoint;rport=5060;branch=...
endpoint:5060 -> proxy:5060 BYE sip:atpsh-5af19bf0-9f94-7@backend SIP/2.0 Via: SIP/2.0/UDP endpoint:5060;rport;branch=... Max-Forwards: 70 Route: sip:proxy;lr
proxy:5060 -> proxy:5060 BYE sip:atpsh-5af19bf0-9f94-7@backend SIP/2.0 Via: SIP/2.0/UDP proxy;branch=... Via: SIP/2.0/UDP endpoint:5060;received=endpoint;rport=5060;branch=... Max-Forwards: 69 Route: sip:proxy;lr
proxy:5060 -> proxy:5060 BYE sip:atpsh-5af19bf0-9f94-7@backend SIP/2.0 Via: SIP/2.0/UDP proxy;branch=... Via: SIP/2.0/UDP proxy;rport=5060;branch=... Via: SIP/2.0/UDP endpoint:5060;received=endpoint;rport=5060;branch=... Max-Forwards: 68 Route: sip:proxy;lr
[not going to mention the 50+ BYEs adding Vias and decrementing Max-Forwards.
* Backend to endpoint scenario
backend:5060 -> proxy:5060 INVITE sip:bob@endpoint:5060;ob SIP/2.0 Via: SIP/2.0/UDP backend;branch=... Route: sip:loadbalancer@proxy;lr;received=sip:endpoint:5060 Contact: sip:btpsh-5af07a27-72b-502c1@backend
proxy:5060 -> endpoint:5060 INVITE sip:bob@endpoint:5060;ob SIP/2.0 Via: SIP/2.0/UDP proxy;branch=... Contact: sip:btpsh-5af5972d-bf5d-5@proxy
endpoint:5060 -> proxy:5060 SIP/2.0 200 OK Via: SIP/2.0/UDP proxy;received=proxy;branch=... Contact: sip:bob@endpoint:5060;ob
proxy:5060 -> backend:5060 SIP/2.0 200 OK Contact: sip:bob@endpoint:5060;ob;alias=endpoint~5060~1 Via: SIP/2.0/UDP backend;rport=5060;branch=... Record-Route: sip:proxy;lr
endpoint:5060 -> proxy:5060 BYE sip:btpsh-5af5972d-bf5d-5@proxy SIP/2.0 Via: SIP/2.0/UDP endpoint:5060;rport;branch=...
proxy:5060 -> endpoint:5060 SIP/2.0 404 Not here Via: SIP/2.0/UDP endpoint:5060;rport=5060;branch=...
Hello,
only spirals cannot be handled by topos due to its initial design (some things needs to be changed for it), so the case you present should work.
From the excerpts you present, there is an unexpected Record-Route with
the proxy address in the 200ok towards endpoint. Is it so or just a mistake in what you pasted here? Because there should be no record-route with proxy address if proxy does topos.
Cheers, Daniel
On 11.05.18 16:11, Daniel Tryba wrote:
Scenario: endpoint (bob) <-> kamailio proxy (5.1.3) <-> kamailio backend (5.1.2)
Both kamailio instances are running the topos module (mysql backend). Call setup is fine, but forwarding BYEs fail.
With a call from endpoint to kamailio, topos on the proxy scrambles Contact to kamailio backend. But in responses from backend contact remains untouched. In the ACK to the 200, topos on the proxy does nothing. If the caller hangsup, the BYE will loop internally till max hops is exceeded (483 which will be send to caller eventually).
When the backend initiates the call to the endpoint, topos appears to work, but the BYE from the endpoint on hangup get a 404 Not here from the proxy (route[WITHINDLG]).
Disabling topos on the proxy will result in a functioning proxy (config attached).
Is there something wrong with my config? Or is this an unforseen scenario that just doesn't work with topos?
- Endpoint to backend scenario
endpoint:5060 -> proxy:5060 INVITE sip:callee@sip.pocos.nl;transport=tcp SIP/2.0 Via: SIP/2.0/UDP endpoint:5060;rport;branch=... Max-Forwards: 70 Route: sip:proxy:5060;lr Contact: sip:bob@endpoint:5060;ob
proxy:5060 -> backend:5060 INVITE sip:callee@sip.itco.nl;transport=tcp SIP/2.0 Via: SIP/2.0/UDP proxy;branch=... CSeq: 29848 INVITE Route: sip:proxy:5060;lr Contact: sip:btpsh-5af5972d-bf5e-2@proxy
backend:5060 -> proxy:5060 SIP/2.0 200 OK Via: SIP/2.0/UDP proxy;branch=... Contact: sip:atpsh-5af19bf0-9f94-7@backend
proxy:5060 -> endpoint:5060 SIP/2.0 200 OK Contact: sip:atpsh-5af19bf0-9f94-7@backend Via: SIP/2.0/UDP endpoint:5060;received=endpoint;rport=5060;branch=... Record-Route: sip:proxy;lr
endpoint:5060 -> proxy:5060 ACK sip:atpsh-5af19bf0-9f94-7@backend SIP/2.0 Via: SIP/2.0/UDP endpoint:5060;rport;branch=... Route: sip:proxy;lr
proxy:5060 -> backend:5060 ACK sip:atpsh-5af19bf0-9f94-7@backend SIP/2.0 Via: SIP/2.0/UDP proxy;branch=... Via: SIP/2.0/UDP endpoint:5060;received=endpoint;rport=5060;branch=...
endpoint:5060 -> proxy:5060 BYE sip:atpsh-5af19bf0-9f94-7@backend SIP/2.0 Via: SIP/2.0/UDP endpoint:5060;rport;branch=... Max-Forwards: 70 Route: sip:proxy;lr
proxy:5060 -> proxy:5060 BYE sip:atpsh-5af19bf0-9f94-7@backend SIP/2.0 Via: SIP/2.0/UDP proxy;branch=... Via: SIP/2.0/UDP endpoint:5060;received=endpoint;rport=5060;branch=... Max-Forwards: 69 Route: sip:proxy;lr
proxy:5060 -> proxy:5060 BYE sip:atpsh-5af19bf0-9f94-7@backend SIP/2.0 Via: SIP/2.0/UDP proxy;branch=... Via: SIP/2.0/UDP proxy;rport=5060;branch=... Via: SIP/2.0/UDP endpoint:5060;received=endpoint;rport=5060;branch=... Max-Forwards: 68 Route: sip:proxy;lr
[not going to mention the 50+ BYEs adding Vias and decrementing Max-Forwards.
- Backend to endpoint scenario
backend:5060 -> proxy:5060 INVITE sip:bob@endpoint:5060;ob SIP/2.0 Via: SIP/2.0/UDP backend;branch=... Route: sip:loadbalancer@proxy;lr;received=sip:endpoint:5060 Contact: sip:btpsh-5af07a27-72b-502c1@backend
proxy:5060 -> endpoint:5060 INVITE sip:bob@endpoint:5060;ob SIP/2.0 Via: SIP/2.0/UDP proxy;branch=... Contact: sip:btpsh-5af5972d-bf5d-5@proxy
endpoint:5060 -> proxy:5060 SIP/2.0 200 OK Via: SIP/2.0/UDP proxy;received=proxy;branch=... Contact: sip:bob@endpoint:5060;ob
proxy:5060 -> backend:5060 SIP/2.0 200 OK Contact: sip:bob@endpoint:5060;ob;alias=endpoint~5060~1 Via: SIP/2.0/UDP backend;rport=5060;branch=... Record-Route: sip:proxy;lr
endpoint:5060 -> proxy:5060 BYE sip:btpsh-5af5972d-bf5d-5@proxy SIP/2.0 Via: SIP/2.0/UDP endpoint:5060;rport;branch=...
proxy:5060 -> endpoint:5060 SIP/2.0 404 Not here Via: SIP/2.0/UDP endpoint:5060;rport=5060;branch=...
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
On Wed, May 23, 2018 at 10:58:16PM +0200, Daniel-Constantin Mierla wrote:
From the excerpts you present, there is an unexpected Record-Route with the proxy address in the 200ok towards endpoint. Is it so or just a mistake in what you pasted here? Because there should be no record-route with proxy address if proxy does topos.
The Record-Route is no mistake. It is added on the proxy.
backend:5060 -> proxy:5060 SIP/2.0 200 OK Via: SIP/2.0/UDP proxy;branch=... Contact: sip:atpsh-5af19bf0-9f94-7@backend
proxy:5060 -> endpoint:5060 SIP/2.0 200 OK Contact: sip:atpsh-5af19bf0-9f94-7@backend Via: SIP/2.0/UDP endpoint:5060;received=endpoint;rport=5060;branch=... Record-Route: sip:proxy;lr
I have no idea where this is added since there are only 3 record_route() calls in the config:
------------------------------------------------ # Main SIP request routing logic # - processing of any incoming SIP request starts with this route # - note: this is the same as route { ... } request_route { # xlog("L_ALERT","REQUESTROUTE: $rm from $fu (IP:$si:$sp) to $ru via $du\n");
if(t_precheck_trans()) { t_check_trans(); exit; } else { if(is_method("INVITE") && !has_totag()) { t_newtran(); t_reply("100","Trying"); } }
route(REQINIT);
route(NATDETECT); route(WITHINDLG);
if (is_method("INVITE|SUBSCRIBE")) { record_route(); }
------------------------------------------------ route[REQINIT] { .... //some custom mangling for OPTIONS from the backends if(is_method("OPTIONS") && $fU=="pinger" && is_in_subnet($si, "185.61.68.104/30")) { record_route(); remove_hf("Route");
------------------------------------------------ # Handle requests within SIP dialogs route[WITHINDLG] { if (!has_totag()) return;
# sequential request withing a dialog should # take the path determined by record-routing if (loose_route()) { route(DLGURI); if ( is_method("ACK") ) { # ACK is forwarded statelessy route(NATMANAGE); } else if ( is_method("NOTIFY") ) { # Add Record-Route for in-dialog NOTIFY as per RFC 6665. record_route();