summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorJeff Peeler <jpeeler@digium.com>2009-10-07 20:08:14 +0000
committerJeff Peeler <jpeeler@digium.com>2009-10-07 20:08:14 +0000
commit4ae6bee6daf578b96aaff95b284d80b48194bd68 (patch)
treeeafb3ca9363c995b0b254097c49a476070fd95a4 /channels
parent864aa14426f44e1ec145d9948155bd3e9844c45c (diff)
Change ringt (ring timeout) styles to be consistent across chan_dahdi.
(closes issue #15684) Reported by: alecdavis Patches: chan_dahdi.bug15684.diff2.txt uploaded by alecdavis (license 585) Tested by: alecdavis git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222652 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_dahdi.c61
1 files changed, 30 insertions, 31 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index df4665429..f360899fd 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -1638,11 +1638,11 @@ static int my_get_callerid(void *pvt, char *namebuf, char *numbuf, enum analog_e
}
}
- if (analog_p->ringt) {
- analog_p->ringt--;
- }
- if (analog_p->ringt == 1) {
- return -1;
+ if (analog_p->ringt > 0) {
+ if (!(--analog_p->ringt)) {
+ /* only return if we timeout from a ring event */
+ return -1;
+ }
}
if (p->cid_signalling == CID_SIG_V23_JP) {
@@ -1742,11 +1742,11 @@ static int my_distinctive_ring(struct ast_channel *chan, void *pvt, int idx, int
}
break;
}
- if (analog_p->ringt)
- analog_p->ringt--;
- if (analog_p->ringt == 1) {
- res = -1;
- break;
+ if (analog_p->ringt > 0) {
+ if (!(--analog_p->ringt)) {
+ res = -1;
+ break;
+ }
}
}
}
@@ -7713,12 +7713,12 @@ static struct ast_frame *dahdi_read(struct ast_channel *ast)
ast_mutex_unlock(&p->lock);
return &p->subs[idx].f;
}
- if (p->ringt == 1) {
- ast_mutex_unlock(&p->lock);
- return NULL;
+ if (p->ringt > 0) {
+ if (!(--p->ringt)) {
+ ast_mutex_unlock(&p->lock);
+ return NULL;
+ }
}
- else if (p->ringt > 0)
- p->ringt--;
#ifdef HAVE_OPENR2
if (p->mfcr2) {
@@ -9291,11 +9291,11 @@ static void *analog_ss_thread(void *data)
}
break;
}
- if (p->ringt)
- p->ringt--;
- if (p->ringt == 1) {
- res = -1;
- break;
+ if (p->ringt > 0) {
+ if (!(--p->ringt)) {
+ res = -1;
+ break;
+ }
}
}
}
@@ -9448,12 +9448,11 @@ static void *analog_ss_thread(void *data)
}
break;
}
- if (p->ringt) {
- p->ringt--;
- }
- if (p->ringt == 1) {
- res = -1;
- break;
+ if (p->ringt > 0) {
+ if (!(--p->ringt)) {
+ res = -1;
+ break;
+ }
}
samples += res;
res = callerid_feed(cs, buf, res, AST_LAW(p));
@@ -9510,11 +9509,11 @@ static void *analog_ss_thread(void *data)
}
break;
}
- if (p->ringt)
- p->ringt--;
- if (p->ringt == 1) {
- res = -1;
- break;
+ if (p->ringt > 0) {
+ if (!(--p->ringt)) {
+ res = -1;
+ break;
+ }
}
}
}