@@ -87,16 +87,18 @@ static int dtmf_info_incoming_request(struct ast_sip_session *session, struct pj
8787 char * line ;
8888 char event = '\0' ;
8989 unsigned int duration = 100 ;
90- char is_dtmf ;
90+ char is_dtmf , is_dtmf_relay , is_flash ;
9191 int res ;
9292
9393 if (!session -> channel ) {
9494 return 0 ;
9595 }
9696
9797 is_dtmf = is_media_type (rdata , "dtmf" );
98+ is_dtmf_relay = is_media_type (rdata , "dtmf-relay" );
99+ is_flash = is_media_type (rdata , "hook-flash" );
98100
99- if (!is_dtmf && !is_media_type ( rdata , "dtmf-relay" ) ) {
101+ if (!is_flash && !is_dtmf && ! is_dtmf_relay ) {
100102 return 0 ;
101103 }
102104
@@ -116,7 +118,7 @@ static int dtmf_info_incoming_request(struct ast_sip_session *session, struct pj
116118 if (is_dtmf ) {
117119 /* directly use what is in the message body */
118120 event = get_event (cur );
119- } else { /* content type = application/dtmf-relay */
121+ } else if ( is_dtmf_relay ) { /* content type = application/dtmf-relay */
120122 while ((line = strsep (& cur , "\r\n" ))) {
121123 char * c ;
122124
@@ -137,7 +139,7 @@ static int dtmf_info_incoming_request(struct ast_sip_session *session, struct pj
137139 }
138140 }
139141
140- if (event == '!' ) {
142+ if (event == '!' || is_flash ) {
141143 struct ast_frame f = { AST_FRAME_CONTROL , { AST_CONTROL_FLASH , } };
142144 ast_queue_frame (session -> channel , & f );
143145 } else if (event != '\0' ) {
0 commit comments