aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authordbrooks <dbrooks@f38db490-d61c-443f-a65b-d21fe96a405b>2009-08-03 16:15:20 +0000
committerdbrooks <dbrooks@f38db490-d61c-443f-a65b-d21fe96a405b>2009-08-03 16:15:20 +0000
commit292f57129a8a1a4ecf9d5bb5d417147a690c2459 (patch)
treeae192d370e5409031b3c791adb3ad047cc6f299a /channels
parent728babbe04baf27f4cc76f59c6414f8ab1798405 (diff)
Fixes dialplan wildcard extension taking precedence over call pickup code.
Prior to this patch, a wildcard extension in the dialplan (for example, _*.) would take precedence over picking up a call in the channel's pickup group. This patch simply moves the block of code handling pickup group matching to above the extension matching code. (closes issue #14735) Reported by: stevedavies Review: https://reviewboard.asterisk.org/r/319/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@210067 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_dahdi.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index 8252d3f1b..6f0fb10a1 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -6264,7 +6264,35 @@ static void *ss_thread(void *data)
tone_zone_play_tone(p->subs[index].dfd, -1);
else
tone_zone_play_tone(p->subs[index].dfd, DAHDI_TONE_DIALTONE);
- if (ast_exists_extension(chan, chan->context, exten, 1, p->cid_num) && strcmp(exten, ast_parking_ext())) {
+ if (!strcmp(exten,ast_pickup_ext())) {
+ /* Scan all channels and see if there are any
+ * ringing channels that have call groups
+ * that equal this channels pickup group
+ */
+ if (index == SUB_REAL) {
+ /* Switch us from Third call to Call Wait */
+ if (p->subs[SUB_THREEWAY].owner) {
+ /* If you make a threeway call and the *8# a call, it should actually
+ look like a callwait */
+ alloc_sub(p, SUB_CALLWAIT);
+ swap_subs(p, SUB_CALLWAIT, SUB_THREEWAY);
+ unalloc_sub(p, SUB_THREEWAY);
+ }
+ dahdi_enable_ec(p);
+ if (ast_pickup_call(chan)) {
+ ast_log(LOG_DEBUG, "No call pickup possible...\n");
+ res = tone_zone_play_tone(p->subs[index].dfd, DAHDI_TONE_CONGESTION);
+ dahdi_wait_event(p->subs[index].dfd);
+ }
+ ast_hangup(chan);
+ goto quit;
+ } else {
+ ast_log(LOG_WARNING, "Huh? Got *8# on call not on real\n");
+ ast_hangup(chan);
+ goto quit;
+ }
+
+ } else if (ast_exists_extension(chan, chan->context, exten, 1, p->cid_num) && strcmp(exten, ast_parking_ext())) {
if (!res || !ast_matchmore_extension(chan, chan->context, exten, 1, p->cid_num)) {
if (getforward) {
/* Record this as the forwarding extension */
@@ -6329,34 +6357,6 @@ static void *ss_thread(void *data)
memset(exten, 0, sizeof(exten));
timeout = firstdigittimeout;
- } else if (!strcmp(exten,ast_pickup_ext())) {
- /* Scan all channels and see if there are any
- * ringing channels that have call groups
- * that equal this channels pickup group
- */
- if (index == SUB_REAL) {
- /* Switch us from Third call to Call Wait */
- if (p->subs[SUB_THREEWAY].owner) {
- /* If you make a threeway call and the *8# a call, it should actually
- look like a callwait */
- alloc_sub(p, SUB_CALLWAIT);
- swap_subs(p, SUB_CALLWAIT, SUB_THREEWAY);
- unalloc_sub(p, SUB_THREEWAY);
- }
- dahdi_enable_ec(p);
- if (ast_pickup_call(chan)) {
- ast_log(LOG_DEBUG, "No call pickup possible...\n");
- res = tone_zone_play_tone(p->subs[index].dfd, DAHDI_TONE_CONGESTION);
- dahdi_wait_event(p->subs[index].dfd);
- }
- ast_hangup(chan);
- goto quit;
- } else {
- ast_log(LOG_WARNING, "Huh? Got *8# on call not on real\n");
- ast_hangup(chan);
- goto quit;
- }
-
} else if (!p->hidecallerid && !strcmp(exten, "*67")) {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Disabling Caller*ID on %s\n", chan->name);