]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
tweak evnts
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 8 Oct 2008 14:22:55 +0000 (14:22 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 8 Oct 2008 14:22:55 +0000 (14:22 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9891 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_channel.c
src/switch_core_io.c

index 91ac11b2cd50e00e4fa23cc615b8bd1b2534bafc..88515f4e089103b211734650bb396db7403570c1 100644 (file)
@@ -1128,6 +1128,27 @@ SWITCH_DECLARE(void) switch_channel_event_set_data(switch_channel_t *channel, sw
                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Channel-Write-Codec-Name", switch_str_nil(codec->implementation->iananame));
                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-Write-Codec-Rate", "%u", codec->implementation->actual_samples_per_second);
        }
+       
+       /* Index Caller's Profile */
+       if (caller_profile) {
+               switch_caller_profile_event_set_data(caller_profile, "Caller", event);
+       }
+       
+       if (originator_caller_profile && originatee_caller_profile) {
+               /* Index Originator's Profile */
+               switch_caller_profile_event_set_data(originator_caller_profile, "Originator", event);
+               
+               /* Index Originatee's Profile */
+               switch_caller_profile_event_set_data(originatee_caller_profile, "Originatee", event);
+       } else {
+               /* Index Originator's Profile */
+               if (originator_caller_profile) {
+                       switch_caller_profile_event_set_data(originator_caller_profile, "Other-Leg", event);
+               } else if (originatee_caller_profile) { /* Index Originatee's Profile */
+                       switch_caller_profile_event_set_data(originatee_caller_profile, "Other-Leg", event);
+               }
+       }
+
 
        if (switch_test_flag(channel, CF_VERBOSE_EVENTS) || 
                event->event_id == SWITCH_EVENT_CHANNEL_ORIGINATE ||
@@ -1137,28 +1158,10 @@ SWITCH_DECLARE(void) switch_channel_event_set_data(switch_channel_t *channel, sw
                event->event_id == SWITCH_EVENT_CHANNEL_HANGUP ||
                event->event_id == SWITCH_EVENT_REQUEST_PARAMS ||
                event->event_id == SWITCH_EVENT_CHANNEL_DATA ||
+               event->event_id == SWITCH_EVENT_SESSION_HEARTBEAT ||
                event->event_id == SWITCH_EVENT_CUSTOM
                ) {
 
-               /* Index Caller's Profile */
-               if (caller_profile) {
-                       switch_caller_profile_event_set_data(caller_profile, "Caller", event);
-               }
-
-               if (originator_caller_profile && originatee_caller_profile) {
-                       /* Index Originator's Profile */
-                       switch_caller_profile_event_set_data(originator_caller_profile, "Originator", event);
-
-                       /* Index Originatee's Profile */
-                       switch_caller_profile_event_set_data(originatee_caller_profile, "Originatee", event);
-               } else {
-                       /* Index Originator's Profile */
-                       if (originator_caller_profile) {
-                               switch_caller_profile_event_set_data(originator_caller_profile, "Other-Leg", event);
-                       } else if (originatee_caller_profile) { /* Index Originatee's Profile */
-                               switch_caller_profile_event_set_data(originatee_caller_profile, "Other-Leg", event);
-                       }
-               }
                x = 0;
                /* Index Variables */
                if (channel->variables) {
index 5a7ef474b736198e18c6163ca918e1346088e4ee..c72e8636f58f60e9afefae2c156b8dfd0adb418d 100644 (file)
@@ -106,7 +106,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
        switch_status_t status;
        int need_codec, perfect, do_bugs = 0, do_resample = 0, is_cng = 0;
        unsigned int flag = 0;
-       switch_event_header_t *hi;
 
        switch_assert(session != NULL);
 
@@ -131,26 +130,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
 
                        switch_event_create(&event, SWITCH_EVENT_SESSION_HEARTBEAT);
                        switch_channel_event_set_data(session->channel, event);
-                       if (!switch_channel_test_flag(session->channel, CF_VERBOSE_EVENTS)) {
-                               if ((hi = switch_channel_variable_first(session->channel))) {
-                                       for (; hi; hi = hi->next) {
-                                               char buf[1024] = "";
-                                               char *vvar = NULL, *vval = NULL;
-                                               
-                                               if (strncasecmp(hi->name, "hb_", 3)) {
-                                                       continue;
-                                               }
-                                               
-                                               vvar = (char *) hi->name;
-                                               vval = (char *) hi->value;
-                                               
-                                               switch_assert(vvar && vval);
-                                               switch_snprintf(buf, sizeof(buf), "variable_%s", vvar);
-                                               switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, buf, vval);
-                                       }
-                                       switch_channel_variable_last(session->channel);
-                               }
-                       }
                        switch_event_fire(&event);
                } else {
                        session->read_frame_count--;