summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg2009-05-21 19:11:39 +0200
committerAndreas Eversberg2009-05-21 19:11:39 +0200
commit063d622d53ff5e7818ee75658ba8539016788941 (patch)
treece2f38302d349fa7658808c0889c269c5199fc24
parentOpenBSC API change. (diff)
downloadlcr-063d622d53ff5e7818ee75658ba8539016788941.tar.gz
lcr-063d622d53ff5e7818ee75658ba8539016788941.tar.xz
lcr-063d622d53ff5e7818ee75658ba8539016788941.zip
Fixed disabling of DTMF using 'n' option of chan_lcr.
Please enter the commit message for your changes. modified: README modified: apppbx.cpp modified: bchannel.c modified: chan_lcr.c modified: chan_lcr.h
-rw-r--r--README1
-rw-r--r--apppbx.cpp2
-rw-r--r--bchannel.c2
-rw-r--r--chan_lcr.c21
-rw-r--r--chan_lcr.h6
5 files changed, 18 insertions, 14 deletions
diff --git a/README b/README
index 0857d0b..6603931 100644
--- a/README
+++ b/README
@@ -501,5 +501,6 @@ Changes after Version 1.5
- Debug option now works for GSM.
- Fixed some GSM information elements.
- OpenBSC api changes.
+- Fixed disabling of DTMF using 'n' option of chan_lcr.
diff --git a/apppbx.cpp b/apppbx.cpp
index a64467e..fc50737 100644
--- a/apppbx.cpp
+++ b/apppbx.cpp
@@ -3268,7 +3268,7 @@ void EndpointAppPBX::ea_message_join(unsigned int join_id, int message_type, uni
join_notify(portlist, message_type, param);
break;
- /* JOIN wants keypad / dtml */
+ /* JOIN wants keypad / dtmf */
case MESSAGE_ENABLEKEYPAD:
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) epoint with terminal '%s' (caller id '%s') received keypad enable request.\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id);
e_enablekeypad = 1;
diff --git a/bchannel.c b/bchannel.c
index 187409f..0cba9db 100644
--- a/bchannel.c
+++ b/bchannel.c
@@ -483,7 +483,7 @@ void bchannel_dtmf(struct bchannel *bchannel, int on)
int sock;
sock = bchannel->b_sock;
- bchannel->b_dtmf = 1;
+ bchannel->b_dtmf = on;
if (bchannel->b_state == BSTATE_ACTIVE && bchannel->b_mode == 0)
ph_control(sock, on?DTMF_TONE_START:DTMF_TONE_STOP, 0, "DSP-DTMF", 1, bchannel->b_mode);
}
diff --git a/chan_lcr.c b/chan_lcr.c
index 00c27f8..4560651 100644
--- a/chan_lcr.c
+++ b/chan_lcr.c
@@ -414,7 +414,11 @@ void apply_opt(struct chan_call *call, char *data)
break;
}
CDEBUG(call, call->ast, "Option 'n' (no DTMF).\n");
- call->no_dtmf = 1;
+ if (call->dsp_dtmf) {
+ call->dsp_dtmf = 0;
+ if (call->bchannel)
+ bchannel_dtmf(call->bchannel, 0);
+ }
break;
case 'c':
if (opt[1] == '\0') {
@@ -1158,6 +1162,11 @@ void lcr_in_dtmf(struct chan_call *call, int val)
if (!call->pbx_started)
return;
+ if (!call->dsp_dtmf) {
+ CDEBUG(call, call->ast, "Recognised DTMF digit '%c', but ignoring. This is fixed in later mISDN driver.\n", val);
+ return;
+ }
+
CDEBUG(call, call->ast, "Recognised DTMF digit '%c'.\n", val);
digit[0] = val;
digit[1] = '\0';
@@ -1205,7 +1214,6 @@ int receive_message(int message_type, unsigned int ref, union parameter *param)
memcpy(bchannel->b_bf_key, param->bchannel.crypt, param->bchannel.crypt_len);
}
bchannel->b_txdata = 0;
- bchannel->b_dtmf = 1;
bchannel->b_tx_dejitter = 1;
/* in case, ref is not set, this bchannel instance must
@@ -1216,7 +1224,7 @@ int receive_message(int message_type, unsigned int ref, union parameter *param)
{
bchannel->call = call;
call->bchannel = bchannel;
- if (call->dtmf)
+ if (call->dsp_dtmf)
bchannel_dtmf(bchannel, 1);
if (call->bf_len)
bchannel_blowfish(bchannel, call->bf_key, call->bf_len);
@@ -1289,6 +1297,8 @@ int receive_message(int message_type, unsigned int ref, union parameter *param)
/* set ref */
call->ref = ref;
call->ref_was_assigned = 1;
+ /* set dtmf (default, use option 'n' to disable */
+ call->dsp_dtmf = 1;
/* wait for setup (or release from asterisk) */
} else
{
@@ -2065,11 +2075,6 @@ static int lcr_answer(struct ast_channel *ast)
/* enable keypad */
// memset(&newparam, 0, sizeof(union parameter));
// send_message(MESSAGE_ENABLEKEYPAD, call->ref, &newparam);
- /* enable dtmf */
- if (call->no_dtmf)
- CDEBUG(call, ast, "DTMF is disabled by option.\n");
- else
- call->dtmf = 1;
ast_mutex_unlock(&chan_lock);
return 0;
diff --git a/chan_lcr.h b/chan_lcr.h
index 5ddb4eb..60a64fd 100644
--- a/chan_lcr.h
+++ b/chan_lcr.h
@@ -50,10 +50,8 @@ struct chan_call {
char cid_rdnis[64]; /* cached cid for setup */
char display[128];
/* display for setup */
- int dtmf;
- /* shall dtmf be enabled */
- int no_dtmf;
- /* dtmf disabled by option */
+ int dsp_dtmf;
+ /* decode dtmf by dsp */
int inband_dtmf; /* generate dtmf tones, if
requested by asterisk */
int rebuffer; /* send only 160 bytes frames