[svn-commits] kmoore: trunk r330707 - in /trunk: ./ channels/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Aug 3 08:40:27 CDT 2011


Author: kmoore
Date: Wed Aug  3 08:40:22 2011
New Revision: 330707

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=330707
Log:
Merged revisions 330706 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r330706 | kmoore | 2011-08-03 08:39:06 -0500 (Wed, 03 Aug 2011) | 17 lines
  
  Merged revisions 330705 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r330705 | kmoore | 2011-08-03 08:38:17 -0500 (Wed, 03 Aug 2011) | 10 lines
    
    Call pickup broken for DAHDI channels when beginning with #
    
    The call pickup feature did not work on DAHDI devices for anything other than
    feature codes beginning with * since all feature codes in chan_dahdi were
    originally hard-coded to begin with *.  This patch is also applied to
    chan_dahdi.c to fix this bug with radio modes.
    
    (closes issue AST-621)
    Review: https://reviewboard.asterisk.org/r/1336/
  ........
................

Modified:
    trunk/   (props changed)
    trunk/channels/chan_dahdi.c
    trunk/channels/sig_analog.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-10-merged' - no diff available.

Modified: trunk/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_dahdi.c?view=diff&rev=330707&r1=330706&r2=330707
==============================================================================
--- trunk/channels/chan_dahdi.c (original)
+++ trunk/channels/chan_dahdi.c Wed Aug  3 08:40:22 2011
@@ -9772,6 +9772,33 @@
 	return 0;
 }
 
+static int canmatch_featurecode(const char *exten)
+{
+	int extlen = strlen(exten);
+	const char *pickup_ext;
+	if (!extlen) {
+		return 1;
+	}
+	pickup_ext = ast_pickup_ext();
+	if (extlen < strlen(pickup_ext) && !strncmp(pickup_ext, exten, extlen)) {
+		return 1;
+	}
+	/* hardcoded features are *60, *67, *69, *70, *72, *73, *78, *79, *82, *0 */
+	if (exten[0] == '*' && extlen < 3) {
+		if (extlen == 1) {
+			return 1;
+		}
+		/* "*0" should be processed before it gets here */
+		switch (exten[1]) {
+		case '6':
+		case '7':
+		case '8':
+			return 1;
+		}
+	}
+	return 0;
+}
+
 static void *analog_ss_thread(void *data)
 {
 	struct ast_channel *chan = data;
@@ -10316,7 +10343,7 @@
 				}
 			} else if (!ast_canmatch_extension(chan, chan->context, exten, 1,
 				S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))
-				&& ((exten[0] != '*') || (strlen(exten) > 2))) {
+				&& !canmatch_featurecode(exten)) {
 				ast_debug(1, "Can't match %s from '%s' in context %s\n", exten,
 					S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, "<Unknown Caller>"),
 					chan->context);

Modified: trunk/channels/sig_analog.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/sig_analog.c?view=diff&rev=330707&r1=330706&r2=330707
==============================================================================
--- trunk/channels/sig_analog.c (original)
+++ trunk/channels/sig_analog.c Wed Aug  3 08:40:22 2011
@@ -1701,6 +1701,33 @@
 }
 
 #define ANALOG_NEED_MFDETECT(p) (((p)->sig == ANALOG_SIG_FEATDMF) || ((p)->sig == ANALOG_SIG_FEATDMF_TA) || ((p)->sig == ANALOG_SIG_E911) || ((p)->sig == ANALOG_SIG_FGC_CAMA) || ((p)->sig == ANALOG_SIG_FGC_CAMAMF) || ((p)->sig == ANALOG_SIG_FEATB))
+
+static int analog_canmatch_featurecode(const char *exten)
+{
+	int extlen = strlen(exten);
+	const char *pickup_ext;
+	if (!extlen) {
+		return 1;
+	}
+	pickup_ext = ast_pickup_ext();
+	if (extlen < strlen(pickup_ext) && !strncmp(pickup_ext, exten, extlen)) {
+		return 1;
+	}
+	/* hardcoded features are *60, *67, *69, *70, *72, *73, *78, *79, *82, *0 */
+	if (exten[0] == '*' && extlen < 3) {
+		if (extlen == 1) {
+			return 1;
+		}
+		/* "*0" should be processed before it gets here */
+		switch (exten[1]) {
+		case '6':
+		case '7':
+		case '8':
+			return 1;
+		}
+	}
+	return 0;
+}
 
 static void *__analog_ss_thread(void *data)
 {
@@ -2296,7 +2323,7 @@
 				}
 			} else if (!ast_canmatch_extension(chan, chan->context, exten, 1,
 				chan->caller.id.number.valid ? chan->caller.id.number.str : NULL)
-				&& ((exten[0] != '*') || (strlen(exten) > 2))) {
+				&& !analog_canmatch_featurecode(exten)) {
 				ast_debug(1, "Can't match %s from '%s' in context %s\n", exten,
 					chan->caller.id.number.valid && chan->caller.id.number.str
 						? chan->caller.id.number.str : "<Unknown Caller>",




More information about the svn-commits mailing list