Review Board 1.7.16


Fix double DTMF digits when 'dtmfmode=inband' and client sends both 'inband' and 'SIP INFO' packets

Review Request #2165 - Created Oct. 16, 2012 and updated

Alec Davis
1.8 to trunk
ASTERISK-20218
Reviewers
asterisk-dev
Asterisk
Asterisk 1.8.16.0

file:/var/log/asterisk/dtmf when only '2' was hit once
[2012-10-17 19:46:17.879406] DTMF[17084] channel.c: DTMF begin '2' received on SIP/822-00000000
[2012-10-17 19:46:17.879467] DTMF[17084] channel.c: DTMF begin ignored '2' on SIP/822-00000000
[2012-10-17 19:46:17.950953] DTMF[17084] channel.c: DTMF end '2' received on SIP/822-00000000, duration 800 ms
[2012-10-17 19:46:17.951004] DTMF[17084] channel.c: DTMF end passthrough '2' on SIP/822-00000000
[2012-10-17 19:46:18.019135] DTMF[17084] channel.c: DTMF end '2' received on SIP/822-00000000, duration 51 ms
[2012-10-17 19:46:18.019228] DTMF[17084] channel.c: DTMF end passthrough '2' on SIP/822-00000000


In ASTERISK-20218 the attached file it can be seen that both PA2P.rtf has both 'inband' and 'SIP INFO' set. 
Asterisk SVN-branch-1.8-r375111M

I was able to verify the same conditions on a Grandstream GXP2000.

Below is after proposed patch:

file:/var/log/asterisk/dtmf when '820' was entered

[2012-10-17 20:16:18.883821] DTMF[23460] channel.c: DTMF begin '8' received on SIP/822-00000004
[2012-10-17 20:16:18.883868] DTMF[23460] channel.c: DTMF begin ignored '8' on SIP/822-00000004
[2012-10-17 20:16:18.963537] DTMF[23460] channel.c: DTMF end '8' received on SIP/822-00000004, duration 89 ms
[2012-10-17 20:16:18.963559] DTMF[23460] channel.c: DTMF end passthrough '8' on SIP/822-00000004
[2012-10-17 20:16:19.263805] DTMF[23460] channel.c: DTMF begin '2' received on SIP/822-00000004
[2012-10-17 20:16:19.263851] DTMF[23460] channel.c: DTMF begin ignored '2' on SIP/822-00000004
[2012-10-17 20:16:19.363423] DTMF[23460] channel.c: DTMF end '2' received on SIP/822-00000004, duration 89 ms
[2012-10-17 20:16:19.363444] DTMF[23460] channel.c: DTMF end passthrough '2' on SIP/822-00000004
[2012-10-17 20:16:19.643830] DTMF[23460] channel.c: DTMF begin '0' received on SIP/822-00000004
[2012-10-17 20:16:19.643876] DTMF[23460] channel.c: DTMF begin ignored '0' on SIP/822-00000004
[2012-10-17 20:16:19.783561] DTMF[23460] channel.c: DTMF end '0' received on SIP/822-00000004, duration 140 ms
[2012-10-17 20:16:19.783582] DTMF[23460] channel.c: DTMF end passthrough '0' on SIP/822-00000004


Console:

    -- Executing [s@voicemail-main:2] VoiceMailMain("SIP/822-00000004", "") in new stack
    -- <SIP/822-00000004> Playing 'vm-login.gsm' (language 'en')
[2012-10-17 20:16:18.935436] WARNING[23399]: chan_sip.c:19239 handle_request_info: Ignoring DTMF_INFO message as DTMF_INBAND is set on channel SIP/822-00000004
[2012-10-17 20:16:19.325618] WARNING[23399]: chan_sip.c:19239 handle_request_info: Ignoring DTMF_INFO message as DTMF_INBAND is set on channel SIP/822-00000004
[2012-10-17 20:16:19.734910] WARNING[23399]: chan_sip.c:19239 handle_request_info: Ignoring DTMF_INFO message as DTMF_INBAND is set on channel SIP/822-00000004
    -- <SIP/822-00000004> Playing 'vm-password.gsm' (language 'en')
asterix*CLI>

Changes between revision 3 and 4

1 2 3 4
1 2 3 4

  1. branches/1.8/channels/chan_sip.c: Loading...
branches/1.8/channels/chan_sip.c
Diff Revision 3 Diff Revision 4
[20] 19232 lines
[+20] [+] static void handle_request_info(struct sip_pvt *p, struct sip_request *req)
19233

    
   
19233

   
19234
		/* If dtmf-relay or vnd.nortelnetworks.digits, parse the signal and duration;
19234
		/* If dtmf-relay or vnd.nortelnetworks.digits, parse the signal and duration;
19235
		 * otherwise use the body as the signal */
19235
		 * otherwise use the body as the signal */
19236
		if (strcasecmp(c, "application/dtmf")) {
19236
		if (strcasecmp(c, "application/dtmf")) {
19237
			const char *msg_body;
19237
			const char *msg_body;
19238
			if ((ast_test_flag(&p->flags[0], SIP_DTMF) != SIP_DTMF_INFO)) {
19238

   

    
   
19239
			switch (ast_test_flag(&p->flags[0], SIP_DTMF)) {

    
   
19240
			case SIP_DTMF_INBAND:

    
   
19241
			case SIP_DTMF_RFC2833:

    
   
19242
				if (option_debug > 2) {

    
   
19243
					ast_log(LOG_WARNING, "Ignoring DTMF_INFO message as DTMF_INFO is disabled on "

    
   
19244
							"channel %s\n", p->owner->name);

    
   
19245
				}
19239
				transmit_response(p, "200 OK", req);
19246
				transmit_response(p, "200 OK", req);
19240
				return;
19247
				return;
19241
			}
19248
			}
19242

    
   
19249

   
19243
			if (   ast_strlen_zero(msg_body = get_body(req, "Signal", '='))
19250
			if (   ast_strlen_zero(msg_body = get_body(req, "Signal", '='))
[+20] [20] 12474 lines
  1. branches/1.8/channels/chan_sip.c: Loading...

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.