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

Freeswitch SVN anthm at freeswitch.org
Thu Jun 5 16:45:03 EDT 2008


Author: anthm
Date: Thu Jun  5 16:45:03 2008
New Revision: 8774

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

Log:
add ctrix's patch


Modified: freeswitch/trunk/src/include/switch_types.h
==============================================================================
--- freeswitch/trunk/src/include/switch_types.h	(original)
+++ freeswitch/trunk/src/include/switch_types.h	Thu Jun  5 16:45:03 2008
@@ -102,6 +102,7 @@
 #define SWITCH_URL_SEPARATOR "://"
 #define SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE "proto_specific_hangup_cause"
 #define SWITCH_CHANNEL_EXECUTE_ON_ANSWER_VARIABLE "execute_on_answer"
+#define SWITCH_CHANNEL_EXECUTE_ON_RING_VARIABLE "execute_on_ring"
 #define SWITCH_CALL_TIMEOUT_VARIABLE "call_timeout"
 #define SWITCH_HOLDING_UUID_VARIABLE "holding_uuid"
 #define SWITCH_API_BRIDGE_END_VARIABLE "api_after_bridge"

Modified: freeswitch/trunk/src/switch_channel.c
==============================================================================
--- freeswitch/trunk/src/switch_channel.c	(original)
+++ freeswitch/trunk/src/switch_channel.c	Thu Jun  5 16:45:03 2008
@@ -1369,6 +1369,9 @@
 
 SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_ring_ready(switch_channel_t *channel, const char *file, const char *func, int line)
 {
+	const char *var;
+	char *app;
+
 	if (!switch_channel_test_flag(channel, CF_RING_READY)) {
 		switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_NOTICE, "Ring-Ready %s!\n", channel->name);
 		switch_channel_set_flag(channel, CF_RING_READY);
@@ -1377,6 +1380,18 @@
 			channel->caller_profile->times->progress = switch_timestamp_now();
 			switch_mutex_unlock(channel->profile_mutex);
 		}
+
+		var = switch_channel_get_variable(channel, SWITCH_CHANNEL_EXECUTE_ON_RING_VARIABLE);
+		if (var) {
+			char *arg = NULL;
+			app = switch_core_session_strdup(channel->session, var);
+			if ((arg = strchr(app, ' '))) {
+				*arg++ = '\0';
+			}
+			switch_core_session_execute_application(channel->session, app, arg);
+		}
+
+
 		return SWITCH_STATUS_SUCCESS;
 	}
 



More information about the Freeswitch-svn mailing list