]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
SFSIP-92 add support to send a notify in the invite dialog by specifying the uuid...
authorMichael Jerris <mike@jerris.com>
Thu, 11 Dec 2008 20:24:31 +0000 (20:24 +0000)
committerMichael Jerris <mike@jerris.com>
Thu, 11 Dec 2008 20:24:31 +0000 (20:24 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10717 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.c

index 21bd84391a883b2e85d87d5f40a3d2dca02a3dae..86f4d558c10109aecf26fee195be4a71135444f3 100644 (file)
@@ -2598,10 +2598,26 @@ static void general_event_handler(switch_event_t *event)
                        const char *user = switch_event_get_header(event, "user");
                        const char *host = switch_event_get_header(event, "host");
                        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);
                        sofia_profile_t *profile;
 
-                       if (profile_name && ct && es && user && host && (profile = sofia_glue_find_profile(profile_name))) {
+                       if (uuid && ct && es) {
+                               switch_core_session_t *session;
+                               private_object_t *tech_pvt;
+
+                               if ((session = switch_core_session_locate(uuid))) {
+                                       if ((tech_pvt = switch_core_session_get_private(session))) {
+                                               nua_notify(tech_pvt->nh,
+                                                                  NUTAG_NEWSUB(1),
+                                                                  SIPTAG_EVENT_STR(es), 
+                                                                  SIPTAG_CONTENT_TYPE_STR(ct), 
+                                                                  TAG_IF(!switch_strlen_zero(body), SIPTAG_PAYLOAD_STR(body)),
+                                                                  TAG_END());
+                                       }
+                                       switch_core_session_rwunlock(session);
+                               }
+                       } else if (profile_name && ct && es && user && host && (profile = sofia_glue_find_profile(profile_name))) {
                                char *sql;
 
                                if (call_id) {