Module: kamailio
Branch: master
Commit: 085e2c2ea5f85616c037b083495094a2232c405a
URL:
https://github.com/kamailio/kamailio/commit/085e2c2ea5f85616c037b083495094a…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-08-24T09:11:11+02:00
core: more accurate debug messages when forwarding a reply
---
Modified: src/core/forward.c
---
Diff:
https://github.com/kamailio/kamailio/commit/085e2c2ea5f85616c037b083495094a…
Patch:
https://github.com/kamailio/kamailio/commit/085e2c2ea5f85616c037b083495094a…
---
diff --git a/src/core/forward.c b/src/core/forward.c
index d9a778ca71..a6bf221a79 100644
--- a/src/core/forward.c
+++ b/src/core/forward.c
@@ -696,7 +696,7 @@ int update_sock_struct_from_via( union sockaddr_union* to,
* strings; but only if host is not null terminated (host.s[len] will
* always be ok for a via)
*/
- LM_DBG("trying SRV lookup\n");
+ LM_DBG("check if dns lookup is needed for [%.*s]\n", name->len,
name->s);
proto=via->proto;
he=sip_resolvehost(name, &port, &proto);
@@ -705,6 +705,9 @@ int update_sock_struct_from_via( union sockaddr_union* to,
return -1;
}
+ LM_DBG("address is [%.*s] port %d proto %d\n", name->len, name->s,
+ (int)port, (int)proto);
+
hostent2su(to, he, 0, port);
return 1;
}
@@ -821,14 +824,18 @@ static int do_forward_reply(struct sip_msg* msg, int mode)
goto error;
}
+ LM_DBG("reply forwarded (2nd via address: %.*s port %d)\n",
+ msg->via2->host.len, msg->via2->host.s,
+ (int) msg->via2->port);
+
done:
#ifdef STATS
STATS_TX_RESPONSE( (msg->first_line.u.reply.statuscode/100) );
#endif
- LM_DBG("reply forwarded to %.*s:%d\n",
+ LM_DBG("reply forwarding finished (2nd via address: %.*s port %d)\n",
msg->via2->host.len, msg->via2->host.s,
- (unsigned short) msg->via2->port);
+ (int) msg->via2->port);
STATS_RPL_FWD_OK();
pkg_free(new_buf);