offline_winfo.h

00001 #ifndef __OFFLINE_WINFO_H
00002 #define __OFFLINE_WINFO_H
00003 
00004 #include "pa_mod.h"
00005 
00006 typedef struct _offline_winfo_t {
00007         time_t created; /* date and time of this info creation */
00008         time_t expires; /* date and time of this info expiration */
00009         int index;      /* key generated by database - it is used for removing winfos from DB */
00010         str uid;     /* presentity identification */
00011         str watcher; /* watcher's uri */
00012         str events;  /* event package */
00013         str domain;  /* domain */
00014         str status;  /* status of subscription */
00015         struct _offline_winfo_t *next; /* for linking infos together */
00016         char buffer[1];
00017 } offline_winfo_t;
00018 
00019 int store_offline_winfo(struct sip_msg* _m, char* _domain, char* _str);
00020 /* send offline winfo as regular watcher info NOTIFY if possible 
00021  * (for presentity got from get_to) */
00022 int dump_offline_winfo(struct sip_msg* _m, char* _domain, char* _s2);
00023 
00024 /* expiration time in seconds */
00025 extern int offline_winfo_expiration;
00026 
00027 void offline_winfo_timer(unsigned int ticks, void* param);
00028 
00029 int send_winfo_notify_offline(struct presentity* _p, 
00030                 struct watcher* _w, 
00031                 offline_winfo_t *info, 
00032                 transaction_cb completion_cb, void* cbp);
00033 
00034 
00035 /* For storing status of last subscription is used global variable,
00036  * NOT AVP because AVPs are cleared when sending NOTIFY request from
00037  * handle_subscripton function and behaviour of AVPs in such cases is
00038  * not strictly defined. */
00039 
00040 void set_last_subscription_status(watcher_status_t status);
00041 watcher_status_t get_last_subscription_status();
00042 
00043 int check_subscription_status(struct sip_msg* _m, char* _status, char* _x);
00044 int check_subscription_status_fix(void **param, int param_no);
00045 
00046         
00047 #endif