]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 24 Oct 2006 18:50:52 +0000 (18:50 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 24 Oct 2006 18:50:52 +0000 (18:50 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3181 d0543943-73ff-0310-b7d9-9358b9ac24b2

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

index a418a3cf723b75e841a9da07465c4d92c9d98b14..3d96b36950afb859d9e4a6872149115f5754a0a4 100644 (file)
@@ -796,7 +796,7 @@ static int on_unsubscribe(void *user_data, ikspak *pak)
        char *to = iks_find_attrib(pak->x, "to");
 
        if (handle->session_callback) {
-               handle->session_callback(handle, NULL, LDL_SIGNAL_SUBSCRIBE, to, from, NULL, NULL);
+               handle->session_callback(handle, NULL, LDL_SIGNAL_UNSUBSCRIBE, to, from, NULL, NULL);
        }
 
        return IKS_FILTER_EAT;
index 6316c917b352f11e93f3b270c6aab7c06438e9cd..43378b0368f883778417e86b98e3929fd4868929 100644 (file)
@@ -2078,7 +2078,8 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
 
                        case LDL_SIGNAL_SUBSCRIBE:
                                
-                               if ((sql = switch_mprintf("insert into subscriptions values('%q','%q','%q','%q')", from, to, msg, subject))) {
+                               if ((sql = switch_mprintf("delete from subscriptions where sub_from='%q' and sub_to='%q';\n"
+                                                                                 "insert into subscriptions values('%q','%q','%q','%q');\n", from, to, from, to, msg, subject))) {
                                        execute_sql(profile->dbname, sql, profile->mutex);
                                        switch_core_db_free(sql);
                                }