mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-11 12:07:06 +00:00
improve core and basic flow
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4174 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
e6dac0923a
commit
ed41805c17
8 files changed
+210
-89
No files matched your search
@@ -1766,6 +1766,22 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_dequeue_message(switch_core_
|
||||
return status;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_flush_message(switch_core_session_t *session)
|
||||
{
|
||||
switch_core_session_message_t *message;
|
||||
|
||||
if (switch_core_session_dequeue_message(session, &message) == SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_test_flag(message, SCSMF_DYNAMIC)) {
|
||||
switch_safe_free(message);
|
||||
} else {
|
||||
message = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_receive_event(switch_core_session_t *session, switch_event_t **event)
|
||||
|
||||
{
|
||||
@@ -2151,6 +2167,9 @@ SWITCH_DECLARE(void) switch_core_session_reset(switch_core_session_t *session)
|
||||
session->read_resampler = NULL;
|
||||
session->write_resampler = NULL;
|
||||
|
||||
/* clear indications */
|
||||
switch_core_session_flush_message(session);
|
||||
|
||||
/* wipe theese, they will be recreated if need be */
|
||||
switch_buffer_destroy(&session->raw_read_buffer);
|
||||
switch_buffer_destroy(&session->raw_write_buffer);
|
||||
|
||||
Reference in new issue
Block a user