git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3181 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2006-10-24 18:50:52 +00:00
parent bfab0a6efc
commit 10ead46ffd
2 changed files with 3 additions and 2 deletions

View 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;

View 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);
}