[svn-commits] bebuild: tag 10.5.0-digiumphones-rc2 r367968 - in /tags/10.5.0-digiumphones-r...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed May 30 09:32:21 CDT 2012


Author: bebuild
Date: Wed May 30 09:32:16 2012
New Revision: 367968

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=367968
Log:
Merge r367267,367562,367782,367844 for 10.5.0-digiumphones-rc2


Removed:
    tags/10.5.0-digiumphones-rc2/asterisk-10.5.0-digiumphones-rc1-summary.html
    tags/10.5.0-digiumphones-rc2/asterisk-10.5.0-digiumphones-rc1-summary.txt
Modified:
    tags/10.5.0-digiumphones-rc2/   (props changed)
    tags/10.5.0-digiumphones-rc2/.version
    tags/10.5.0-digiumphones-rc2/ChangeLog
    tags/10.5.0-digiumphones-rc2/apps/app_confbridge.c
    tags/10.5.0-digiumphones-rc2/channels/chan_iax2.c
    tags/10.5.0-digiumphones-rc2/channels/chan_sip.c
    tags/10.5.0-digiumphones-rc2/channels/chan_skinny.c

Propchange: tags/10.5.0-digiumphones-rc2/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Propchange: tags/10.5.0-digiumphones-rc2/
------------------------------------------------------------------------------
    svn:mergeinfo = /branches/10:367267,367562,367782,367844

Modified: tags/10.5.0-digiumphones-rc2/.version
URL: http://svnview.digium.com/svn/asterisk/tags/10.5.0-digiumphones-rc2/.version?view=diff&rev=367968&r1=367967&r2=367968
==============================================================================
--- tags/10.5.0-digiumphones-rc2/.version (original)
+++ tags/10.5.0-digiumphones-rc2/.version Wed May 30 09:32:16 2012
@@ -1,1 +1,1 @@
-10.5.0-digiumphones-rc1
+10.5.0-digiumphones-rc2

Modified: tags/10.5.0-digiumphones-rc2/ChangeLog
URL: http://svnview.digium.com/svn/asterisk/tags/10.5.0-digiumphones-rc2/ChangeLog?view=diff&rev=367968&r1=367967&r2=367968
==============================================================================
--- tags/10.5.0-digiumphones-rc2/ChangeLog (original)
+++ tags/10.5.0-digiumphones-rc2/ChangeLog Wed May 30 09:32:16 2012
@@ -1,3 +1,47 @@
+2012-05-30  Asterisk Development Team <asteriskteam at digium.com>
+
+	* Asterisk 10.5.0-digiumphones-rc2 Released.
+
+	* Resolve crash in subscribing for MWI notifications.
+
+	  ASTOBJ_UNREF sets the variable to NULL after unreffing it, so the
+	  variable shoudl definitely not be used after that. To solve this in
+	  the two cases that affect subscribing for MWI notifications, we
+	  instead save the ref locally, and unref them in the error
+	  conditions.
+	  
+	  (closes issue ASTERISK-19827)
+	  Reported by: B. R.
+	  Review: https://reviewboard.asterisk.org/r/1940/
+
+	* Fix crash in ConfBridge when user announcement is played for more
+	  than 2 users
+
+	  A patch introduced in r354938 made it so that ConfBridge would not
+	  attempt to play sound files if those files did not exist.
+	  Unfortunately, ConfBridge uses the same underlying fucntion,
+	  play_sound_helper, to playback both the sound files and numbers to
+	  callers. When a number is being played back, the name of the sound
+	  file is expected to be NULL. This NULL value was passed into a
+	  function that tested for the existance of a sound file and is not
+	  tolerant to NULL file names, causing a crash.
+
+	  This patch fixes the behavior, such that if a sound file does not
+	  exist we do not attempt to play it, but we only attempt that check
+	  if the sound file was specified in the first place. If a sound file
+	  was not specified, we use the 'play number' logic in the helper
+	  function.
+
+	  (closes issue ASTERISK-19899)
+	  Reported by: Florian Gilcher
+	  Tested by: Florian Gilcher
+	  patches:
+	    ASTERISK-19899.diff uploaded by mjordan (license 6283)
+
+	* AST-2012-007
+
+	* AST-2012-008
+
 2012-05-03  Asterisk Development Team <asteriskteam at digium.com>
 
 	* Asterisk 10.5.0-digiumphones-rc1 Released.

Modified: tags/10.5.0-digiumphones-rc2/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/tags/10.5.0-digiumphones-rc2/apps/app_confbridge.c?view=diff&rev=367968&r1=367967&r2=367968
==============================================================================
--- tags/10.5.0-digiumphones-rc2/apps/app_confbridge.c (original)
+++ tags/10.5.0-digiumphones-rc2/apps/app_confbridge.c Wed May 30 09:32:16 2012
@@ -1144,8 +1144,8 @@
 	struct ast_channel *underlying_channel;
 
 	/* Do not waste resources trying to play files that do not exist */
