]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FSCORE-308
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 24 Feb 2009 00:05:19 +0000 (00:05 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 24 Feb 2009 00:05:19 +0000 (00:05 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12257 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_channel.c
src/switch_core_session.c
src/switch_core_sqldb.c

index 5dc6f8e5dd58b2041223401d0a4ac986fcd44d0c..4ff1ebb082ebe0dc135b400f6574495df753d5ce 100644 (file)
@@ -982,7 +982,9 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_set_running_state(
                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Channel-Name", channel->name);
                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Unique-ID", switch_core_session_get_uuid(channel->session));
                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Call-Direction",
-                                                                               switch_channel_test_flag(channel, CF_OUTBOUND) ? "outbound" : "inbound");
+                                                                                          channel->direction == SWITCH_CALL_DIRECTION_OUTBOUND ? "outbound" : "inbound");
+                               switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Presence-Call-Direction",
+                                                                                          channel->direction == SWITCH_CALL_DIRECTION_OUTBOUND ? "outbound" : "inbound");
                                if (switch_channel_test_flag(channel, CF_ANSWERED)) {
                                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Answer-State", "answered");
                                } else if (switch_channel_test_flag(channel, CF_EARLY_MEDIA)) {
@@ -1230,8 +1232,13 @@ SWITCH_DECLARE(void) switch_channel_event_set_basic_data(switch_channel_t *chann
        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Channel-State-Number", state_num);
        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Channel-Name", switch_channel_get_name(channel));
        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Unique-ID", switch_core_session_get_uuid(channel->session));
+       
+       switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Call-Direction",
+                                                                  channel->direction == SWITCH_CALL_DIRECTION_OUTBOUND ? "outbound" : "inbound");
+       switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Presence-Call-Direction",
+                                                                  channel->direction == SWITCH_CALL_DIRECTION_OUTBOUND ? "outbound" : "inbound");
+
 
-       switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Call-Direction", switch_channel_test_flag(channel, CF_OUTBOUND) ? "outbound" : "inbound");
        if (switch_channel_test_flag(channel, CF_ANSWERED)) {
                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Answer-State", "answered");
        } else if (switch_channel_test_flag(channel, CF_EARLY_MEDIA)) {
index ba866db1ec3652b09bdbea16f3c6b29c397ba0cf..11a0d31ae7107a2af16aceb31b4c6ae6692e5e05 100644 (file)
@@ -269,8 +269,6 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_
 
                switch_assert(channel != NULL);
 
-               switch_channel_set_flag(channel, CF_OUTBOUND);
-
                forwardvar = switch_channel_get_variable(channel, SWITCH_MAX_FORWARDS_VARIABLE);
                if (!switch_strlen_zero(forwardvar)) {
                        forwardval = atoi(forwardvar) - 1;
@@ -1100,12 +1098,12 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request_uuid(switch_
                abort();
        }
 
+       switch_channel_init(session->channel, session, CS_NEW, 0);
+
        if (direction == SWITCH_CALL_DIRECTION_OUTBOUND) {
                switch_channel_set_flag(session->channel, CF_OUTBOUND);
        }
-
-       switch_channel_init(session->channel, session, CS_NEW, 0);
-
+       
        /* The session *IS* the pool you may not alter it because you have no idea how
           its all private it will be passed to the thread run function */
 
index 1f459382f793452f13ec8f0444af4e2bb8fd796a..029707ce85478402c5ddb6acf4fc5699c03a1681 100644 (file)
@@ -285,7 +285,7 @@ static void core_event_handler(switch_event_t *event)
                                                         switch_event_get_header_nil(event, "channel-state"),
                                                         switch_event_get_header_nil(event, "caller-dialplan"),
                                                         switch_event_get_header_nil(event, "caller-context")
-                       );
+                                                        );
                break;
        case SWITCH_EVENT_CODEC:
                sql =