Summary:ASTERISK-02048: ast_dtmf_stream fails to return correct values
Reporter:mgamble (mgamble)Labels:
Date Opened:2004-07-17 16:54:59Date Closed:2011-06-07 14:10:22
Versions:Frequency of
Description:When calling app_senddtmf (which in turn calls ast_dtmf_stream) on a ULAW sip channel with inband DTMF, asterisk returns 0 (success) when in fact most digits are not actually sent / generated.


Using todays CVS and calling senddtmf(1234567890) results in only 2-3 digits actually being generated and sent on the channel by the do_senddigit function.  The ast_write function returns 0 to ast_dtmf_stream for all digits passed, even if ast_write never call do_senddigit.  This results in asterisk thinking it has successfully sent the DTMF signals to the channel when in fact it has not.
Comments:By: Mark Spencer (markster) 2004-07-17 17:10:32

This is probably channel specific, what channel are you using?

By: mgamble (mgamble) 2004-07-17 17:35:33

The channel is sip, ULAW codec, inband DTMF

By: Mark Spencer (markster) 2004-07-18 12:13:31

Try updating to latest CVS as of this morning, I found a bug in indications.c (a not entirely non-serious one) in which the offset space wasn't actually being allocated.  Easy fix though.

By: mgamble (mgamble) 2004-07-18 12:37:28

Problem still persists.  Looking at the code, the problem appears to be in line 1554 of channel.c:

if (chan->generatordata) {
    if (chan->writeinterrupt)
         else {
           return 0;

From my review of the code, it looks like chan->writeinterrupt is false, so it calls ast_mutex_unlock, and then returns 0 (the same as success) but the do_senddigit code is never executed (because 0 was returned).

By: Mark Spencer (markster) 2004-07-18 14:45:48

As it turns out, generatordata is set to NULL before the generator is called and then reset to its real value, in order that this code is bypassed when being called by the generator.

What sort of device are you using?  Are you sure it does not have VAD on it?

By: mgamble (mgamble) 2004-07-18 16:49:57

I am using pure sip-to-sip between Asterisk and a Pactolus application server.  I'm not sure what VAD is, but I assume I am not using it.

By: Mark Spencer (markster) 2004-07-18 20:13:04

The audio that is generated by senddtmf is based on the received audio.  If there are breaks or gaps in the received audio, they will be present in the in-band DTMF that is transmitted.

By: mgamble (mgamble) 2004-07-18 23:05:39

Even if it is an issue with the received audio, the function should not return true if the digits are not sent.  If do_senddigit is not called, senddtmf should return false so the error case can be handled.

By: Olle Johansson (oej) 2004-07-26 08:34:18

Housekeeping reminder...


By: Olle Johansson (oej) 2004-08-08 15:58:24

No answer, bug report seems to have died due to lack of interest. /Housekeeping

By: Digium Subversion (svnbot) 2008-01-15 15:02:56.000-0600

Repository: asterisk
Revision: 3469

U   trunk/indications.c

r3469 | markster | 2008-01-15 15:02:56 -0600 (Tue, 15 Jan 2008) | 2 lines

Need actual offset space (bug ASTERISK-2048)