Summary:ASTERISK-01018: Incomplete RFC2833 support
Reporter:thansen (thansen)Labels:
Date Opened:2004-02-10 11:08:27.000-0600Date Closed:2011-06-07 14:10:14
Versions:Frequency of
Description:The RTP DTMF EVENTs sent to SIP endpoints are too short according to RFC2833/ITU-T Q.24.

The setup:
PSTN-1 -> SIP RG-1 -> Asterisk -> SIP RG-1 -> PSTN-2

There's two analog phones connected to one SIP residential gateway (PSTN to SIP gateway). A call is placed from one phone to the other.

When the analog phone on PSTN-1 sends a DTMF tone, the SIP RG-1 squelches the tone and sends RTP events (with two voice packets between each event) for as long as the analog phone sends the tone (cutoff after a couple of seconds). When the tone stop an event packet with the end flag is sent.

When the end event packet arrives at Asterisk, Asterisk immediately sends exactly four packets, a start and three end packets, to the receiving end. There's about 7-8ms between the start and the first end packet on my test setup here.

RFC2833 section 3.6 specifies that such an event should be sent with 50ms intervals or according to the packet interval of the codec in use (20ms PCMA). It also refers to ITU-T Q.24 which indicates that at least 40ms of tone is needed for analog phones (i.e. PSTN answering machines, alarm systems etc.) to recognize DTMF. The SIP RG will only play the DTMF tone for 7-8ms because that's what Asterisk is telling it to do.

I've been looking into the rtp.c dtmf sending function and it seems like it would take some work to get it to mix voice and dtmf events. As I read the RFC, Asterisk/chan_sip doesn't implement RFC2833 properly. It may work with SIP endpoints that doesn't care about tone lengths, but it doesn't work with SIP to PSTN gateways (atleast not the one we're using anyway).

Comments appreciated.
Comments:By: Brian West (bkw918) 2004-04-06 00:20:11

If this is still an issue please post and we will reopen.