[Freeswitch-svn] [commit] r4014 - freeswitch/trunk/src/mod/event_handlers/mod_event_socket

Freeswitch SVN anthm at freeswitch.org
Sun Jan 21 14:36:55 EST 2007


Author: anthm
Date: Sun Jan 21 14:36:55 2007
New Revision: 4014

Modified:
   freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c

Log:
let bgapi choose your own id

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	Sun Jan 21 14:36:55 2007
@@ -760,6 +760,7 @@
 		struct api_command_struct *acs;
 		char *api_cmd = cmd + 6;
 		char *arg = NULL;
+        char *uuid_str = NULL;
 		strip_cr(api_cmd);
 
 		if ((arg = strchr(api_cmd, ' '))) {
@@ -784,8 +785,12 @@
 			switch_threadattr_detach_set(thd_attr, 1);
 			switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
 			switch_thread_create(&thread, thd_attr, api_exec, acs, listener->pool);
-			switch_uuid_get(&uuid);
-			switch_uuid_format(acs->uuid_str, &uuid);
+			if ((uuid_str = switch_event_get_header(event, "job-uuid"))) {
+                switch_copy_string(acs->uuid_str, uuid_str, sizeof(acs->uuid_str));
+            } else {
+                switch_uuid_get(&uuid);
+                switch_uuid_format(acs->uuid_str, &uuid);
+            }
 			snprintf(reply, reply_len, "+OK Job-UUID: %s", acs->uuid_str);
 		} else {
 			snprintf(reply, reply_len, "-ERR memory error!");



More information about the Freeswitch-svn mailing list