[asterisk-commits] mjordan: branch certified-11.6 r402382 - in /certified/branches/11.6: ./ incl...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Nov 1 15:39:02 CDT 2013


Author: mjordan
Date: Fri Nov  1 15:39:00 2013
New Revision: 402382

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=402382
Log:
Multiple revisions 396884,400075,400093,401446,401960

........
  r396884 | jbigelow | 2013-08-16 17:45:10 -0500 (Fri, 16 Aug 2013) | 8 lines
  
  Add test suite events to indicate when a feature is detected or not
  
  These are needed by the bridge test suite tests for them to be able to run
  against Asterisk 11.
  
  Review: https://reviewboard.asterisk.org/r/2751/
........
  r400075 | mjordan | 2013-09-28 16:59:12 -0500 (Sat, 28 Sep 2013) | 16 lines
  
  Add check for openSUSE when detecting bfd library
  
  In ASTERISK-17842, some additional library checks were added to the configure
  script so that the bfd library could be found on CentOS and Fedora systems.
  
  As it turns out, openSUSE requires an additional library. This patch adds
  another check to the configure script for openSUSE that will add that library.
  
  Review: https://reviewboard.asterisk.org/r/2885/
  
  (closes issue AST-1169)
  Reported by: Guenther Kelleter
  ........
  
  Merged revisions 400073 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
  r400093 | mjordan | 2013-09-28 17:21:37 -0500 (Sat, 28 Sep 2013) | 23 lines
  
  res_rtp_asterisk: Correct erroneous lost packet information in RTCP reports
  
  RTCP's calculation of the number of lost packets in an RTP stream is based on
  that stream's sequence number count, the number of received packets, and how
  many packets we expect to receive. When the SSRC for an RTP stream changes,
  there can - and almost always will be - a large jump in the next packet's
  timestamp and sequence number. If we don't reset the number of received
  packets, sequence number count, and other metrics used by RTCP, the next RR/SR
  report will use the previous SSRC's values to calculate the lost packet count
  for the new SSRC - resulting in a very large number of lost packets.
  
  This patch modifies res_rtp_asterisk such that, if it detects a SSRC change, it
  will reset the various values used by the RTCP calculations. From the
  perspective of RTCP, this appears as a new media stream - which is what it is.
  
  Review: https://reviewboard.asterisk.org/r/2886/
  
  (closes issue AST-1174)
  Reported by: Thomas Arimont
  ........
  
  Merged revisions 400089 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
  r401446 | mjordan | 2013-10-22 17:42:24 -0500 (Tue, 22 Oct 2013) | 15 lines
  
  res_rtp_asterisk: Fix crash when RTCP is not available during SSRC change
  
  In r400089, a patch was put in to correct erroneous RTCP statistic resets.
  Unfortunately, ast_rtp_read can be called on an RTP instance that does not
  have RTCP information. This patch prevents that crash by only resetting
  the statistics if we do actually have an RTCP instance.
  
  (issue AST-1174)
  
  (closes issue ASTERISK-22667)
  Reported by: John Bigelow
  ........
  
  Merged revisions 401445 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
  r401960 | sgriepentrog | 2013-10-25 15:44:40 -0500 (Fri, 25 Oct 2013) | 15 lines
  
  pbx.c: fix confused match caller id that deleted exten still in hash
  
  This fixes a bug where a zero length callerid match adjacent to a no
  match callerid extension entry would be deleted together, which then
  resulted in hashtable references to free'd memory.  A third state of
  the matchcid value has been added to indicate match to any extension
  which allows enforcing comparison of matchcid on/off without errors.
  
  (closes issue AST-1235)
  Reported by: Guenther Kelleter
  Review: https://reviewboard.asterisk.org/r/2930/
  ........
  
  Merged revisions 401959 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 396884,400075,400093,401446,401960 from http://svn.asterisk.org/svn/asterisk/branches/11

Modified:
    certified/branches/11.6/   (props changed)
    certified/branches/11.6/configure
    certified/branches/11.6/configure.ac
    certified/branches/11.6/include/asterisk/pbx.h
    certified/branches/11.6/main/pbx.c
    certified/branches/11.6/res/res_rtp_asterisk.c

Propchange: certified/branches/11.6/
------------------------------------------------------------------------------
--- branch-11-merged (original)
+++ branch-11-merged Fri Nov  1 15:39:00 2013
@@ -1,1 +1,1 @@
-/branches/11:
+/branches/11:399513,396884,400075-400093,401446,401960

Modified: certified/branches/11.6/configure.ac
URL: http://svnview.digium.com/svn/asterisk/certified/branches/11.6/configure.ac?view=diff&rev=402382&r1=402381&r2=402382
==============================================================================
--- certified/branches/11.6/configure.ac (original)
+++ certified/branches/11.6/configure.ac Fri Nov  1 15:39:00 2013
@@ -1217,6 +1217,11 @@
   AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_check_format], [bfd.h], [-ldl -liberty])
 fi
 
