[Home]

Summary:ASTERISK-12132: [patch] Incorect duration values in INFO messages when emulation occurs
Reporter:Torrey Searle (tsearle)Labels:
Date Opened:2008-06-03 02:45:04Date Closed:2008-06-09 11:30:51
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/Channels
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 12778.rev1.txt
( 1) dtmf_info_duration_comments.patch
( 2) dtmf_info_duration.patch
Description:Here is the scenario I was doing

Sip user A (dtmfmode=rfc2833) calls Sip User B (dtmfmode=info)

sip user A sends a very brief dtmf (less than 80) ms,  the INFO message sent to the other side has a very long duration!!!

****** ADDITIONAL INFORMATION ******

Form the code point of view... asterisk will calculate the dtmf duration of the DTMF by taking now() - dtmf_tv (which should be the time the dtmf started), however in the case that the dtmf was to short, dtmf_tv isn't set.

Attached is a patch to set dtmf_tv to the time the dtmf should of started, and set the emulate_dtmf_duration to be the full duration (not the difference between now and when it should finish)
Comments:By: Torrey Searle (tsearle) 2008-06-03 02:56:19

reposted patch with the commenting reformatted

By: Torrey Searle (tsearle) 2008-06-06 09:26:29

Please let me know if you have any questions regarding this issue.

By: Russell Bryant (russell) 2008-06-09 08:05:50

I have uploaded a different patch which I think will address this issue.

I think that the block of code that you have changed shouldn't be executed at all in the case that END_DTMF_ONLY is set (the other side is using INFO).  It doesn't make any sense to do the emulation in that case.

Please test this patch and see if it still fixes your issue.

By: Torrey Searle (tsearle) 2008-06-09 09:22:44

ok, I will check out your patch.  Just one question with regards to emulation though.

Wouldn't emulation still make sense in the case that several fast dtmf events were sent in a row? (E.G. a gateway might get confused if you tell it to generate a 80ms dtmfs but you're sending an INFO message every 50ms)

By: Russell Bryant (russell) 2008-06-09 09:39:54

That's a good point.  I'm not sure the best way to handle it, though.

DTMF emulation relies on frames coming through Asterisk to work properly.  If _both_ sides of the call are using SIP INFO for DTMF, then audio may not be flowing through Asterisk even though the DTMF frames are still coming through.  If we attempt emulation in that case, the digit will not get sent until the next frame comes through (another DTMF frame, most likely).

By: Torrey Searle (tsearle) 2008-06-09 09:48:12

ok, I've tested your patch and it seems to be working good. :-)

By: Russell Bryant (russell) 2008-06-09 09:57:27

Thank you very much for posting a patch, for the testing, and for the quick responses.  :)

By: Digium Subversion (svnbot) 2008-06-09 11:28:59

Repository: asterisk
Revision: 121280

U   branches/1.4/main/channel.c

------------------------------------------------------------------------
r121280 | russell | 2008-06-09 11:28:58 -0500 (Mon, 09 Jun 2008) | 10 lines

Do not attempt to do emulation if an END digit is received and the length is
less than the defined minimum digit length, and the other end only wants END
digits (SIP INFO, for example).

(closes issue ASTERISK-12132)
Reported by: tsearle
Patches:
     12778.rev1.txt uploaded by russell (license 2)
Tested by: tsearle

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=121280

By: Digium Subversion (svnbot) 2008-06-09 11:30:31

Repository: asterisk
Revision: 121282

_U  trunk/
U   trunk/main/channel.c

------------------------------------------------------------------------
r121282 | russell | 2008-06-09 11:30:30 -0500 (Mon, 09 Jun 2008) | 18 lines

Merged revisions 121280 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r121280 | russell | 2008-06-09 11:35:40 -0500 (Mon, 09 Jun 2008) | 10 lines

Do not attempt to do emulation if an END digit is received and the length is
less than the defined minimum digit length, and the other end only wants END
digits (SIP INFO, for example).

(closes issue ASTERISK-12132)
Reported by: tsearle
Patches:
     12778.rev1.txt uploaded by russell (license 2)
Tested by: tsearle

........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=121282

By: Digium Subversion (svnbot) 2008-06-09 11:30:51

Repository: asterisk
Revision: 121283

_U  branches/1.6.0/
U   branches/1.6.0/main/channel.c

------------------------------------------------------------------------
r121283 | russell | 2008-06-09 11:30:51 -0500 (Mon, 09 Jun 2008) | 26 lines

Merged revisions 121282 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r121282 | russell | 2008-06-09 11:37:08 -0500 (Mon, 09 Jun 2008) | 18 lines

Merged revisions 121280 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r121280 | russell | 2008-06-09 11:35:40 -0500 (Mon, 09 Jun 2008) | 10 lines

Do not attempt to do emulation if an END digit is received and the length is
less than the defined minimum digit length, and the other end only wants END
digits (SIP INFO, for example).

(closes issue ASTERISK-12132)
Reported by: tsearle
Patches:
     12778.rev1.txt uploaded by russell (license 2)
Tested by: tsearle

........

................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=121283