@@ -87,16 +87,18 @@ static int dtmf_info_incoming_request(struct ast_sip_session *session, struct pj
87
87
char * line ;
88
88
char event = '\0' ;
89
89
unsigned int duration = 100 ;
90
- char is_dtmf ;
90
+ char is_dtmf , is_dtmf_relay , is_flash ;
91
91
int res ;
92
92
93
93
if (!session -> channel ) {
94
94
return 0 ;
95
95
}
96
96
97
97
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" );
98
100
99
- if (!is_dtmf && !is_media_type ( rdata , "dtmf-relay" ) ) {
101
+ if (!is_flash && !is_dtmf && ! is_dtmf_relay ) {
100
102
return 0 ;
101
103
}
102
104
@@ -116,7 +118,7 @@ static int dtmf_info_incoming_request(struct ast_sip_session *session, struct pj
116
118
if (is_dtmf ) {
117
119
/* directly use what is in the message body */
118
120
event = get_event (cur );
119
- } else { /* content type = application/dtmf-relay */
121
+ } else if ( is_dtmf_relay ) { /* content type = application/dtmf-relay */
120
122
while ((line = strsep (& cur , "\r\n" ))) {
121
123
char * c ;
122
124
@@ -137,7 +139,7 @@ static int dtmf_info_incoming_request(struct ast_sip_session *session, struct pj
137
139
}
138
140
}
139
141
140
- if (event == '!' ) {
142
+ if (event == '!' || is_flash ) {
141
143
struct ast_frame f = { AST_FRAME_CONTROL , { AST_CONTROL_FLASH , } };
142
144
ast_queue_frame (session -> channel , & f );
143
145
} else if (event != '\0' ) {
0 commit comments