[asterisk-commits] dbrooks: branch 1.4 r210067 - /branches/1.4/channels/chan_dahdi.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Aug 3 11:15:24 CDT 2009
Author: dbrooks
Date: Mon Aug 3 11:15:20 2009
New Revision: 210067
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=210067
Log:
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/
Modified:
branches/1.4/channels/chan_dahdi.c
Modified: branches/1.4/channels/chan_dahdi.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.4/channels/chan_dahdi.c?view=diff&rev=210067&r1=210066&r2=210067
==============================================================================
--- branches/1.4/channels/chan_dahdi.c (original)
+++ branches/1.4/channels/chan_dahdi.c Mon Aug 3 11:15:20 2009
@@ -6264,7 +6264,35 @@
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 @@
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);
More information about the asterisk-commits
mailing list