[asterisk-commits] file: branch 13 r427303 - in /branches/13: ./ res/res_pjsip_multihomed.c

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


Author: file
Date: Wed Nov  5 06:18:05 2014
New Revision: 427303

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=427303
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

Modified:
    branches/13/   (props changed)
    branches/13/res/res_pjsip_multihomed.c

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

Modified: branches/13/res/res_pjsip_multihomed.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/res/res_pjsip_multihomed.c?view=diff&rev=427303&r1=427302&r2=427303
==============================================================================
--- branches/13/res/res_pjsip_multihomed.c (original)
+++ branches/13/res/res_pjsip_multihomed.c Wed Nov  5 06:18:05 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