]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
If the notify event contains call-info headers, then process the call-info linked...
authorWilliam King <william.king@quentustech.com>
Fri, 4 May 2012 17:07:08 +0000 (10:07 -0700)
committerWilliam King <william.king@quentustech.com>
Fri, 4 May 2012 17:07:08 +0000 (10:07 -0700)
src/mod/endpoints/mod_sofia/sofia.c

index eb50fda2f2ce3f955cf9d4f20fafd5dae904cb91..7ae868ef627bb81c969b94e103ca96a173c3e3bd 100644 (file)
@@ -476,6 +476,26 @@ void sofia_handle_sip_i_notify(switch_core_session_t *session, int status,
                switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "profile_name", sofia_private->gateway->profile->name);
                switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "profile_uri", sofia_private->gateway->profile->url);
                switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "gateway_name", sofia_private->gateway->name);
+               if ( sip->sip_call_info != NULL ) {
+                       sip_call_info_t *call_info = sip->sip_call_info;
+                       int cur_len = 0;
+                       char *tmp = NULL;
+                       char *hold = strdup(sip_header_as_string(nua_handle_home(nh), (void *) call_info));
+                       cur_len = strlen(hold);
+
+                       while ( call_info->ci_next != NULL) {
+                               call_info = call_info->ci_next;
+                               tmp = strdup(sip_header_as_string(nua_handle_home(nh), (void *) call_info));
+                               cur_len = cur_len + strlen(tmp) +2;
+                               hold = realloc(hold, cur_len);
+                               switch_assert(hold);
+                               strcat(hold,",");
+                               strcat(hold, tmp);
+                               free(tmp);
+                       }
+                       switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "Call-Info", hold);
+                       free(hold);
+               }
                switch_event_fire(&s_event);
                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "dispatched freeswitch event for message-summary NOTIFY\n");
        } else {