Merge "chan_pjsip: Prevent segfault when running PlayDTMF on hungup channel" into 16

This commit is contained in:
Friendly Automation 2019-10-10 07:26:20 -05:00 committed by Gerrit Code Review
commit 983bebb680
1 changed files with 6 additions and 0 deletions

View File

@ -2267,6 +2267,12 @@ static int chan_pjsip_digit_end(struct ast_channel *ast, char digit, unsigned in
struct ast_sip_session_media *media;
int res = 0;
if (!channel || !channel->session) {
/* This happens when the channel is hungup while a DTMF digit is playing. See ASTERISK-28086 */
ast_debug(3, "Channel %s disappeared while calling digit_end\n", ast_channel_name(ast));
return -1;
}
media = channel->session->active_media_state->default_session[AST_MEDIA_TYPE_AUDIO];
switch (channel->session->dtmf) {