]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
parse out alert-info and call-info from infos
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 27 Apr 2009 23:36:03 +0000 (23:36 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 27 Apr 2009 23:36:03 +0000 (23:36 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13173 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.h
src/mod/endpoints/mod_sofia/sofia.c

index 89743ca281b95868942d737beba2e71119457ff4..71e0d5e6d82a4b46a990f56369e2f6bc1c2512f5 100644 (file)
@@ -2908,6 +2908,8 @@ static void general_event_handler(switch_event_t *event)
                        const char *to_uri = switch_event_get_header(event, "to-uri");
                        const char *local_user_full = switch_event_get_header(event, "local-user");
                        const char *from_uri = switch_event_get_header(event, "from-uri");
+                       const char *call_info = switch_event_get_header(event, "call-info");
+                       const char *alert_info = switch_event_get_header(event, "alert-info");
                        const char *body = switch_event_get_body(event);
                        sofia_profile_t *profile = NULL;
                        nua_handle_t *nh;
@@ -2972,7 +2974,9 @@ static void general_event_handler(switch_event_t *event)
 
                        nua_info(nh,
                                         NUTAG_WITH_THIS(profile->nua),
-                                        TAG_IF(ct, SIPTAG_CONTENT_TYPE_STR(ct)), 
+                                        TAG_IF(ct, SIPTAG_CONTENT_TYPE_STR(ct)),
+                                        TAG_IF(alert_info, SIPTAG_ALERT_INFO_STR(alert_info)),
+                                        TAG_IF(call_info, SIPTAG_ALERT_INFO_STR(call_info)),
                                         TAG_IF(!switch_strlen_zero(body), SIPTAG_PAYLOAD_STR(body)),
                                         TAG_END());
 
index 544df65ed9f31111c74265da8a76b6f06702fb42..6ccd286ca5c5c88646e0601de354c4c6eb105493 100644 (file)
@@ -107,6 +107,10 @@ typedef struct private_object private_object_t;
 #include <sofia-sip/tport_tag.h>
 #include <sofia-sip/sip_extra.h>
 #include "nua_stack.h"
+#include "sofia-sip/msg_parser.h"
+#include "sofia-sip/sip_parser.h"
+#include "sofia-sip/tport_tag.h"
+
 
 typedef enum {
        DTMF_2833,
index 42f892b347436b64f1f0ed89918616ff17337371..cf05ca10a7435be0944861ec555f5a66bf342304 100644 (file)
@@ -35,9 +35,7 @@
  *
  */
 #include "mod_sofia.h"
-#include "sofia-sip/msg_parser.h"
-#include "sofia-sip/sip_extra.h"
-#include "sofia-sip/tport_tag.h"
+
 
 extern su_log_t tport_log[];
 extern su_log_t iptsec_log[];
@@ -4010,7 +4008,8 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t
 
 
        if (switch_event_create(&event, SWITCH_EVENT_RECV_INFO) == SWITCH_STATUS_SUCCESS) {
-               
+               sip_alert_info_t *alert_info = sip_alert_info(sip);
+
                if (sip && sip->sip_content_type) {
                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "SIP-Content-Type", sip->sip_content_type->c_type);
                }
@@ -4046,6 +4045,16 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t
                        }
                }
 
+
+               if (sip->sip_call_info) {
+                       switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Call-Info", sip_header_as_string(nua_handle_home(nh), (void *) sip->sip_call_info));
+               }
+
+               if (alert_info) {
+                       switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Alert-Info", sip_header_as_string(nua_handle_home(nh), (void *) alert_info));
+               }
+
+
                if (sip->sip_payload && sip->sip_payload->pl_data) {
                        switch_event_add_body(event, "%s", sip->sip_payload->pl_data);
                }