-	if (!ast_fileexists(filename, NULL, NULL)) {
-		ast_log(LOG_WARNING, "File %s does not exist in any format\n", filename);
+	if (!ast_strlen_zero(filename) && !ast_fileexists(filename, NULL, NULL)) {
+		ast_log(LOG_WARNING, "File %s does not exist in any format\n", !ast_strlen_zero(filename) ? filename : "<unknown>");
 		return 0;
 	}
 
@@ -1165,7 +1165,7 @@
 	/* The channel is all under our control, in goes the prompt */
 	if (!ast_strlen_zero(filename)) {
 		ast_stream_and_wait(conference_bridge->playback_chan, filename, "");
-	} else {
+	} else if (say_number >= 0) {
 		ast_say_number(conference_bridge->playback_chan, say_number, "", conference_bridge->playback_chan->language, NULL);
 	}
 
@@ -1188,7 +1188,7 @@
  */
 static int play_sound_file(struct conference_bridge *conference_bridge, const char *filename)
 {
-	return play_sound_helper(conference_bridge, filename, 0);
+	return play_sound_helper(conference_bridge, filename, -1);
 }
 
 /*!

Modified: tags/10.5.0-digiumphones-rc2/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/tags/10.5.0-digiumphones-rc2/channels/chan_iax2.c?view=diff&rev=367968&r1=367967&r2=367968
==============================================================================
--- tags/10.5.0-digiumphones-rc2/channels/chan_iax2.c (original)
+++ tags/10.5.0-digiumphones-rc2/channels/chan_iax2.c Wed May 30 09:32:16 2012
@@ -1922,24 +1922,25 @@
  *  we have received a destination call number. */
 static int queue_signalling(struct chan_iax2_pvt *pvt, struct ast_frame *f)
 {
-	struct signaling_queue_entry *new;
+	struct signaling_queue_entry *qe;
 
 	if (f->frametype == AST_FRAME_IAX || !pvt->hold_signaling) {
 		return 1; /* do not queue this frame */
-	} else if (!(new = ast_calloc(1, sizeof(struct signaling_queue_entry)))) {
+	} else if (!(qe = ast_calloc(1, sizeof(struct signaling_queue_entry)))) {
 		return -1;  /* out of memory */
 	}
 
-	memcpy(&new->f, f, sizeof(new->f)); /* copy ast_frame into our queue entry */
-
-	if (new->f.datalen) { /* if there is data in this frame copy it over as well */
-		if (!(new->f.data.ptr = ast_calloc(1, new->f.datalen))) {
-			free_signaling_queue_entry(new);
+	/* copy ast_frame into our queue entry */
+	qe->f = *f;
+	if (qe->f.datalen) {
+		/* if there is data in this frame copy it over as well */
+		if (!(qe->f.data.ptr = ast_malloc(qe->f.datalen))) {
+			free_signaling_queue_entry(qe);
 			return -1;
 		}
-		memcpy(new->f.data.ptr, f->data.ptr, sizeof(*new->f.data.ptr));
-	}
-	AST_LIST_INSERT_TAIL(&pvt->signaling_queue, new, next);
+		memcpy(qe->f.data.ptr, f->data.ptr, qe->f.datalen);
+	}
+	AST_LIST_INSERT_TAIL(&pvt->signaling_queue, qe, next);
 
 	return 0;
 }
@@ -4243,6 +4244,15 @@
 	int needfree = 0;
 	struct ast_channel *owner = NULL;
 	struct ast_channel *bridge = NULL;
+
+	/*
+	 * Clear fr->af.data if there is no data in the buffer.  Things
+	 * like AST_CONTROL_HOLD without a suggested music class must
+	 * have a NULL pointer.
+	 */
+	if (!fr->af.datalen) {
+		memset(&fr->af.data, 0, sizeof(fr->af.data));
+	}
 
 	/* Attempt to recover wrapped timestamps */
 	unwrap_timestamp(fr);

Modified: tags/10.5.0-digiumphones-rc2/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/tags/10.5.0-digiumphones-rc2/channels/chan_sip.c?view=diff&rev=367968&r1=367967&r2=367968
==============================================================================
--- tags/10.5.0-digiumphones-rc2/channels/chan_sip.c (original)
+++ tags/10.5.0-digiumphones-rc2/channels/chan_sip.c Wed May 30 09:32:16 2012
@@ -12868,13 +12868,14 @@
 	/* If we have no DNS manager let's do a lookup */
 	if (!mwi->dnsmgr) {
 		char transport[MAXHOSTNAMELEN];
+		struct sip_subscription_mwi *saved;
 		snprintf(transport, sizeof(transport), "_%s._%s", get_srv_service(mwi->transport), get_srv_protocol(mwi->transport));
 
 		mwi->us.ss.ss_family = get_address_family_filter(&bindaddr); /* Filter address family */
-		ASTOBJ_REF(mwi); /* Add a ref for storing the mwi on the dnsmgr for updates */
-		ast_dnsmgr_lookup_cb(mwi->hostname, &mwi->us, &mwi->dnsmgr, sip_cfg.srvlookup ? transport : NULL, on_dns_update_mwi, mwi);
+		saved = ASTOBJ_REF(mwi);
+		ast_dnsmgr_lookup_cb(mwi->hostname, &mwi->us, &mwi->dnsmgr, sip_cfg.srvlookup ? transport : NULL, on_dns_update_mwi, saved);
 		if (!mwi->dnsmgr) {
-			ASTOBJ_UNREF(mwi, sip_subscribe_mwi_destroy); /* dnsmgr disabled, remove reference */
+			ASTOBJ_UNREF(saved, sip_subscribe_mwi_destroy); /* dnsmgr disabled, remove reference */
 		}
 	}
 
@@ -30658,10 +30659,12 @@
 static void sip_send_all_mwi_subscriptions(void)
 {
 	ASTOBJ_CONTAINER_TRAVERSE(&submwil, 1, do {
+		struct sip_subscription_mwi *saved;
 		ASTOBJ_WRLOCK(iterator);
 		AST_SCHED_DEL(sched, iterator->resub);
-		if ((iterator->resub = ast_sched_add(sched, 1, sip_subscribe_mwi_do, ASTOBJ_REF(iterator))) < 0) {
-			ASTOBJ_UNREF(iterator, sip_subscribe_mwi_destroy);
+		saved = ASTOBJ_REF(iterator);
+		if ((iterator->resub = ast_sched_add(sched, 1, sip_subscribe_mwi_do, saved)) < 0) {
+			ASTOBJ_UNREF(saved, sip_subscribe_mwi_destroy);
 		}
 		ASTOBJ_UNLOCK(iterator);
 	} while (0));

Modified: tags/10.5.0-digiumphones-rc2/channels/chan_skinny.c
URL: http://svnview.digium.com/svn/asterisk/tags/10.5.0-digiumphones-rc2/channels/chan_skinny.c?view=diff&rev=367968&r1=367967&r2=367968
==============================================================================
--- tags/10.5.0-digiumphones-rc2/channels/chan_skinny.c (original)
+++ tags/10.5.0-digiumphones-rc2/channels/chan_skinny.c Wed May 30 09:32:16 2012
@@ -3110,6 +3110,10 @@
 	struct skinny_line *l = sub->line;
 	struct skinny_device *d = l->device;
 
+	if (!d) {
+		return;
+	}
+
 	if (!c->caller.id.number.valid
 		|| ast_strlen_zero(c->caller.id.number.str)
 		|| !c->connected.id.number.valid
@@ -4230,6 +4234,11 @@
 	int res = 0;
 	int loop_pause = 100;
 
+	if (!d) {
+		ast_log(LOG_WARNING, "Device for line %s is not registered.\n", l->name);
+		return NULL;
+	}
+
 	ast_verb(3, "Starting simple switch on '%s@%s'\n", l->name, d->name);
 
 	len = strlen(sub->exten);
@@ -4338,7 +4347,7 @@
 	struct ast_var_t *current;
 	int doautoanswer = 0;
 
-	if (!d->registered) {
+	if (!d || !d->registered) {
 		ast_log(LOG_ERROR, "Device not registered, cannot call %s\n", dest);
 		return -1;
 	}
@@ -4737,7 +4746,13 @@
 	struct skinny_subchannel *sub = ast->tech_pvt;
 	struct skinny_line *l = sub->line;
 	struct skinny_device *d = l->device;
-	struct skinnysession *s = d->session;
+	struct skinnysession *s;
+
+	if (!d) {
+		ast_log(LOG_WARNING, "Device for line %s is not registered.\n", l->name);
+		return -1;
+	}
+	s = d->session;
 
 	if (!s) {
 		ast_log(LOG_NOTICE, "Asked to indicate '%s' condition on channel %s, but session does not exist.\n", control2str(ind), ast->name);
@@ -5471,6 +5486,11 @@
 	l = sub->line;
 	d = l->device;
 
+	if (!d) {
+		ast_log(LOG_WARNING, "Device for line %s is not registered.\n", l->name);
+		return -1;
+	}
+
 	if (!sub->related) {
 		/* Another sub has not been created so this must be first XFER press */
 		if (!(sub->substate == SUBSTATE_HOLD)) {
@@ -5514,6 +5534,11 @@
 	struct skinny_line *l = sub->line;
 	struct skinny_device *d = l->device;
 	struct ast_channel *c = sub->owner;
+
+	if (!d) {
+		ast_log(LOG_WARNING, "Device for line %s is not registered.\n", l->name);
+		return 0;
+	}
 
 	if (d->hookstate == SKINNY_ONHOOK) {
 		d->hookstate = SKINNY_OFFHOOK;




More information about the svn-commits mailing list