[asterisk-commits] pabelanger: branch pabelanger/OverrideIAX2 r337828 - /team/pabelanger/Overrid...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Sep 22 22:16:42 CDT 2011


Author: pabelanger
Date: Thu Sep 22 22:16:38 2011
New Revision: 337828

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=337828
Log:
Don't bind on reload

Modified:
    team/pabelanger/OverrideIAX2/channels/chan_iax2.c

Modified: team/pabelanger/OverrideIAX2/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/OverrideIAX2/channels/chan_iax2.c?view=diff&rev=337828&r1=337827&r2=337828
==============================================================================
--- team/pabelanger/OverrideIAX2/channels/chan_iax2.c (original)
+++ team/pabelanger/OverrideIAX2/channels/chan_iax2.c Thu Sep 22 22:16:38 2011
@@ -13385,18 +13385,19 @@
 		network_change_event_unsubscribe();
 	}
 
-	if (!(ns = ast_netsock_bind(netsock, io, bindaddr, portno, qos.tos, qos.cos, socket_read, NULL))) {
-		ast_log(LOG_ERROR, "Unable to create network socket: %s\n", strerror(errno));
+	if (!reload) {
+		if (!(ns = ast_netsock_bind(netsock, io, bindaddr, portno, qos.tos, qos.cos, socket_read, NULL))) {
+			ast_log(LOG_ERROR, "Unable to create network socket: %s\n", strerror(errno));
+		} else {
+			if (strchr(v->value, ':')) {
+				ast_verb(2, "Binding IAX2 to '%s'\n", v->value);
+			} else {
+				ast_verb(2, "Binding IAX2 to '%s:%d'\n", v->value, portno);
+			}
+			defaultsockfd = ast_netsock_sockfd(ns);
+			ast_netsock_unref(ns);
+		}
 	} else {
-		if (strchr(v->value, ':')) {
-			ast_verb(2, "Binding IAX2 to '%s'\n", v->value);
-		} else {
-			ast_verb(2, "Binding IAX2 to '%s:%d'\n", v->value, portno);
-		}
-		defaultsockfd = ast_netsock_sockfd(ns);
-		ast_netsock_unref(ns);
-	}
-	if (reload) {
 		ast_netsock_release(outsock);
 		outsock = ast_netsock_list_alloc();
 		if (!outsock) {




More information about the asterisk-commits mailing list