From: Tilghman Lesher Date: Thu, 29 May 2008 20:24:11 +0000 (+0000) Subject: Call waiting tone occurs too often, because it's getting serviced by both X-Git-Tag: 1.4.21-rc1~24 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b2f0add41cd6ed87d2e7e66ec785a2b49445164e;p=thirdparty%2Fasterisk.git Call waiting tone occurs too often, because it's getting serviced by both subchannels. (closes issue #11354) Reported by: cahen Patches: 20080512__bug11354.diff.txt uploaded by Corydon76 (license 14) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@119071 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_zap.c b/channels/chan_zap.c index 96a2838ea3..e79520c860 100644 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -281,10 +281,10 @@ static inline int zt_wait_event(int fd) #define MASK_INUSE (1 << 1) /*!< Channel currently in use */ #define CALLWAITING_SILENT_SAMPLES ( (300 * 8) / READ_SIZE) /*!< 300 ms */ -#define CALLWAITING_REPEAT_SAMPLES ( (10000 * 8) / READ_SIZE) /*!< 300 ms */ +#define CALLWAITING_REPEAT_SAMPLES ( (10000 * 8) / READ_SIZE) /*!< 10,000 ms */ #define CIDCW_EXPIRE_SAMPLES ( (500 * 8) / READ_SIZE) /*!< 500 ms */ #define MIN_MS_SINCE_FLASH ( (2000) ) /*!< 2000 ms */ -#define DEFAULT_RINGT ( (8000 * 8) / READ_SIZE) +#define DEFAULT_RINGT ( (8000 * 8) / READ_SIZE) /*!< 8,000 ms */ struct zt_pvt; @@ -4823,8 +4823,10 @@ static struct ast_frame *zt_read(struct ast_channel *ast) return &p->subs[index].f; } } - if (p->callwaitingrepeat) + /* Ensure the CW timer decrements only on a single subchannel */ + if (p->callwaitingrepeat && zt_get_index(ast, p, 1) == SUB_REAL) { p->callwaitingrepeat--; + } if (p->cidcwexpire) p->cidcwexpire--; /* Repeat callwaiting */