[Asterisk-code-review] chan_pjsip: Prevent segfault when running PlayDTMF on hungup channel (...asterisk[master])
Friendly Automation
asteriskteam at digium.com
Thu Oct 10 08:57:07 CDT 2019
Friendly Automation has submitted this change and it was merged. ( https://gerrit.asterisk.org/c/asterisk/+/13022 )
Change subject: chan_pjsip: Prevent segfault when running PlayDTMF on hungup channel
......................................................................
chan_pjsip: Prevent segfault when running PlayDTMF on hungup channel
ASTERISK-28086 #close
Change-Id: Ib3baadc89b9f0477a6f25a63861433812368c5ea
---
M channels/chan_pjsip.c
1 file changed, 6 insertions(+), 0 deletions(-)
Approvals:
Joshua Colp: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Friendly Automation: Approved for Submit
diff --git a/channels/chan_pjsip.c b/channels/chan_pjsip.c
index 9e0aa85..f2f6cf8 100644
--- a/channels/chan_pjsip.c
+++ b/channels/chan_pjsip.c
@@ -2261,6 +2261,12 @@
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) {
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/13022
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Ib3baadc89b9f0477a6f25a63861433812368c5ea
Gerrit-Change-Number: 13022
Gerrit-PatchSet: 1
Gerrit-Owner: lvl <digium at lvlconsultancy.nl>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20191010/8f07b9d5/attachment-0001.html>
More information about the asterisk-code-review
mailing list