Summary:ASTERISK-17372: [patch] Senddtmf(f) fails with don't know how to indicate condition 9 when using SIP
Reporter:Christopher (cadillackid)Labels:patch
Date Opened:2011-02-09 10:53:57.000-0600Date Closed:
Versions:1.8.4 13.18.4 Frequency of
Environment:Attachments:( 0) asterisk_1.8.2.3_patch.txt
Description:trying to to send a Hookflash DTMF event results in SIP channel failing  with the error sip_indicate: dont know how to indicate condition 9..

this is when trying to send a Hookflash DTMF event to a Grandstream GXW4104 4 port FXO device  in which DTMF event 16 per RFC2833  will flash the switch hook on the FXO port  of the GXW device...

****** STEPS TO REPRODUCE ******

simply executing the following commands in the asterisk dialplan will induce the error condition:

exten = s,1,Playback(transfer)
exten = s,2,SendDTMF(f)

I have tested this also on and also on 1.4.24  and the condition is the same on those versions of asterisk as well.


looking at the code in app.c it appears here to send you off to indications if a flash hook is requested..  
                       if (*ptr == 'f' || *ptr == 'F') {
                               /* ignore return values if not supported by channel */
                               ast_indicate(chan, AST_CONTROL_FLASH);
                       } else {
                               ast_senddigit(chan, *ptr, duration);

however this is a DTMF event and should be handled by the DTMF handler and not by the indications  module...  

since we are using RFC2833 it would go to the RTP handler..  so next up is res_rtp_asterisk.c

and in there any mention of flash-hook over DTMF as an event  is missing altogether..  so even if the DTMF got this far it would fail in the ast_rtp_begin routine....

to me it looks like this was just an oversight or incomplete feature addition at some point during asterisk's life...  
Comments:By: Lam Soft (lamsoft) 2011-02-11 11:17:24.000-0600

I have the same issue, and found that in chan_sip.c, static int sip_indicate there is no condition for AST_CONTROL_FLASH, the patch file seems for 1.8 version only as I didn't find the file res_rtp_asterisk.c in 1.6, if there is a patch file for 1.6 it would be nice, thanks!

Another issue, it is about the function "phone_indicate" in chan_phone.c, I found that there is no other code to call this function?....

find /usr/src/asterisk- -type f -print0 | xargs -0 grep -l "phone_indicate"