mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-06 04:11:52 +00:00
streamFiles 2nd argument is now optional. fix segfault that was happening with originate/bridge due to no valid session in b leg. rename streamfile to streamFile. remove playFile since streamFile does the same thing
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5454 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -175,6 +175,11 @@ switch_status_t PySession::run_dtmf_callback(void *input,
|
||||
bool PySession::begin_allow_threads(void) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "PySession::begin_allow_threads() called\n");
|
||||
|
||||
if (!session) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "No valid session\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
// swap out threadstate and store in instance variable
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
PyThreadState *swapin_tstate = (PyThreadState *) switch_channel_get_private(channel, "SwapInThreadState");
|
||||
@@ -196,7 +201,6 @@ bool PySession::begin_allow_threads(void) {
|
||||
}
|
||||
else {
|
||||
// currently swapped out
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Threadstate already swapd-out! Skipping\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -205,11 +209,15 @@ bool PySession::begin_allow_threads(void) {
|
||||
bool PySession::end_allow_threads(void) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "PySession::end_allow_threads() called\n");
|
||||
// swap in threadstate from instance variable saved earlier
|
||||
if (!session) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "No valid session\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
PyThreadState *swapin_tstate = (PyThreadState *) switch_channel_get_private(channel, "SwapInThreadState");
|
||||
if (swapin_tstate == NULL) {
|
||||
// currently swapped in
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Threadstate double swap-in! Skipping\n");
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user