[Freeswitch-trunk] [commit] r12759 - freeswitch/trunk/src/mod/event_handlers/mod_event_socket
FreeSWITCH SVN
anthm at freeswitch.org
Tue Mar 24 11:01:58 PDT 2009
Author: anthm
Date: Tue Mar 24 13:01:58 2009
New Revision: 12759
Log:
change blocking: true to async: true you can start with blocking and go async but not the other way around
Modified:
freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
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 Tue Mar 24 13:01:58 2009
@@ -1575,7 +1575,13 @@
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 == ' ') {
uuid++;
@@ -1592,14 +1598,11 @@
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");
More information about the Freeswitch-trunk
mailing list