Module: sems Branch: master Commit: 0005f3d61079a92f71d016b16f6900eab445d99f URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=0005f3d61079a92f71d016b16f6900eab445d99f
Author: Stefan Sayer <[email protected]> Committer: Stefan Sayer <[email protected]> Date: Sun Jan 23 22:09:46 2011 +0100 more debug log regarding SRV lookups --- core/sip/trans_layer.cpp | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/core/sip/trans_layer.cpp b/core/sip/trans_layer.cpp index a731138..0d5c865 100644 --- a/core/sip/trans_layer.cpp +++ b/core/sip/trans_layer.cpp @@ -717,6 +717,7 @@ int _trans_layer::set_destination_ip(sip_msg* msg, cstring* next_hop, unsigned s string nh = c2stlstr(*next_hop); + DBG("checking whether '%s' is IP address...\n", nh.c_str()); if (resolver::instance()->str2ip(nh.c_str(), &(msg->remote_ip), IPv4) == 1) { // already a valid IP address if (!next_port) @@ -724,6 +725,9 @@ int _trans_layer::set_destination_ip(sip_msg* msg, cstring* next_hop, unsigned s else ((sockaddr_in*)&(msg->remote_ip))->sin_port = htons(next_port); + DBG("set destination to %s:%u\n", nh.c_str(), + ntohs(((sockaddr_in*)&(msg->remote_ip))->sin_port)); + return 0; } @@ -732,6 +736,9 @@ int _trans_layer::set_destination_ip(sip_msg* msg, cstring* next_hop, unsigned s // try SRV first string srv_name = "_sip._udp." + nh; + + DBG("no port specified, looking up SRV '%s'...\n", srv_name.c_str()); + if(!resolver::instance()->resolve_name(srv_name.c_str(), &(msg->h_dns), &(msg->remote_ip),IPv4)){ @@ -755,7 +762,7 @@ int _trans_layer::set_destination_ip(sip_msg* msg, cstring* next_hop, unsigned s next_port = 5060; ((sockaddr_in*)&(msg->remote_ip))->sin_port = htons(next_port); } - + return 0; } _______________________________________________ Semsdev mailing list [email protected] http://lists.iptel.org/mailman/listinfo/semsdev