+if test "${PBX_BFD}" = "0"; then
+  # openSUSE requires -lz
+  AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_check_format], [bfd.h], [-ldl -liberty -lz])
+fi
+
 if test "x${OSARCH}" = "xlinux-gnu" ; then
   AST_EXT_LIB_CHECK([CAP], [cap], [cap_from_text], [sys/capability.h])
 fi

Modified: certified/branches/11.6/include/asterisk/pbx.h
URL: http://svnview.digium.com/svn/asterisk/certified/branches/11.6/include/asterisk/pbx.h?view=diff&rev=402382&r1=402381&r2=402382
==============================================================================
--- certified/branches/11.6/include/asterisk/pbx.h (original)
+++ certified/branches/11.6/include/asterisk/pbx.h Fri Nov  1 15:39:00 2013
@@ -69,6 +69,16 @@
 	AST_EXTENSION_ONHOLD = 1 << 4,	/*!< All devices ONHOLD */
 };
 
+/*!
+ * \brief extension matchcid types
+ * \note matchcid in ast_exten retains 0/1, this adds 3rd state for functions to specify all
+ * \see ast_context_remove_extension_callerid
+ */
+enum ast_ext_matchcid_types {
+	AST_EXT_MATCHCID_OFF = 0,	/*!< Match only extensions with matchcid=0 */
+	AST_EXT_MATCHCID_ON = 1,	/*!< Match only extensions with matchcid=1 AND cidmatch matches */
+	AST_EXT_MATCHCID_ANY = 2,	/*!< Match both - used only in functions manipulating ast_exten's */
+};
 
 struct ast_context;
 struct ast_exten;

Modified: certified/branches/11.6/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/certified/branches/11.6/main/pbx.c?view=diff&rev=402382&r1=402381&r2=402382
==============================================================================
--- certified/branches/11.6/main/pbx.c (original)
+++ certified/branches/11.6/main/pbx.c Fri Nov  1 15:39:00 2013
@@ -1239,13 +1239,22 @@
 	}
 
 	/* but if they are the same, do the cidmatch values match? */
-	if (ac->matchcid && bc->matchcid) {
-		return strcmp(ac->cidmatch,bc->cidmatch);
-	} else if (!ac->matchcid && !bc->matchcid) {
-		return 0; /* if there's no matchcid on either side, then this is a match */
-	} else {
-		return 1; /* if there's matchcid on one but not the other, they are different */
-	}
+	/* not sure which side may be using ast_ext_matchcid_types, so check both */
+	if (ac->matchcid == AST_EXT_MATCHCID_ANY || bc->matchcid == AST_EXT_MATCHCID_ANY) {
+		return 0;
+	}
+	if (ac->matchcid == AST_EXT_MATCHCID_OFF && bc->matchcid == AST_EXT_MATCHCID_OFF) {
+		return 0;
+	}
+	if (ac->matchcid != bc->matchcid) {
+		return 1;
+	}
+	/* all other cases already disposed of, match now required on callerid string (cidmatch) */
+	/* although ast_add_extension2_lockopt() enforces non-zero ptr, caller may not have */
+	if (ast_strlen_zero(ac->cidmatch) && ast_strlen_zero(bc->cidmatch)) {
+		return 0;
+	}
+	return strcmp(ac->cidmatch, bc->cidmatch);
 }
 
 static int hashtab_compare_exten_numbers(const void *ah_a, const void *ah_b)
@@ -1273,7 +1282,7 @@
 	const struct ast_exten *ac = obj;
 	unsigned int x = ast_hashtab_hash_string(ac->exten);
 	unsigned int y = 0;
-	if (ac->matchcid)
+	if (ac->matchcid == AST_EXT_MATCHCID_ON)
 		y = ast_hashtab_hash_string(ac->cidmatch);
 	return x+y;
 }
