presence/subscribe.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef SUBSCRIBE_H
00037 #define SUBSCRIBE_H
00038
00039
00040 #include "../../str.h"
00041 #include "../../db/db.h"
00042
00043 struct pres_ev;
00044
00045 #include "event_list.h"
00046 #include "hash.h"
00047
00048 #define ACTIVE_STATUS 1
00049 #define PENDING_STATUS 2
00050 #define TERMINATED_STATUS 3
00051 #define WAITING_STATUS 4
00052
00053 struct subscription
00054 {
00055 str pres_uri;
00056 str to_user;
00057 str to_domain;
00058 str from_user;
00059 str from_domain;
00060 struct pres_ev* event;
00061 str event_id;
00062 str to_tag;
00063 str from_tag;
00064 str callid;
00065 str sockinfo_str;
00066 unsigned int remote_cseq;
00067 unsigned int local_cseq;
00068 str contact;
00069 str local_contact;
00070 str record_route;
00071 unsigned int expires;
00072 unsigned int status;
00073 str reason;
00074 int version;
00075 int send_on_cback;
00076 int db_flag;
00077 str* auth_rules_doc;
00078 struct subscription* next;
00079
00080 };
00081 typedef struct subscription subs_t;
00082
00083 void msg_active_watchers_clean(unsigned int ticks,void *param);
00084
00085 void msg_watchers_clean(unsigned int ticks,void *param);
00086
00087 int handle_subscribe(struct sip_msg*, char*, char*);
00088
00089 int delete_db_subs(str pres_uri, str ev_stored_name, str to_tag);
00090
00091 void timer_db_update(unsigned int ticks,void *param);
00092
00093 int update_subs_db(subs_t* subs, int type);
00094
00095 int refresh_watcher(str* pres_uri, str* watcher_uri, str* event,
00096 int status, str* reason);
00097
00098 typedef int (*refresh_watcher_t)(str*, str* , str* ,int , str* );
00099
00100 int restore_db_subs(void);
00101
00102 typedef int (*handle_expired_func_t)(subs_t* );
00103
00104 void update_db_subs(db_con_t *db,db_func_t dbf, shtable_t hash_table,
00105 int htable_size, int no_lock, handle_expired_func_t handle_expired_func);
00106
00107 typedef void (*update_db_subs_t)(db_con_t * ,db_func_t ,shtable_t ,int ,int ,
00108 handle_expired_func_t);
00109
00110 int extract_sdialog_info(subs_t* subs,struct sip_msg* msg, int max_expire,
00111 int* to_tag_gen, str scontact);
00112 typedef int (*extract_sdialog_info_t)(subs_t* subs, struct sip_msg* msg,
00113 int max_expire, int* to_tag_gen, str scontact);
00114
00115 #endif