]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
arbitrary notify
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 29 Apr 2009 03:37:30 +0000 (03:37 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 29 Apr 2009 03:37:30 +0000 (03:37 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13187 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.c

index f2b61237e5cd72a5d3abf5cd2953d99fdd13161b..0476744c408016164ce9068573fc7f9bf0930ad2 100644 (file)
@@ -2803,8 +2803,34 @@ static void general_event_handler(switch_event_t *event)
                        const char *call_id = switch_event_get_header(event, "call-id");
                        const char *uuid = switch_event_get_header(event, "uuid");
                        const char *body = switch_event_get_body(event);
+                       const char *to_uri = switch_event_get_header(event, "to-uri");
+                       const char *from_uri = switch_event_get_header(event, "from-uri");
                        sofia_profile_t *profile;
 
+                       if (to_uri && from_uri && ct && es && profile_name && (profile = sofia_glue_find_profile(profile_name))) {
+                               nua_handle_t *nh = nua_handle(profile->nua, 
+                                                                                         NULL, 
+                                                                                         NUTAG_URL(to_uri), 
+                                                                                         SIPTAG_FROM_STR(from_uri), 
+                                                                                         SIPTAG_TO_STR(to_uri), 
+                                                                                         SIPTAG_CONTACT_STR(profile->url), 
+                                                                                         TAG_END());
+                               
+                               nua_handle_bind(nh, &mod_sofia_globals.destroy_private);
+                               
+                               nua_info(nh,
+                                                NUTAG_WITH_THIS(profile->nua),
+                                                TAG_IF(ct, SIPTAG_CONTENT_TYPE_STR(ct)),
+                                                TAG_IF(!switch_strlen_zero(body), SIPTAG_PAYLOAD_STR(body)),
+                                                TAG_END());
+                               
+
+
+                               sofia_glue_release_profile(profile);
+                               return;
+                               
+                       }
+                       
                        if (uuid && ct && es) {
                                switch_core_session_t *session;
                                private_object_t *tech_pvt;