Module: sip-router
Branch: master
Commit: cf079a2ee0d4e234fb30822a076cba2451409e91
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=cf079a2…
Author: Anca Vamanu <anca.vamanu(a)1and1.ro>
Committer: Anca Vamanu <anca.vamanu(a)1and1.ro>
Date: Fri May 4 12:17:56 2012 +0300
modules_k/presence Removed unused refresh_watcher() function
---
modules_k/presence/subscribe.c | 82 ----------------------------------------
modules_k/presence/subscribe.h | 5 --
2 files changed, 0 insertions(+), 87 deletions(-)
diff --git a/modules_k/presence/subscribe.c b/modules_k/presence/subscribe.c
index ae9e442..8ea65f5 100644
--- a/modules_k/presence/subscribe.c
+++ b/modules_k/presence/subscribe.c
@@ -2220,88 +2220,6 @@ error:
}
-int refresh_watcher(str* pres_uri, str* watcher_uri, str* event,
- int status, str* reason)
-{
- unsigned int hash_code;
- subs_t* s, *s_copy;
- pres_ev_t* ev;
- struct sip_uri uri;
- str user, domain;
- subs_t *s_array = NULL;
- /* refresh status in subs_htable and send notify */
-
- ev= contains_event(event, NULL);
- if(ev== NULL)
- {
- LM_ERR("while searching event in list\n");
- return -1;
- }
-
- if(parse_uri(watcher_uri->s, watcher_uri->len, &uri)< 0)
- {
- LM_ERR("parsing uri\n");
- return -1;
- }
- user= uri.user;
- domain= uri.host;
-
- hash_code= core_hash(pres_uri, event, shtable_size);
-
- lock_get(&subs_htable[hash_code].lock);
-
- s= subs_htable[hash_code].entries->next;
-
- while(s)
- {
- if(s->event== ev && s->pres_uri.len== pres_uri->len &&
- strncmp(s->pres_uri.s, pres_uri->s, pres_uri->len)== 0 &&
- s->watcher_user.len==user.len && strncmp(s->watcher_user.s,user.s,
user.len)==0 &&
- s->watcher_domain.len== domain.len &&
- strncmp(s->watcher_domain.s, domain.s, domain.len)== 0)
- {
- s->status= status;
- if(reason)
- s->reason= *reason;
-
- s_copy= mem_copy_subs(s, PKG_MEM_TYPE);
- if(s_copy== NULL)
- {
- LM_ERR("copying subs_t\n");
- lock_release(&subs_htable[hash_code].lock);
- goto error;
- }
-
- s_copy->local_cseq++;
- s_copy->next= s_array;
- s_array= s_copy;
- }
- s= s->next;
- }
- lock_release(&subs_htable[hash_code].lock);
-
- s = s_array;
- while (s) {
- if(notify(s, NULL, NULL, 0)< 0) {
- LM_ERR("Failed to send Notify\n");
- }
- s_copy = s;
- s = s->next;
- pkg_free(s_copy);
- }
-
- return 0;
-
-error:
- s = s_array;
- while (s) {
- s_copy = s;
- s = s->next;
- pkg_free(s_copy);
- }
- return -1;
-}
-
int get_db_subs_auth(subs_t* subs, int* found)
{
db_key_t db_keys[5];
diff --git a/modules_k/presence/subscribe.h b/modules_k/presence/subscribe.h
index 57b49c4..821df0f 100644
--- a/modules_k/presence/subscribe.h
+++ b/modules_k/presence/subscribe.h
@@ -102,11 +102,6 @@ void timer_db_update(unsigned int ticks,void *param);
int update_subs_db(subs_t* subs, int type);
-int refresh_watcher(str* pres_uri, str* watcher_uri, str* event,
- int status, str* reason);
-
-typedef int (*refresh_watcher_t)(str*, str* , str* ,int , str* );
-
int restore_db_subs(void);
typedef int (*handle_expired_func_t)(subs_t* );