[Asterisk-code-review] chan_pjsip: Prevent segfault when running PlayDTMF on hungup channel (...asterisk[13])
Friendly Automation
asteriskteam at digium.com
Thu Oct 10 07:32:48 CDT 2019
Friendly Automation has submitted this change and it was merged. ( https://gerrit.asterisk.org/c/asterisk/+/13028 )
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 a248cbb..33abe03 100644
--- a/channels/chan_pjsip.c
+++ b/channels/chan_pjsip.c
@@ -1922,6 +1922,12 @@
struct ast_sip_session_media *media = pvt->media[SIP_MEDIA_AUDIO];
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;
+ }
+
switch (channel->session->dtmf) {
case AST_SIP_DTMF_AUTO_INFO:
{
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/13028
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: Ib3baadc89b9f0477a6f25a63861433812368c5ea
Gerrit-Change-Number: 13028
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: lvl <digium at lvlconsultancy.nl>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20191010/98a3b408/attachment.html>
More information about the asterisk-code-review
mailing list