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();