[asterisk-commits] file: trunk r427306 - in /trunk: ./ res/res_pjsip_multihomed.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Nov 5 06:19:12 CST 2014


Author: file
Date: Wed Nov  5 06:19:09 2014
New Revision: 427306

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=427306
Log:
res_pjsip_multihomed: Add logging during startup to aid debugging if local DNS is misbehaving.

This change adds a bit of logging so if the local DNS is misbehaving it is easier
to track down what is going on and where Asterisk may be hanging.

ASTERISK-24438 #close
Reported by: Melissa Shepherd

Review: https://reviewboard.asterisk.org/r/4148/
........

Merged revisions 427300 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427303 from http://svn.asterisk.org/svn/asterisk/branches/13

Modified:
    trunk/   (props changed)
    trunk/res/res_pjsip_multihomed.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-13-merged' - no diff available.

Modified: trunk/res/res_pjsip_multihomed.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_pjsip_multihomed.c?view=diff&rev=427306&r1=427305&r2=427306
==============================================================================
--- trunk/res/res_pjsip_multihomed.c (original)
+++ trunk/res/res_pjsip_multihomed.c Wed Nov  5 06:19:09 2014
@@ -199,16 +199,24 @@
 
 static int load_module(void)
 {
+	char hostname[MAXHOSTNAMELEN] = "";
 	pj_sockaddr addr;
 
 	CHECK_PJSIP_MODULE_LOADED();
+
+	if (!gethostname(hostname, sizeof(hostname) - 1)) {
+		ast_verb(2, "Performing DNS resolution of local hostname '%s' to get local IPv4 and IPv6 address\n",
+			hostname);
+	}
 
 	if (!pj_gethostip(pj_AF_INET(), &addr)) {
 		pj_sockaddr_print(&addr, host_ipv4, sizeof(host_ipv4), 2);
+		ast_verb(3, "Local IPv4 address determined to be: %s\n", host_ipv4);
 	}
 
 	if (!pj_gethostip(pj_AF_INET6(), &addr)) {
 		pj_sockaddr_print(&addr, host_ipv6, sizeof(host_ipv6), 2);
+		ast_verb(3, "Local IPv6 address determined to be: %s\n", host_ipv6);
 	}
 
 	if (ast_sip_register_service(&multihomed_module)) {




More information about the asterisk-commits mailing list