offline_winfo.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef __OFFLINE_WINFO_H
  2. #define __OFFLINE_WINFO_H
  3. #include "pa_mod.h"
  4. typedef struct _offline_winfo_t {
  5. time_t created; /* date and time of this info creation */
  6. time_t expires; /* date and time of this info expiration */
  7. int index; /* key generated by database - it is used for removing winfos from DB */
  8. str uid; /* presentity identification */
  9. str watcher; /* watcher's uri */
  10. str events; /* event package */
  11. str domain; /* domain */
  12. str status; /* status of subscription */
  13. struct _offline_winfo_t *next; /* for linking infos together */
  14. char buffer[1];
  15. } offline_winfo_t;
  16. int store_offline_winfo(struct sip_msg* _m, char* _domain, char* _str);
  17. /* send offline winfo as regular watcher info NOTIFY if possible
  18. * (for presentity got from get_to) */
  19. int dump_offline_winfo(struct sip_msg* _m, char* _domain, char* _s2);
  20. /* expiration time in seconds */
  21. extern int offline_winfo_expiration;
  22. void offline_winfo_timer(unsigned int ticks, void* param);
  23. int send_winfo_notify_offline(struct presentity* _p,
  24. struct watcher* _w,
  25. offline_winfo_t *info,
  26. transaction_cb completion_cb, void* cbp);
  27. /* For storing status of last subscription is used global variable,
  28. * NOT AVP because AVPs are cleared when sending NOTIFY request from
  29. * handle_subscripton function and behaviour of AVPs in such cases is
  30. * not strictly defined. */
  31. void set_last_subscription_status(watcher_status_t status);
  32. watcher_status_t get_last_subscription_status();
  33. int check_subscription_status(struct sip_msg* _m, char* _status, char* _x);
  34. int check_subscription_status_fix(void **param, int param_no);
  35. #endif