[Freeswitch-svn] [commit] r2425 - in freeswitch/trunk/src: . include
Freeswitch SVN
anthm at freeswitch.org
Tue Aug 29 11:17:07 EDT 2006
Author: anthm
Date: Tue Aug 29 11:17:06 2006
New Revision: 2425
Modified:
freeswitch/trunk/src/include/switch_types.h
freeswitch/trunk/src/switch_channel.c
freeswitch/trunk/src/switch_core.c
freeswitch/trunk/src/switch_event.c
Log:
add some events
Modified: freeswitch/trunk/src/include/switch_types.h
==============================================================================
--- freeswitch/trunk/src/include/switch_types.h (original)
+++ freeswitch/trunk/src/include/switch_types.h Tue Aug 29 11:17:06 2006
@@ -559,6 +559,8 @@
SWITCH_EVENT_DTMF - DTMF was sent
SWITCH_EVENT_MESSAGE - A Basic Message
SWITCH_EVENT_CODEC - Codec Change
+ SWITCH_EVENT_PROGRESS - Early Media
+ SWITCH_EVENT_OUTGOING - Outgoing Channel
SWITCH_EVENT_ALL - All events at once
</pre>
@@ -573,6 +575,8 @@
SWITCH_EVENT_CHANNEL_EXECUTE,
SWITCH_EVENT_CHANNEL_BRIDGE,
SWITCH_EVENT_CHANNEL_UNBRIDGE,
+ SWITCH_EVENT_CHANNEL_PROGRESS,
+ SWITCH_EVENT_CHANNEL_OUTGOING,
SWITCH_EVENT_API,
SWITCH_EVENT_LOG,
SWITCH_EVENT_INBOUND_CHAN,
Modified: freeswitch/trunk/src/switch_channel.c
==============================================================================
--- freeswitch/trunk/src/switch_channel.c (original)
+++ freeswitch/trunk/src/switch_channel.c Tue Aug 29 11:17:06 2006
@@ -877,7 +877,7 @@
switch_core_session_message_t msg;
char *uuid = switch_core_session_get_uuid(channel->session);
switch_status_t status;
-
+
assert(channel != NULL);
if (channel->state >= CS_HANGUP) {
@@ -893,8 +893,14 @@
status = switch_core_session_message_send(uuid, &msg);
if (status == SWITCH_STATUS_SUCCESS) {
+ switch_event_t *event;
+
switch_log_printf(SWITCH_CHANNEL_ID_LOG, (char *) file, func, line, SWITCH_LOG_NOTICE, "Pre-Answer %s!\n", channel->name);
switch_channel_set_flag(channel, CF_EARLY_MEDIA);
+ if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_PROGRESS) == SWITCH_STATUS_SUCCESS) {
+ switch_channel_event_set_data(channel, event);
+ switch_event_fire(&event);
+ }
}
return status;
Modified: freeswitch/trunk/src/switch_core.c
==============================================================================
--- freeswitch/trunk/src/switch_core.c (original)
+++ freeswitch/trunk/src/switch_core.c Tue Aug 29 11:17:06 2006
@@ -1075,6 +1075,8 @@
if (*new_session) {
switch_caller_profile_t *profile = NULL, *peer_profile = NULL, *cloned_profile = NULL;
switch_channel_t *peer_channel = NULL;
+ switch_event_t *event;
+ switch_channel_t *new_channel = switch_core_session_get_channel(*new_session);
if (session && channel) {
profile = switch_channel_get_caller_profile(channel);
@@ -1094,6 +1096,11 @@
switch_channel_set_originatee_caller_profile(channel, cloned_profile);
}
}
+ }
+
+ if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_OUTGOING) == SWITCH_STATUS_SUCCESS) {
+ switch_channel_event_set_data(new_channel, event);
+ switch_event_fire(&event);
}
}
Modified: freeswitch/trunk/src/switch_event.c
==============================================================================
--- freeswitch/trunk/src/switch_event.c (original)
+++ freeswitch/trunk/src/switch_event.c Tue Aug 29 11:17:06 2006
@@ -99,6 +99,8 @@
"CHANNEL_EXECUTE",
"CHANNEL_BRIDGE",
"CHANNEL_UNBRIDGE",
+ "CHANNEL_PROGRESS",
+ "CHANNEL_OUTGOING",
"API",
"LOG",
"INBOUND_CHAN",
More information about the Freeswitch-svn
mailing list