[svn-commits] rmudgett: branch group/issue14068 r211474 - in /team/group/issue14068: ./ cha...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Aug 10 12:57:06 CDT 2009


Author: rmudgett
Date: Mon Aug 10 12:57:01 2009
New Revision: 211474

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=211474
Log:
Merged revisions 211390,211392,211435 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r211390 | russell | 2009-08-10 10:46:39 -0500 (Mon, 10 Aug 2009) | 13 lines
  
  Fix up some issues with getting a channel by "name".
  
  Even though the get_channel_by_name() API advertised that you could search by
  name or uniqueid (just as the old API did), searching by uniqueid was not
  actually implemented.  This patch fixes that problem.
  
  The ast_channel_get_full() function now makes a second search attempt by
  uniqueid if the parameter was a name.  The channel comparison function also
  now knows how to compare by unqieueid.
  
  Finally, a bug was fixed in passing where OBJ_POINTER was being passed in some
  scenarios where it should not have been.
........
  r211392 | rmudgett | 2009-08-10 10:53:23 -0500 (Mon, 10 Aug 2009) | 5 lines
  
  Restoring some code to sig_pri.  Not sure if it is really needed.
  
  Putting some DSP code back into sig_pri that was removed by the
  chan_dahdi/sig_pri reorganization.
........
  r211435 | jpeeler | 2009-08-10 12:17:06 -0500 (Mon, 10 Aug 2009) | 3 lines
  
  Fix PRI/BRI channels when in alarm condition to only be marked for hangup if 
  T309 is not enabled.
........

Modified:
    team/group/issue14068/   (props changed)
    team/group/issue14068/channels/chan_dahdi.c
    team/group/issue14068/channels/sig_pri.c
    team/group/issue14068/channels/sig_pri.h
    team/group/issue14068/main/channel.c

Propchange: team/group/issue14068/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/group/issue14068/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Aug 10 12:57:01 2009
@@ -1,1 +1,1 @@
-/trunk:1-211361
+/trunk:1-211473

Modified: team/group/issue14068/channels/chan_dahdi.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/issue14068/channels/chan_dahdi.c?view=diff&rev=211474&r1=211473&r2=211474
==============================================================================
--- team/group/issue14068/channels/chan_dahdi.c (original)
+++ team/group/issue14068/channels/chan_dahdi.c Mon Aug 10 12:57:01 2009
@@ -2614,6 +2614,7 @@
 	.handle_dchan_exception = my_handle_dchan_exception,
 	.play_tone = my_pri_play_tone,
 	.set_echocanceller = my_set_echocanceller,
+	.dsp_reset_and_flush_digits = my_dsp_reset_and_flush_digits,
 	.lock_private = my_lock_private,
 	.unlock_private = my_unlock_private,
 	.new_ast_channel = my_new_pri_ast_channel,
@@ -6562,9 +6563,6 @@
 			if (p->sig == SIG_PRI || p->sig == SIG_BRI || p->sig == SIG_BRI_PTMP) {
 				sig_pri_chan_alarm_notify(p->sig_pvt, 0);
 
-			} else {
-				if (p->owner)
-					p->owner->_softhangup |= AST_SOFTHANGUP_DEV;
 			}
 #endif
 		p->inalarm = 1;
