Skip to content
Snippets Groups Projects
Commit c8c0bccf authored by Grzegorz Sluja's avatar Grzegorz Sluja Committed by Sukru Senli
Browse files

Fix for getting status of feature codes


Sign '#' was recognized as the end of feature code hence some of the
codes for getting status were not working, like:
*#43# - check status of call waiting
*#227# - check status of anonymous call rejection

The fix makes '#' not recognized as the end of feature code if the
previous character is '*'

Signed-off-by: default avatarGrzegorz Sluja <grzegorz.sluja@iopsys.eu>
parent 39c75de4
No related branches found
No related tags found
1 merge request!1Rename endptmngt to voicemngr, chan_brcm to chan_voicemngr
......@@ -1567,15 +1567,18 @@ void handle_dtmf_calling(struct brcm_subchannel *sub)
char termination_digit;
int dtmfbuf_len = strlen(p->dtmfbuf);
char dtmf_last_char = p->dtmfbuf[(dtmfbuf_len - 1)];
char dtmf_one_before_last_char = p->dtmfbuf[(dtmfbuf_len > 1 ? dtmfbuf_len - 2 : 0)];
termination_digit = line_config[p->line_id].terminationdigit?line_config[p->line_id].terminationdigit:0x23;
if (ast_exists_extension(NULL, p->context_direct, p->dtmfbuf, 1, p->cid_num) && !ast_matchmore_extension(NULL, p->context_direct, p->dtmfbuf, 1, p->cid_num))
{
//We have a full match in the "direct" context, so have asterisk place a call immediately
ast_debug(9, "Direct extension matching %s found\n", p->dtmfbuf);
brcm_start_calling(p, sub, p->context_direct);
}
else if (ast_exists_extension(NULL, p->context, p->dtmfbuf, 1, p->cid_num) && dtmf_last_char == termination_digit && feature_access_code_match(p->dtmfbuf) != 1) {
else if (ast_exists_extension(NULL, p->context, p->dtmfbuf, 1, p->cid_num) && dtmf_last_char == termination_digit &&
dtmf_one_before_last_char != 0x2A && feature_access_code_match(p->dtmfbuf) != 1) {
//We have a match in the "normal" context, and user ended the dialling sequence with a #,
//so have asterisk place a call immediately if sequence is not partially matching a feature access code
ast_debug(9, "Termination key %c pressed during dialling, extension %s found\n",termination_digit, p->dtmfbuf);
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment