aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-07 20:08:14 +0000
committerjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-07 20:08:14 +0000
commitf1bedb0db317b1461675875a3bdb003c8eaaa37e (patch)
treeeafb3ca9363c995b0b254097c49a476070fd95a4
parent0aab9c012d7116e2488d8a23c37e02ba811f1ca8 (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: http://svn.digium.com/svn/asterisk/trunk@222652 f38db490-d61c-443f-a65b-d21fe96a405b
-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;
+ }
}
}
}