difference between invalid uuid and no uuid
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10651 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
d406a03ad3
commit
797185642e
|
@ -1533,10 +1533,6 @@ void sofia_presence_handle_sip_i_subscribe(int status,
|
||||||
switch_assert(sql != NULL);
|
switch_assert(sql != NULL);
|
||||||
sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
|
sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
|
||||||
|
|
||||||
if (exp_raw >= 180) {
|
|
||||||
exp_raw -= 120;
|
|
||||||
}
|
|
||||||
|
|
||||||
sstr = switch_mprintf("active;expires=%ld", exp_raw);
|
sstr = switch_mprintf("active;expires=%ld", exp_raw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1228,6 +1228,7 @@ static switch_status_t parse_command(listener_t *listener, switch_event_t **even
|
||||||
} else if (listener->session && !strncasecmp(cmd, "sendmsg", 7)) {
|
} else if (listener->session && !strncasecmp(cmd, "sendmsg", 7)) {
|
||||||
char *uuid = cmd + 8;
|
char *uuid = cmd + 8;
|
||||||
switch_core_session_t *session = NULL;
|
switch_core_session_t *session = NULL;
|
||||||
|
switch_bool_t uuid_supplied = SWITCH_FALSE;
|
||||||
|
|
||||||
if (uuid) {
|
if (uuid) {
|
||||||
while (*uuid == ' ') {
|
while (*uuid == ' ') {
|
||||||
|
@ -1245,7 +1246,11 @@ static switch_status_t parse_command(listener_t *listener, switch_event_t **even
|
||||||
uuid = switch_event_get_header(*event, "session-id");
|
uuid = switch_event_get_header(*event, "session-id");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uuid && (session = switch_core_session_locate(uuid))) {
|
if (uuid) {
|
||||||
|
uuid_supplied = SWITCH_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (uuid_supplied && (session = switch_core_session_locate(uuid))) {
|
||||||
if ((status = switch_core_session_queue_private_event(session, event)) == SWITCH_STATUS_SUCCESS) {
|
if ((status = switch_core_session_queue_private_event(session, event)) == SWITCH_STATUS_SUCCESS) {
|
||||||
switch_snprintf(reply, reply_len, "+OK");
|
switch_snprintf(reply, reply_len, "+OK");
|
||||||
} else {
|
} else {
|
||||||
|
@ -1254,11 +1259,15 @@ static switch_status_t parse_command(listener_t *listener, switch_event_t **even
|
||||||
switch_core_session_rwunlock(session);
|
switch_core_session_rwunlock(session);
|
||||||
} else {
|
} else {
|
||||||
if (switch_test_flag(listener, LFLAG_ASYNC)) {
|
if (switch_test_flag(listener, LFLAG_ASYNC)) {
|
||||||
|
if (!uuid_supplied) {
|
||||||
|
switch_snprintf(reply, reply_len, "-ERR invalid session id [%s]", switch_str_nil(uuid));
|
||||||
|
} else {
|
||||||
if ((status = switch_core_session_queue_private_event(listener->session, event)) == SWITCH_STATUS_SUCCESS) {
|
if ((status = switch_core_session_queue_private_event(listener->session, event)) == SWITCH_STATUS_SUCCESS) {
|
||||||
switch_snprintf(reply, reply_len, "+OK");
|
switch_snprintf(reply, reply_len, "+OK");
|
||||||
} else {
|
} else {
|
||||||
switch_snprintf(reply, reply_len, "-ERR memory error");
|
switch_snprintf(reply, reply_len, "-ERR memory error");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
switch_ivr_parse_event(listener->session, *event);
|
switch_ivr_parse_event(listener->session, *event);
|
||||||
switch_snprintf(reply, reply_len, "+OK");
|
switch_snprintf(reply, reply_len, "+OK");
|
||||||
|
|
Loading…
Reference in New Issue