change blocking: true to async: true you can start with blocking and go async but not the other way around

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12759 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2009-03-24 18:01:58 +00:00
parent e23d05ddac
commit 67984e765c
1 changed files with 11 additions and 8 deletions

View File

@ -1575,6 +1575,12 @@ static switch_status_t parse_command(listener_t *listener, switch_event_t **even
if (!strncasecmp(cmd, "sendmsg", 7)) {
switch_core_session_t *session;
char *uuid = cmd + 7;
const char *async_var = switch_event_get_header(*event, "async");
int async = switch_test_flag(listener, LFLAG_ASYNC);
if (switch_true(async_var)) {
async = 1;
}
if (uuid) {
while (*uuid == ' ') {
@ -1592,14 +1598,11 @@ static switch_status_t parse_command(listener_t *listener, switch_event_t **even
uuid = switch_event_get_header(*event, "session-id");
}
if (switch_strlen_zero(uuid) && listener->session) {
const char *blocking = switch_event_get_header(*event, "blocking");
int async = switch_test_flag(listener, LFLAG_ASYNC);
if (blocking && switch_true(blocking)) {
async = 0;
if (uuid && listener->session && !strcmp(uuid, switch_core_session_get_uuid(listener->session))) {
uuid = NULL;
}
if (switch_strlen_zero(uuid) && listener->session) {
if (async) {
if ((status = switch_core_session_queue_private_event(listener->session, event)) == SWITCH_STATUS_SUCCESS) {
switch_snprintf(reply, reply_len, "+OK");