[Freeswitch-svn] [commit] r8027 - freeswitch/trunk/src

Freeswitch SVN mikej at freeswitch.org
Fri Apr 4 17:36:04 EDT 2008


Author: mikej
Date: Fri Apr  4 17:36:04 2008
New Revision: 8027

Modified:
   freeswitch/trunk/src/switch_core_session.c

Log:
build tweaks

Modified: freeswitch/trunk/src/switch_core_session.c
==============================================================================
--- freeswitch/trunk/src/switch_core_session.c	(original)
+++ freeswitch/trunk/src/switch_core_session.c	Fri Apr  4 17:36:04 2008
@@ -980,15 +980,18 @@
 		}
 	}
 
-	if ((expanded = switch_channel_expand_variables(session->channel, arg)) != arg) {
+	if (arg && (expanded = switch_channel_expand_variables(session->channel, arg)) != arg) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Expanded String %s(%s)\n", switch_channel_get_name(session->channel), app, expanded);
 	}
 
 	if (switch_channel_get_variable(session->channel, "presence_id")) {
-		char *arg = switch_mprintf("%s(%s)", app, expanded);
-		if (arg) {
-			switch_channel_presence(session->channel, "unknown", arg);
-			switch_safe_free(arg);
+		char *myarg = NULL;
+		if (expanded) {
+			switch_mprintf("%s(%s)", app, expanded);
+		}
+		if (myarg) {
+			switch_channel_presence(session->channel, "unknown", myarg);
+			switch_safe_free(myarg);
 		}
 	}
 



More information about the Freeswitch-svn mailing list