]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 4 Aug 2008 22:51:03 +0000 (22:51 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 4 Aug 2008 22:51:03 +0000 (22:51 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9222 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_conference/mod_conference.c
src/mod/endpoints/mod_sofia/sofia_presence.c

index abd2f044b2440e2f131564086fe8488164d9e79d..9071e5d6761dcc5924f638f317ec612c86376997 100644 (file)
@@ -4718,8 +4718,11 @@ static switch_status_t chat_send(char *proto, char *from, char *to, char *subjec
                }
 #endif
        }
+
        switch_safe_free(lbuf);
-       ci->chat_send(CONF_CHAT_PROTO, to, from, "", stream.data, NULL);
+       
+       ci->chat_send(CONF_CHAT_PROTO, to, hint && strchr(hint, '/') ? hint : from, "", stream.data, NULL);
+       //ci->chat_send(CONF_CHAT_PROTO, to, from, "", stream.data, NULL);
        switch_safe_free(stream.data);
 
        return SWITCH_STATUS_SUCCESS;
index 9a0511b93ba64f65f9872e52b4990d4899ddc762..94f570497cfb3550701d4ea42aa5fde59d946554 100644 (file)
@@ -1653,7 +1653,7 @@ void sofia_presence_handle_sip_i_message(int status,
                                switch_copy_string(proto, to_user, sizeof(proto));
                                p = strchr(proto, '+');
                                *p++ = '\0';
-
+                               
                                if ((to_addr = strdup(p))) {
                                        if ((p = strchr(to_addr, '+'))) {
                                                *p = '@';
@@ -1665,18 +1665,21 @@ void sofia_presence_handle_sip_i_message(int status,
 
                        from_addr = switch_mprintf("%s@%s", from_user, from_host);
 
+
                        sofia_presence_set_hash_key(hash_key, sizeof(hash_key), sip);
                        if ((tech_pvt = (private_object_t *) switch_core_hash_find(profile->chat_hash, hash_key))) {
                                channel = switch_core_session_get_channel(tech_pvt->session);
                                if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
                                        switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", SOFIA_CHAT_PROTO);
                                        switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->url);
-                                       switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", tech_pvt->hash_key);
+                                       switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", from_addr);
+                                       switch_event_add_header(event, SWITCH_STACK_BOTTOM, "hint", "%s", full_from);
                                        switch_event_add_header(event, SWITCH_STACK_BOTTOM, "to", "%s", to_addr);
                                        switch_event_add_header(event, SWITCH_STACK_BOTTOM, "subject", "SIMPLE MESSAGE");
                                        if (msg) {
                                                switch_event_add_body(event, "%s", msg);
                                        }
+                                       
                                        if (switch_core_session_queue_event(tech_pvt->session, &event) != SWITCH_STATUS_SUCCESS) {
                                                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "delivery-failure", "true");
                                                switch_event_fire(&event);
@@ -1684,7 +1687,6 @@ void sofia_presence_handle_sip_i_message(int status,
                                }
                        } else {
                                switch_chat_interface_t *ci;
-
                                if ((ci = switch_loadable_module_get_chat_interface(proto))) {
                                        ci->chat_send(SOFIA_CHAT_PROTO, from_addr, to_addr, "", msg, full_from);
                                } else {