From 3304492b411c46376d9b0d4dbe512c08390e4836 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Tue, 12 Jan 2016 10:56:41 -0500 Subject: [PATCH] FS-8720: [core] allow passing in blank/null to session::hangup to mean NORMAL_CLEARING hangup cause instead of segfault --- src/switch_cpp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/switch_cpp.cpp b/src/switch_cpp.cpp index 0467109926..25be61d7f4 100644 --- a/src/switch_cpp.cpp +++ b/src/switch_cpp.cpp @@ -718,7 +718,7 @@ SWITCH_DECLARE(void) CoreSession::hangup(const char *cause) sanity_check_noreturn; switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "CoreSession::hangup\n"); this->begin_allow_threads(); - switch_channel_hangup(channel, switch_channel_str2cause(cause)); + switch_channel_hangup(channel, zstr(cause) ? SWITCH_CAUSE_NORMAL_CLEARING : switch_channel_str2cause(cause)); this->end_allow_threads(); }