summaryrefslogtreecommitdiff
path: root/channels/sig_analog.c
diff options
context:
space:
mode:
authorDoug Bailey <dbailey@digium.com>2009-09-02 19:49:43 +0000
committerDoug Bailey <dbailey@digium.com>2009-09-02 19:49:43 +0000
commiteff8dd9a2fb6f0ccad5a0928cc106824194f0425 (patch)
treecd1655405f98b648e5d7fad4e33b981b6b7d9eb9 /channels/sig_analog.c
parent57a9927143fc9e3f1eef9d8ea568897b38d60d03 (diff)
Fix issue where DTMF CID detect was placing channels into signed linear mode
made analog_set_linear_mode return back the mode that was being overwritten so it could be restored later. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@215608 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/sig_analog.c')
-rw-r--r--channels/sig_analog.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/channels/sig_analog.c b/channels/sig_analog.c
index 1f28f049f..ae6620f49 100644
--- a/channels/sig_analog.c
+++ b/channels/sig_analog.c
@@ -770,6 +770,7 @@ static int analog_check_confirmanswer(struct analog_pvt *p)
static int analog_set_linear_mode(struct analog_pvt *p, int index, int linear_mode)
{
if (p->calls->set_linear_mode) {
+ /* Return provides old linear_mode setting or error indication */
return p->calls->set_linear_mode(p->chan_pvt, index, linear_mode);
}
return -1;
@@ -2035,11 +2036,12 @@ static void *__analog_ss_thread(void *data)
/* If set to use DTMF CID signalling, listen for DTMF */
if (p->cid_signalling == CID_SIG_DTMF) {
int i = 0;
+ int oldlinearity;
cs = NULL;
ast_debug(1, "Receiving DTMF cid on "
"channel %s\n", chan->name);
- analog_set_linear_mode(p, index, 0);
+ oldlinearity = analog_set_linear_mode(p, index, 0);
res = 2000;
for (;;) {
@@ -2066,7 +2068,7 @@ static void *__analog_ss_thread(void *data)
}
dtmfbuf[i] = '\0';
- analog_set_linear_mode(p, index, 1);
+ analog_set_linear_mode(p, index, oldlinearity);
/* Got cid and ring. */
ast_debug(1, "CID got string '%s'\n", dtmfbuf);