Summary: | ASTERISK-00008: DMTF *,# are not detected via sip info, they're got as '1' | ||
Reporter: | Matteo Brancaleoni (mbrancaleoni) | Labels: | |
Date Opened: | 2003-07-23 11:59:38 | Date Closed: | 2004-09-25 02:40:14 |
Priority: | Major | Regression? | No |
Status: | Closed/Complete | Components: | Core/General |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Attachments: | ||
Description: | When using dtmf=info in sip.conf , dtmf *,# are received as ones (1) . That because *,# in INFO SIP/SDP is 10 or 11, and asterisk get only the first digit, that's 1 . ****** STEPS TO REPRODUCE ****** Just dial into any app that requires * or # dtmf , from a sip phone configured to send dtmf via info msgs. Eg. VoiceMail. Looking into the sip debug, we see that we receive '1' when * or # is pressed on the phone | ||
Comments: | By: Matteo Brancaleoni (mbrancaleoni) 2003-07-23 13:59:55 Ok. written the patch ;) --- asterisk/channels/chan_sip.c 2003-07-23 20:34:43.000000000 +0200 +++ asterisk-temp/channels/chan_sip.c 2003-07-23 20:33:05.000000000 +0200 @@ -3857,6 +3857,8 @@ static void receive_info(struct sip_pvt *p, struct sip_request *req) { char buf[1024] = ""; + unsigned int event; + char resp = 0; struct ast_frame f; char *c; /* Try getting the "signal=" part */ @@ -3872,13 +3874,23 @@ if (strlen(buf)) { if (sipdebug) ast_verbose("DTMF received: '%c'\n", buf[0]); - memset(&f, 0, sizeof(f)); - f.frametype = AST_FRAME_DTMF; - f.subclass = buf[0]; - f.offset = 0; - f.data = NULL; - f.datalen = 0; - ast_queue_frame(p->owner, &f, 0); + event = atoi(buf); + 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); } } } edited on: 07-23-03 13:39 By: Matteo Brancaleoni (mbrancaleoni) 2003-07-25 12:20:16 I think that this could be closed, since the patch has been added to the main cvs. and works ;) By: Mark Spencer (markster) 2003-08-02 15:50:03 Fixed in CVS. |