diff options
author | Kinsey Moore <kmoore@digium.com> | 2011-08-03 13:40:22 +0000 |
---|---|---|
committer | Kinsey Moore <kmoore@digium.com> | 2011-08-03 13:40:22 +0000 |
commit | db3d1134142f6339746bd17dad551b1ea349f4c7 (patch) | |
tree | 4e13ee3bf0b372f7bd718909b0aa0a17105cb90e /channels/chan_dahdi.c | |
parent | ed6ac7359f831dc554d9a41eb0318057de79522c (diff) |
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/
........
................
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@330707 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_dahdi.c')
-rw-r--r-- | channels/chan_dahdi.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index b80b1b1e8..81a9ce06c 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -9772,6 +9772,33 @@ static int dahdi_dnd(struct dahdi_pvt *dahdichan, int flag) 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 @@ static void *analog_ss_thread(void *data) } } 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); |