[Asterisk-Users] INFO method and DTMF translation

Nguyen Hoang Lan dtkhang at hn.vnn.vn
Sun Oct 12 00:38:46 MST 2003


Hello guys,
I have searched high and low, but not found any information about
rules of using DTMF in SIP INFO method. Cisco has described something with
Signal=, but it look like this feature is dependent on implementors?

The problem is chan_sip.c cannot correctly translate received DTMF
digits, especially #,*. At least with my Antek EGW-804 gateway.

Looking into chan_sip.c, I found this code:

line 3982
if (p->owner) {
                if (strlen(buf)) {
                        if (sipdebug)
                                ast_verbose("DTMF received: '%c'\n", buf[0]);
                        event = atoi(buf); << WHY?
                        if (event < 10) {
                                resp = '0' + event;
                        } else if (event < 11) {
                                resp = '*';
                        } else if (event < 12) {
                                resp = '#';
                        } else if (event < 16) {
                                resp = 'A' + (event - 12);
                        }
                        memset(&f, 0, sizeof(f));
                        f.frametype = AST_FRAME_DTMF;
                        f.subclass = resp;
                        f.offset = 0;
                        f.data = NULL;
                        f.datalen = 0;
                        ast_queue_frame(p->owner, &f, 0);
                }

On line 3986, any # or * digit I entered was translated to 0(zero). So
any apps depends on # for terminating (voicemail for example) won't
work.

My question is , why not take just buf[0]? why translate? my UA
always send something like d= (one digit) at a time.
-- 
Best regards,
 Nguyen                          mailto:dtkhang at hn.vnn.vn




More information about the asterisk-users mailing list