@@ -8040,9 +8038,9 @@
 				i->dsp = NULL;
 			if (i->dsp) {
 				i->dsp_features = features;
-#if defined(HAVE_SS7)
-				/* We cannot do progress detection until receives PROGRESS message */
-				if (i->outgoing && (i->sig == SIG_SS7)) {
+#if defined(HAVE_PRI) || defined(HAVE_SS7)
+				/* We cannot do progress detection until receive PROGRESS message */
+				if (i->outgoing && ((i->sig == SIG_PRI) || (i->sig == SIG_BRI) || (i->sig == SIG_BRI_PTMP) || (i->sig == SIG_SS7))) {
 					/* Remember requested DSP features, don't treat
 					   talking as ANSWER */
 					i->dsp_features = features & ~DSP_PROGRESS_TALK;

Modified: team/group/issue14068/channels/sig_pri.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/issue14068/channels/sig_pri.c?view=diff&rev=211474&r1=211473&r2=211474
==============================================================================
--- team/group/issue14068/channels/sig_pri.c (original)
+++ team/group/issue14068/channels/sig_pri.c Mon Aug 10 12:57:01 2009
@@ -497,6 +497,22 @@
 	pri_redirecting_update(pvt->pri->pri, pvt->call, &pri_redirecting);
 }
 
+/*!
+ * \internal
+ * \brief Reset DTMF detector.
+ * \since 1.6.3
+ *
+ * \param p sig_pri channel structure.
+ *
+ * \return Nothing
+ */
+static void sig_pri_dsp_reset_and_flush_digits(struct sig_pri_chan *p)
+{
+	if (p->calls->dsp_reset_and_flush_digits) {
+		p->calls->dsp_reset_and_flush_digits(p->chan_pvt);
+	}
+}
+
 static int sig_pri_set_echocanceller(struct sig_pri_chan *p, int enable)
 {
 	if (p->calls->set_echocanceller)
@@ -899,6 +915,8 @@
 	}
 
 	ast_verb(3, "Starting simple switch on '%s'\n", chan->name);
+
+	sig_pri_dsp_reset_and_flush_digits(p);
 
 	/* Now loop looking for an extension */
 	ast_copy_string(exten, p->exten, sizeof(exten));
@@ -939,6 +957,7 @@
 	if (ast_exists_extension(chan, chan->context, exten, 1, p->cid_num)) {
 		/* Start the real PBX */
 		ast_copy_string(chan->exten, exten, sizeof(chan->exten));
+		sig_pri_dsp_reset_and_flush_digits(p);
 		sig_pri_set_echocanceller(p, 1);
 		ast_setstate(chan, AST_STATE_RING);
 		res = ast_pbx_run(chan);
@@ -2964,12 +2983,11 @@
 					} else
 						ast_log(LOG_WARNING, "Failed to grab PRI!\n");
 				} else
-					ast_log(LOG_WARNING, "Failed to grab PRI!\n");
-			} else
-				ast_log(LOG_WARNING, "The PRI Call has not been destroyed\n");
-		}
-		if (p->owner)
-			ast_softhangup_nolock(p->owner, AST_SOFTHANGUP_DEV);
+					ast_log(LOG_WARNING, "The PRI Call has not been destroyed\n");
+			}
+			if (p->owner)
+				ast_softhangup_nolock(p->owner, AST_SOFTHANGUP_DEV);
+		}
 	} else {
 		p->inalarm = 0;
 	}

Modified: team/group/issue14068/channels/sig_pri.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/issue14068/channels/sig_pri.h?view=diff&rev=211474&r1=211473&r2=211474
==============================================================================
--- team/group/issue14068/channels/sig_pri.h (original)
+++ team/group/issue14068/channels/sig_pri.h Mon Aug 10 12:57:01 2009
@@ -63,6 +63,7 @@
 
 	int (* const set_echocanceller)(void *pvt, int enable);
 	int (* const train_echocanceller)(void *pvt);
+	int (* const dsp_reset_and_flush_digits)(void *pvt);
 
 	struct ast_channel * (* const new_ast_channel)(void *pvt, int state, int startpbx, enum sig_pri_law law, int transfercapability, char *exten, const struct ast_channel *chan);
 

Modified: team/group/issue14068/main/channel.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/issue14068/main/channel.c?view=diff&rev=211474&r1=211473&r2=211474
==============================================================================
--- team/group/issue14068/main/channel.c (original)
+++ team/group/issue14068/main/channel.c Mon Aug 10 12:57:01 2009
@@ -1377,6 +1377,7 @@
 		 * gets changed, then the compare callback must be changed, too. */
 		.rings = name_len,
 	};
+	struct ast_channel *chan;
 
 	if (exten) {
 		ast_copy_string(tmp_chan.exten, exten, sizeof(tmp_chan.exten));
@@ -1386,7 +1387,25 @@
 		ast_copy_string(tmp_chan.context, context, sizeof(tmp_chan.context));
 	}
 
-	return ao2_find(channels, &tmp_chan, OBJ_POINTER);
+	if ((chan = ao2_find(channels, &tmp_chan, !ast_strlen_zero(name) ? OBJ_POINTER : 0))) {
+		return chan;
+	}
+
+	if (!name) {
+		return NULL;
+	}
+
+	/* If name was specified, but the result was NULL, 
+	 * try a search on uniqueid, instead. */
+
+	{
+		struct ast_channel tmp_chan2 = {
+			.uniqueid = name,
+			.rings = name_len,
+		};
+
+		return ao2_find(channels, &tmp_chan2, 0);
+	}
 }
 
 struct ast_channel *ast_channel_get_by_name(const char *name)
@@ -6228,6 +6247,11 @@
 				strcasecmp(chan->macroexten, cmp_args->exten)) {
 			ret = 0; /* exten match failed */
 		}
+	} else if (cmp_args->uniqueid) {
+		if ((!name_len && strcasecmp(chan->uniqueid, cmp_args->uniqueid)) ||
+				(name_len && strncasecmp(chan->uniqueid, cmp_args->uniqueid, name_len))) {
+			ret = 0; /* uniqueid match failed */
+		}
 	}
 
 	ast_channel_unlock(chan);




More information about the svn-commits mailing list