[commit] r10651 - in freeswitch/trunk/src/mod: endpoints/mod_sofia event_handlers/mod_event_socket
Author: anthm Date: Mon Dec 8 10:28:01 2008 New Revision: 10651 Log: difference between invalid uuid and no uuid Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c Mon Dec 8 10:28:01 2008 @@ -1533,10 +1533,6 @@ switch_assert(sql != NULL); sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE); - if (exp_raw >= 180) { - exp_raw -= 120; - } - sstr = switch_mprintf("active;expires=%ld", exp_raw); } Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c ============================================================================== --- freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c (original) +++ freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c Mon Dec 8 10:28:01 2008 @@ -1228,7 +1228,8 @@ } else if (listener->session && !strncasecmp(cmd, "sendmsg", 7)) { char *uuid = cmd + 8; switch_core_session_t *session = NULL; - + switch_bool_t uuid_supplied = SWITCH_FALSE; + if (uuid) { while (*uuid == ' ') { uuid++; @@ -1245,7 +1246,11 @@ 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) { switch_snprintf(reply, reply_len, "+OK"); } else { @@ -1254,10 +1259,14 @@ switch_core_session_rwunlock(session); } else { if (switch_test_flag(listener, LFLAG_ASYNC)) { - if ((status = switch_core_session_queue_private_event(listener->session, event)) == SWITCH_STATUS_SUCCESS) { - switch_snprintf(reply, reply_len, "+OK"); + if (!uuid_supplied) { + switch_snprintf(reply, reply_len, "-ERR invalid session id [%s]", switch_str_nil(uuid)); } else { - switch_snprintf(reply, reply_len, "-ERR memory error"); + if ((status = switch_core_session_queue_private_event(listener->session, event)) == SWITCH_STATUS_SUCCESS) { + switch_snprintf(reply, reply_len, "+OK"); + } else { + switch_snprintf(reply, reply_len, "-ERR memory error"); + } } } else { switch_ivr_parse_event(listener->session, *event);
participants (1)
-
FreeSWITCH SVN