@@ -1459,7 +1468,7 @@
 				ast_copy_string(dummy_name, e1->exten, sizeof(dummy_name));
 				e2 = ast_hashtab_lookup(c1->root_table, &ex);
 				if (!e2) {
-					if (e1->matchcid) {
+					if (e1->matchcid == AST_EXT_MATCHCID_ON) {
 						ast_log(LOG_NOTICE,"Called from: %s:%d: The %s context records the exten %s (CID match: %s) but it is not in its root_table\n", file, line, c2->name, dummy_name, e1->cidmatch );
 					} else {
 						ast_log(LOG_NOTICE,"Called from: %s:%d: The %s context records the exten %s but it is not in its root_table\n", file, line, c2->name, dummy_name );
@@ -6828,7 +6837,7 @@
 /*! \note This function will lock conlock. */
 int ast_context_remove_extension(const char *context, const char *extension, int priority, const char *registrar)
 {
-	return ast_context_remove_extension_callerid(context, extension, priority, NULL, 0, registrar);
+	return ast_context_remove_extension_callerid(context, extension, priority, NULL, AST_EXT_MATCHCID_ANY, registrar);
 }
 
 int ast_context_remove_extension_callerid(const char *context, const char *extension, int priority, const char *callerid, int matchcallerid, const char *registrar)
@@ -6858,7 +6867,7 @@
  */
 int ast_context_remove_extension2(struct ast_context *con, const char *extension, int priority, const char *registrar, int already_locked)
 {
-	return ast_context_remove_extension_callerid2(con, extension, priority, NULL, 0, registrar, already_locked);
+	return ast_context_remove_extension_callerid2(con, extension, priority, NULL, AST_EXT_MATCHCID_ANY, registrar, already_locked);
 }
 
 int ast_context_remove_extension_callerid2(struct ast_context *con, const char *extension, int priority, const char *callerid, int matchcallerid, const char *registrar, int already_locked)
@@ -6874,10 +6883,6 @@
 	if (!already_locked)
 		ast_wrlock_context(con);
 
-	/* Handle this is in the new world */
-
-	/* FIXME For backwards compatibility, if callerid==NULL, then remove ALL
-	 * peers, not just those matching the callerid. */
 #ifdef NEED_DEBUG
 	ast_verb(3,"Removing %s/%s/%d%s%s from trees, registrar=%s\n", con->name, extension, priority, matchcallerid ? "/" : "", matchcallerid ? callerid : "", registrar);
 #endif
@@ -6886,7 +6891,7 @@
 #endif
 	/* find this particular extension */
 	ex.exten = dummy_name;
-	ex.matchcid = matchcallerid && !ast_strlen_zero(callerid); /* don't say match if there's no callerid */
+	ex.matchcid = matchcallerid;
 	ex.cidmatch = callerid;
 	ast_copy_string(dummy_name, extension, sizeof(dummy_name));
 	exten = ast_hashtab_lookup(con->root_table, &ex);
@@ -6909,7 +6914,6 @@
 			ex.priority = priority;
 			exten2 = ast_hashtab_lookup(exten->peer_table, &ex);
 			if (exten2) {
-
 				if (exten2->label) { /* if this exten has a label, remove that, too */
 					exten3 = ast_hashtab_remove_this_object(exten->peer_label_table,exten2);
 					if (!exten3)
@@ -6970,10 +6974,11 @@
 
 	/* scan the priority list to remove extension with exten->priority == priority */
 	for (peer = exten, next_peer = exten->peer ? exten->peer : exten->next;
-		 peer && !strcmp(peer->exten, extension) && (!matchcallerid || (!ast_strlen_zero(callerid) && !ast_strlen_zero(peer->cidmatch) && !strcmp(peer->cidmatch,callerid)) || (ast_strlen_zero(callerid) && ast_strlen_zero(peer->cidmatch)));
+		 peer && !strcmp(peer->exten, extension) &&
+			(!callerid || (!matchcallerid && !peer->matchcid) || (matchcallerid && peer->matchcid && !strcmp(peer->cidmatch, callerid))) ;
 			peer = next_peer, next_peer = next_peer ? (next_peer->peer ? next_peer->peer : next_peer->next) : NULL) {
+
 		if ((priority == 0 || peer->priority == priority) &&
-				(!callerid || !matchcallerid || (matchcallerid && !strcmp(peer->cidmatch, callerid))) &&
 				(!registrar || !strcmp(peer->registrar, registrar) )) {
 			found = 1;
 
@@ -7004,6 +7009,7 @@
 				previous_peer->peer = peer->peer;
 			}
 
+
 			/* now, free whole priority extension */
 			destroy_exten(peer);
 		} else {
@@ -7683,7 +7689,7 @@
 			dpc->total_prio++;
 
 			/* write extension name and first peer */
-			if (e->matchcid)
+			if (e->matchcid == AST_EXT_MATCHCID_ON)
 				snprintf(buf, sizeof(buf), "'%s' (CID match '%s') => ", ast_get_extension_name(e), e->cidmatch);
 			else
 				snprintf(buf, sizeof(buf), "'%s' =>", ast_get_extension_name(e));
@@ -9853,10 +9859,10 @@
 	/* Blank callerid and NULL callerid are two SEPARATE things.  Do NOT confuse the two!!! */
 	if (callerid) {
 		p += ext_strncpy(p, callerid, strlen(callerid) + 1) + 1;
-		tmp->matchcid = 1;
+		tmp->matchcid = AST_EXT_MATCHCID_ON;
 	} else {
 		*p++ = '\0';
-		tmp->matchcid = 0;
+		tmp->matchcid = AST_EXT_MATCHCID_OFF;
 	}
 	tmp->app = p;
 	strcpy(p, application);
@@ -9873,7 +9879,7 @@
 								an extension, and the trie exists, then we need to incrementally add this pattern to it. */
 		ast_copy_string(dummy_name, extension, sizeof(dummy_name));
 		dummy_exten.exten = dummy_name;
-		dummy_exten.matchcid = 0;
+		dummy_exten.matchcid = AST_EXT_MATCHCID_OFF;
 		dummy_exten.cidmatch = 0;
 		tmp2 = ast_hashtab_lookup(con->root_table, &dummy_exten);
 		if (!tmp2) {
@@ -9886,11 +9892,11 @@
 	for (e = con->root; e; el = e, e = e->next) {   /* scan the extension list */
 		res = ext_cmp(e->exten, tmp->exten);
 		if (res == 0) { /* extension match, now look at cidmatch */
-			if (!e->matchcid && !tmp->matchcid)
+			if (e->matchcid == AST_EXT_MATCHCID_OFF && tmp->matchcid == AST_EXT_MATCHCID_OFF)
 				res = 0;
-			else if (tmp->matchcid && !e->matchcid)
+			else if (tmp->matchcid == AST_EXT_MATCHCID_ON && e->matchcid == AST_EXT_MATCHCID_OFF)
 				res = 1;
-			else if (e->matchcid && !tmp->matchcid)
+			else if (e->matchcid == AST_EXT_MATCHCID_ON && tmp->matchcid == AST_EXT_MATCHCID_OFF)
 				res = -1;
 			else
 				res = ext_cmp(e->cidmatch, tmp->cidmatch);
@@ -9967,7 +9973,7 @@
 		}
 	}
 	if (option_debug) {
-		if (tmp->matchcid) {
+		if (tmp->matchcid == AST_EXT_MATCHCID_ON) {
 			ast_debug(1, "Added extension '%s' priority %d (CID match '%s') to %s (%p)\n",
 					  tmp->exten, tmp->priority, tmp->cidmatch, con->name, con);
 		} else {
@@ -9976,7 +9982,7 @@
 		}
 	}
 
-	if (tmp->matchcid) {
+	if (tmp->matchcid == AST_EXT_MATCHCID_ON) {
 		ast_verb(3, "Added extension '%s' priority %d (CID match '%s') to %s\n",
 				 tmp->exten, tmp->priority, tmp->cidmatch, con->name);
 	} else {
@@ -10598,12 +10604,11 @@
 						}
 						ast_verb(3, "Remove %s/%s/%d, registrar=%s; con=%s(%p); con->root=%p\n",
 								 tmp->name, prio_item->exten, prio_item->priority, registrar, con? con->name : "<nil>", con, con? con->root_table: NULL);
-						/* set matchcid to 1 to insure we get a direct match, and NULL registrar to make sure no wildcarding is done */
 						ast_copy_string(extension, prio_item->exten, sizeof(extension));
 						if (prio_item->cidmatch) {
 							ast_copy_string(cidmatch, prio_item->cidmatch, sizeof(cidmatch));
 						}
-						end_traversal &= ast_context_remove_extension_callerid2(tmp, extension, prio_item->priority, prio_item->cidmatch ? cidmatch : NULL, 1, NULL, 1);
+						end_traversal &= ast_context_remove_extension_callerid2(tmp, extension, prio_item->priority, cidmatch, prio_item->matchcid, NULL, 1);
 					}
 					/* Explanation:
 					 * ast_context_remove_extension_callerid2 will destroy the extension that it comes across. This

Modified: certified/branches/11.6/res/res_rtp_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/certified/branches/11.6/res/res_rtp_asterisk.c?view=diff&rev=402382&r1=402381&r2=402382
==============================================================================
--- certified/branches/11.6/res/res_rtp_asterisk.c (original)
+++ certified/branches/11.6/res/res_rtp_asterisk.c Fri Nov  1 15:39:00 2013
@@ -3654,8 +3654,16 @@
 		f = ast_frisolate(&srcupdate);
 		AST_LIST_INSERT_TAIL(&frames, f, frame_list);
 
+		rtp->seedrxseqno = 0;
+		rtp->rxcount = 0;
+		rtp->cycles = 0;
+		rtp->lastrxseqno = 0;
 		rtp->last_seqno = 0;
 		rtp->last_end_timestamp = 0;
+		if (rtp->rtcp) {
+			rtp->rtcp->expected_prior = 0;
+			rtp->rtcp->received_prior = 0;
+		}
 	}
 
 	rtp->rxssrc = ssrc;




More information about the asterisk-commits mailing list