[Freeswitch-svn] [commit] r8517 - in freeswitch/trunk/src: . include

Freeswitch SVN mikej at freeswitch.org
Wed May 21 21:08:30 EDT 2008


Author: mikej
Date: Wed May 21 21:08:30 2008
New Revision: 8517

Modified:
   freeswitch/trunk/src/include/switch_types.h
   freeswitch/trunk/src/switch_core_session.c

Log:
add disable_app_log variable

Modified: freeswitch/trunk/src/include/switch_types.h
==============================================================================
--- freeswitch/trunk/src/include/switch_types.h	(original)
+++ freeswitch/trunk/src/include/switch_types.h	Wed May 21 21:08:30 2008
@@ -140,6 +140,7 @@
 #define SWITCH_EXEC_AFTER_BRIDGE_APP_VARIABLE "exec_after_bridge_app"
 #define SWITCH_EXEC_AFTER_BRIDGE_ARG_VARIABLE "exec_after_bridge_arg"
 #define SWITCH_MAX_FORWARDS_VARIABLE "max_forwards"
+#define SWITCH_DISABLE_APP_LOG_VARIABLE "disable_app_log"
 #define SWITCH_SPEECH_KEY "speech"
 #define SWITCH_UUID_BRIDGE "uuid_bridge"
 #define SWITCH_BITS_PER_BYTE 8

Modified: freeswitch/trunk/src/switch_core_session.c
==============================================================================
--- freeswitch/trunk/src/switch_core_session.c	(original)
+++ freeswitch/trunk/src/switch_core_session.c	Wed May 21 21:08:30 2008
@@ -1013,22 +1013,25 @@
 														 const switch_application_interface_t *application_interface, const char *arg) {
 	switch_app_log_t *log, *lp;
 	switch_event_t *event;
+	const char *var;
 
 	if (!arg) {
 		arg = "";
 	}
 
-	log = switch_core_session_alloc(session, sizeof(*log));
+	if (!(var = switch_channel_get_variable(session->channel, SWITCH_DISABLE_APP_LOG_VARIABLE)) || (!(switch_true(var)))) {
+		log = switch_core_session_alloc(session, sizeof(*log));
 
-	log->app = switch_core_session_strdup(session, application_interface->interface_name);
-	log->arg = switch_core_session_strdup(session, arg);
+		log->app = switch_core_session_strdup(session, application_interface->interface_name);
+		log->arg = switch_core_session_strdup(session, arg);
 
-	for(lp = session->app_log; lp && lp->next; lp = lp->next);
+		for(lp = session->app_log; lp && lp->next; lp = lp->next);
 
-	if (lp) {
-		lp->next = log;
-	} else {
-		session->app_log = log;
+		if (lp) {
+			lp->next = log;
+		} else {
+			session->app_log = log;
+		}
 	}
 	
 	if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_EXECUTE) == SWITCH_STATUS_SUCCESS) {



More information about the Freeswitch-svn mailing list