]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add some events
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 29 Aug 2006 15:17:06 +0000 (15:17 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 29 Aug 2006 15:17:06 +0000 (15:17 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2425 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_types.h
src/switch_channel.c
src/switch_core.c
src/switch_event.c

index 86f4c02c920674c5a047d10752803265b872dce2..906c7caf5903f82766c1fd98ed18a205974a841f 100644 (file)
@@ -559,6 +559,8 @@ typedef enum {
        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 @@ typedef enum {
        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,
index 374fff3f2767bc1fa33b2391b9021d2d0c018670..e10fd6919255528657246dd04c2147e7eff0a674 100644 (file)
@@ -877,7 +877,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_pre_answer(switch_channel
        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 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_pre_answer(switch_channel
        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;
index 9d878215458844ec0c0572b8e30b97cf6120eb90..ed7417a01fb68cceb41a07308ee8f12e8158fa7f 100644 (file)
@@ -1075,6 +1075,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_outgoing_channel(switch_core
        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);
@@ -1095,6 +1097,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_outgoing_channel(switch_core
                                }
                        }
                }
+
+               if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_OUTGOING) == SWITCH_STATUS_SUCCESS) {
+                       switch_channel_event_set_data(new_channel, event);
+                       switch_event_fire(&event);
+               }
        }
 
        return status;
index 40e2b829b3605fe125da64c73c718aab27c7f094..6cdfedf4420ededdfef0860c0f05c832fcb9e04d 100644 (file)
@@ -99,6 +99,8 @@ static char *EVENT_NAMES[] = {
        "CHANNEL_EXECUTE",
        "CHANNEL_BRIDGE",
        "CHANNEL_UNBRIDGE",
+       "CHANNEL_PROGRESS",
+       "CHANNEL_OUTGOING",
        "API",
        "LOG",
        "INBOUND_CHAN",