]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
tweak to jingle
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 12 Dec 2006 17:44:59 +0000 (17:44 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 12 Dec 2006 17:44:59 +0000 (17:44 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3624 d0543943-73ff-0310-b7d9-9358b9ac24b2

libs/libdingaling/.update
libs/libdingaling/src/libdingaling.c
libs/libdingaling/src/libdingaling.h
src/mod/endpoints/mod_dingaling/mod_dingaling.c

index b5c0a1c0d985c1536f928dea7cdecbab9f522500..5463956efa02ae2c0645439e2ad4956260166f4f 100644 (file)
@@ -1 +1 @@
-Fri Dec  1 21:13:04 EST 2006
+Tue Dec 12 11:55:02 EST 2006
index c4ebf900e33fdb1a2075908ddec2c22b7f269c7d..433939d72c578fac44f080391e596762b46b64b0 100644 (file)
@@ -701,6 +701,8 @@ static int on_presence(void *user_data, ikspak *pak)
        
        if (type && !strcasecmp(type, "unavailable")) {
                signal = LDL_SIGNAL_PRESENCE_OUT;
+    } else if (type && !strcasecmp(type, "probe")) {
+               signal = LDL_SIGNAL_PRESENCE_PROBE;
        } else {
                signal = LDL_SIGNAL_PRESENCE_IN;
        }
@@ -725,20 +727,15 @@ static int on_presence(void *user_data, ikspak *pak)
        }
 
 
-       
        if (resource && strstr(resource, "talk") && (buffer = apr_hash_get(handle->probe_hash, id, APR_HASH_KEY_STRING))) {
                apr_cpystrn(buffer->buf, from, buffer->len);
                fflush(stderr);
                buffer->hit = 1;
        }
        
-       if (!type || (type && strcasecmp(type, "probe"))) {
-
-               if (handle->session_callback) {
-                       handle->session_callback(handle, NULL, signal, to, id, status ? status : "n/a", show ? show : "n/a");
-               }
-       }
-
+    if (handle->session_callback) {
+        handle->session_callback(handle, NULL, signal, to, id, status ? status : "n/a", show ? show : "n/a");
+    }
 
        return IKS_FILTER_EAT;
 }
index 2793b7fb082395af95fe7278c4a6d6d6e7f6a8fd..c74c8b5b00c775958a1c353fb31dc2e97f7a4a3f 100644 (file)
@@ -125,6 +125,7 @@ typedef enum {
        LDL_SIGNAL_MSG,
        LDL_SIGNAL_PRESENCE_IN,
        LDL_SIGNAL_PRESENCE_OUT,
+       LDL_SIGNAL_PRESENCE_PROBE,
        LDL_SIGNAL_ROSTER,
        LDL_SIGNAL_SUBSCRIBE,
        LDL_SIGNAL_UNSUBSCRIBE,
index 546aba7393015c7f6bfbc56664a6ab96f0501258..2b2958a286d8ee371c2ddcc25ba3a669c40e8c46 100644 (file)
@@ -2107,7 +2107,7 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
                                }
 
                                if (is_special(to)) {
-                                       ldl_handle_send_presence(profile->handle, to, from, NULL, "unknown", "Click To Call");
+                                       ldl_handle_send_presence(profile->handle, to, from, NULL, NULL, "Click To Call");
                                }
 
 #if 0
@@ -2116,7 +2116,7 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
                                                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", MDL_CHAT_PROTO);
                                                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
                                                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s",  to);
-                                               switch_event_add_header(event, SWITCH_STACK_BOTTOM, "rpid", "unknown");
+                                               //switch_event_add_header(event, SWITCH_STACK_BOTTOM, "rpid", "unknown");
                                                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "Click To Call");
                                                switch_event_fire(&event);
                                        }
@@ -2130,6 +2130,11 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
                                        switch_event_fire(&event);
                                }
                                break;
+                       case LDL_SIGNAL_PRESENCE_PROBE:
+                               if (is_special(to)) {
+                    ldl_handle_send_presence(profile->handle, to, from, NULL, NULL, "Click To Call");
+                }
+                break;
                        case LDL_SIGNAL_PRESENCE_IN:
                                
                                if ((sql = switch_mprintf("update subscriptions set show='%q', status='%q' where sub_from='%q'", msg, subject, from))) {
@@ -2148,7 +2153,7 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
 
                                
                                if (is_special(to)) {
-                                       ldl_handle_send_presence(profile->handle, to, from, NULL, "unknown", "Click To Call");
+                                       ldl_handle_send_presence(profile->handle, to, from, NULL, NULL, "Click To Call");
                                }
 #if 0
                                if (is_special(to)) {
@@ -2156,13 +2161,14 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
                                                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", MDL_CHAT_PROTO);
                                                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
                                                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s",  to);
-                                               switch_event_add_header(event, SWITCH_STACK_BOTTOM, "rpid", "unknown");
+                                               //switch_event_add_header(event, SWITCH_STACK_BOTTOM, "rpid", "unknown");
                                                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "Click To Call");
                                                switch_event_fire(&event);
                                        }
                                }
                                break;
 #endif
+
                        case LDL_SIGNAL_PRESENCE_OUT:
                                
                                if ((sql = switch_mprintf("update subscriptions set show='%q', status='%q' where sub_from='%q'", msg, subject, from))) {