[asterisk-commits] irroot: branch irroot/distrotech-customers-10 r334096 - in /team/irroot/distr...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Aug 31 12:22:05 CDT 2011


Author: irroot
Date: Wed Aug 31 12:22:00 2011
New Revision: 334096

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=334096
Log:
resolve conflict, enable automerge

Modified:
    team/irroot/distrotech-customers-10/   (props changed)
    team/irroot/distrotech-customers-10/channels/chan_agent.c
    team/irroot/distrotech-customers-10/channels/chan_dahdi.c
    team/irroot/distrotech-customers-10/channels/chan_sip.c
    team/irroot/distrotech-customers-10/main/channel.c

Propchange: team/irroot/distrotech-customers-10/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/irroot/distrotech-customers-10/
            ('svnmerge-integrated' removed)

Modified: team/irroot/distrotech-customers-10/channels/chan_agent.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-10/channels/chan_agent.c?view=diff&rev=334096&r1=334095&r2=334096
==============================================================================
--- team/irroot/distrotech-customers-10/channels/chan_agent.c (original)
+++ team/irroot/distrotech-customers-10/channels/chan_agent.c Wed Aug 31 12:22:00 2011
@@ -1301,10 +1301,8 @@
 				ast_setstate(parent, AST_STATE_UP);
 				ast_setstate(chan, AST_STATE_UP);
 				ast_copy_string(parent->context, chan->context, sizeof(parent->context));
-				/* Go ahead and mark the channel as a zombie so that masquerade will
-				   destroy it for us, and we need not call ast_hangup */
-				ast_set_flag(chan, AST_FLAG_ZOMBIE);
 				ast_channel_masquerade(parent, chan);
+				ast_hangup(chan);
 				p->abouttograb = 0;
 			} else {
 				ast_debug(1, "Sneaky, parent disappeared in the mean time...\n");

Modified: team/irroot/distrotech-customers-10/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-10/channels/chan_dahdi.c?view=diff&rev=334096&r1=334095&r2=334096
==============================================================================
--- team/irroot/distrotech-customers-10/channels/chan_dahdi.c (original)
+++ team/irroot/distrotech-customers-10/channels/chan_dahdi.c Wed Aug 31 12:22:00 2011
@@ -18216,23 +18216,56 @@
 	int trunkgroup;
 	int dchannels[SIG_PRI_NUM_DCHANS];
 #endif
+	int have_cfg_now;
+	static int had_cfg_before = 1;/* So initial load will complain if we don't have cfg. */
 
 	cfg = ast_config_load(config, config_flags);
-
-	/* Error if we have no config file */
+	have_cfg_now = !!cfg;
 	if (!cfg) {
-		ast_log(LOG_ERROR, "Unable to load config %s\n", config);
-		return 0;
+		/* Error if we have no config file */
+		if (had_cfg_before) {
+			ast_log(LOG_ERROR, "Unable to load config %s\n", config);
+			ast_clear_flag(&config_flags, CONFIG_FLAG_FILEUNCHANGED);
+		}
+		cfg = ast_config_new();/* Dummy config */
+		if (!cfg) {
+			return 0;
+		}
+		ucfg = ast_config_load("users.conf", config_flags);
+		if (ucfg == CONFIG_STATUS_FILEUNCHANGED) {
+			ast_config_destroy(cfg);
+			return 0;
+		}
+		if (ucfg == CONFIG_STATUS_FILEINVALID) {
+			ast_log(LOG_ERROR, "File users.conf cannot be parsed.  Aborting.\n");
+			ast_config_destroy(cfg);
+			return 0;
+		}
 	} else if (cfg == CONFIG_STATUS_FILEUNCHANGED) {
 		ucfg = ast_config_load("users.conf", config_flags);
 		if (ucfg == CONFIG_STATUS_FILEUNCHANGED) {
 			return 0;
-		} else if (ucfg == CONFIG_STATUS_FILEINVALID) {
+		}
+		if (ucfg == CONFIG_STATUS_FILEINVALID) {
 			ast_log(LOG_ERROR, "File users.conf cannot be parsed.  Aborting.\n");
 			return 0;
 		}
 		ast_clear_flag(&config_flags, CONFIG_FLAG_FILEUNCHANGED);
-		if ((cfg = ast_config_load(config, config_flags)) == CONFIG_STATUS_FILEINVALID) {
+		cfg = ast_config_load(config, config_flags);
+		have_cfg_now = !!cfg;
+		if (!cfg) {
+			if (had_cfg_before) {
+				/* We should have been able to load the config. */
+				ast_log(LOG_ERROR, "Bad. Unable to load config %s\n", config);
+				ast_config_destroy(ucfg);
+				return 0;
+			}
+			cfg = ast_config_new();/* Dummy config */
+			if (!cfg) {
+				ast_config_destroy(ucfg);
+				return 0;
+			}
+		} else if (cfg == CONFIG_STATUS_FILEINVALID) {
 			ast_log(LOG_ERROR, "File %s cannot be parsed.  Aborting.\n", config);
 			ast_config_destroy(ucfg);
 			return 0;
@@ -18242,12 +18275,14 @@
 		return 0;
 	} else {
 		ast_clear_flag(&config_flags, CONFIG_FLAG_FILEUNCHANGED);
-		if ((ucfg = ast_config_load("users.conf", config_flags)) == CONFIG_STATUS_FILEINVALID) {
+		ucfg = ast_config_load("users.conf", config_flags);
+		if (ucfg == CONFIG_STATUS_FILEINVALID) {
 			ast_log(LOG_ERROR, "File users.conf cannot be parsed.  Aborting.\n");
 			ast_config_destroy(cfg);
 			return 0;
 		}
 	}
+	had_cfg_before = have_cfg_now;
 
 	/* It's a little silly to lock it, but we might as well just to be sure */
 	ast_mutex_lock(&iflock);

Modified: team/irroot/distrotech-customers-10/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-10/channels/chan_sip.c?view=diff&rev=334096&r1=334095&r2=334096
==============================================================================
--- team/irroot/distrotech-customers-10/channels/chan_sip.c (original)
+++ team/irroot/distrotech-customers-10/channels/chan_sip.c Wed Aug 31 12:22:00 2011
@@ -17189,7 +17189,7 @@
 	a[3] = peer;
 
 	_sip_show_peer(1, -1, s, m, 4, a);
-	astman_append(s, "\r\n\r\n" );
+	astman_append(s, "\r\n" );
 	return 0;
 }
 

Modified: team/irroot/distrotech-customers-10/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-10/main/channel.c?view=diff&rev=334096&r1=334095&r2=334096
==============================================================================
--- team/irroot/distrotech-customers-10/main/channel.c (original)
+++ team/irroot/distrotech-customers-10/main/channel.c Wed Aug 31 12:22:00 2011
@@ -2854,7 +2854,7 @@
 	if (ast_test_flag(chan, AST_FLAG_BLOCKING)) {
 		ast_log(LOG_WARNING, "Hard hangup called by thread %ld on %s, while fd "
 			"is blocked by thread %ld in procedure %s!  Expect a failure\n",
-			(long)pthread_self(), chan->name, (long)chan->blocker, chan->blockproc);
+			(long) pthread_self(), chan->name, (long)chan->blocker, chan->blockproc);
 		ast_assert(ast_test_flag(chan, AST_FLAG_BLOCKING) == 0);
 	}
 	if (!ast_test_flag(chan, AST_FLAG_ZOMBIE)) {




More information about the asterisk-commits mailing list