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 #ifndef NOTIFY_H
00030 #define NOTIFY_H
00031
00032 #include "../../str.h"
00033 #include "urecord.h"
00034 #include "../../parser/msg_parser.h"
00035
00036
00037
00038
00039
00040
00041 struct urecord;
00042
00043 typedef enum pres_state {
00044 PRES_OFFLINE = 0,
00045 PRES_ONLINE
00046 } pres_state_t;
00047
00048 typedef void (*notcb_t)(str* uid, str* _contact, pres_state_t _p, void* _d);
00049
00050 typedef int (*register_watcher_t)(str* _f, str* _t, notcb_t _c, void* _data);
00051 typedef int (*unregister_watcher_t)(str* _f, str* _t, notcb_t _c, void* _data);
00052
00053 typedef struct notify_cb {
00054 notcb_t cb;
00055 void* data;
00056 struct notify_cb* next;
00057 } notify_cb_t;
00058
00059
00060 void notify_watchers(struct urecord* _r, ucontact_t *_c, int state);
00061
00062 int add_watcher(struct urecord* _r, notcb_t _c, void* _d);
00063
00064 int remove_watcher(struct urecord* _r, notcb_t _c, void* _d);
00065
00066 int register_watcher(str* _d, str* uid, notcb_t _c, void* _data);
00067
00068 int unregister_watcher(str* _d, str* uid, notcb_t _c, void* _data);
00069
00070 int post_script(struct sip_msg* _m, void* param);
00071
00072 #endif