[Freeswitch-svn] [commit] r6613 - in freeswitch/trunk/src: . mod/event_handlers/mod_cdr_csv

Freeswitch SVN anthm at freeswitch.org
Mon Dec 10 18:49:30 EST 2007


Author: anthm
Date: Mon Dec 10 18:49:30 2007
New Revision: 6613

Modified:
   freeswitch/trunk/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c
   freeswitch/trunk/src/switch_ivr_originate.c

Log:
update to originate syntax

Modified: freeswitch/trunk/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c	Mon Dec 10 18:49:30 2007
@@ -156,7 +156,7 @@
 static switch_status_t my_on_hangup(switch_core_session_t *session)
 {
 	switch_channel_t *channel = switch_core_session_get_channel(session);
-	switch_status_t status = SWITCH_STATUS_FALSE;
+	switch_status_t status = SWITCH_STATUS_SUCCESS;
 	const char *log_dir = NULL, *accountcode = NULL, *cid_buf = NULL, *a_template_str = NULL, *g_template_str = NULL;
 	char *log_line, *path = NULL;	
 	switch_caller_profile_t *caller_profile, *ocp;

Modified: freeswitch/trunk/src/switch_ivr_originate.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_originate.c	(original)
+++ freeswitch/trunk/src/switch_ivr_originate.c	Mon Dec 10 18:49:30 2007
@@ -351,7 +351,7 @@
 		if ((var_count = switch_separate_string(vars, ',', var_array, (sizeof(var_array) / sizeof(var_array[0]))))) {
 			int x = 0;
 			for (x = 0; x < var_count; x++) {
-				char *inner_var_array[2];
+				char *inner_var_array[2] = { 0 };
 				int inner_var_count;
 				if ((inner_var_count =
 					 switch_separate_string(var_array[x], '=', inner_var_array, (sizeof(inner_var_array) / sizeof(inner_var_array[0])))) == 2) {
@@ -559,39 +559,37 @@
 				assert(peer_channels[i] != NULL);
 
 
+				if (var_event) {
+					switch_event_t *event;
+					switch_event_header_t *header;
+					/* install the vars from the {} params */
+					for (header = var_event->headers; header; header = header->next) {
+						switch_channel_set_variable(peer_channels[i], header->name, header->value);
+					}
+					switch_event_create(&event, SWITCH_EVENT_CHANNEL_ORIGINATE);
+					assert(event);
+					switch_channel_event_set_data(peer_channels[i], event);
+					switch_event_fire(&event);
+				}
+
 				if (vdata) {
 					char *var_array[1024] = { 0 };
 					int var_count = 0;
 					if ((var_count = switch_separate_string(vdata, ',', var_array, (sizeof(var_array) / sizeof(var_array[0]))))) {
 						int x = 0;
 						for (x = 0; x < var_count; x++) {
-							char *inner_var_array[2];
+							char *inner_var_array[2] = { 0 };
 							int inner_var_count;
 							if ((inner_var_count =
 								 switch_separate_string(var_array[x], '=', 
 														inner_var_array, (sizeof(inner_var_array) / sizeof(inner_var_array[0])))) == 2) {
 								
 								switch_channel_set_variable(peer_channels[i], inner_var_array[0], inner_var_array[1]);
-								
 							}
 						}
 					}
 				}
-
 				
-				if (var_event) {
-					switch_event_t *event;
-					switch_event_header_t *header;
-					/* install the vars from the {} params */
-					for (header = var_event->headers; header; header = header->next) {
-						switch_channel_set_variable(peer_channels[i], header->name, header->value);
-					}
-					switch_event_create(&event, SWITCH_EVENT_CHANNEL_ORIGINATE);
-					assert(event);
-					switch_channel_event_set_data(peer_channels[i], event);
-					switch_event_fire(&event);
-				}
-
 				if (!table) {
 					table = &originate_state_handlers;
 				}



More information about the Freeswitch-svn mailing list