presence/notify.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 #include "../../str.h"
00036 #include "../tm/dlg.h"
00037 #include "subscribe.h"
00038 #include "presentity.h"
00039
00040 #ifndef NOTIFY_H
00041 #define NOTIFY_H
00042
00043 #define FULL_STATE_FLAG (1<<0)
00044 #define PARTIAL_STATE_FLAG (1<<1)
00045
00046 #define PRES_LEN 8
00047 #define PWINFO_LEN 14
00048 #define BLA_LEN 10
00049
00050
00051 typedef struct watcher
00052 {
00053 str uri;
00054 str id;
00055 int status;
00056 str event;
00057 str display_name;
00058 str expiration;
00059 str duration_subscribed;
00060 struct watcher* next;
00061 }watcher_t;
00062
00063 typedef struct wid_cback
00064 {
00065 str pres_uri;
00066 str ev_name;
00067 str to_tag;
00068 subs_t* wi_subs;
00069 }c_back_param;
00070
00071 extern str str_to_user_col;
00072 extern str str_username_col;
00073 extern str str_domain_col;
00074 extern str str_body_col;
00075 extern str str_to_domain_col;
00076 extern str str_watcher_username_col;
00077 extern str str_watcher_domain_col;
00078 extern str str_event_id_col;
00079 extern str str_event_col;
00080 extern str str_etag_col;
00081 extern str str_from_tag_col;
00082 extern str str_to_tag_col;
00083 extern str str_callid_col;
00084 extern str str_local_cseq_col;
00085 extern str str_remote_cseq_col;
00086 extern str str_record_route_col;
00087 extern str str_contact_col;
00088 extern str str_expires_col;
00089 extern str str_status_col;
00090 extern str str_reason_col;
00091 extern str str_socket_info_col;
00092 extern str str_local_contact_col;
00093 extern str str_version_col;
00094 extern str str_presentity_uri_col;
00095 extern str str_inserted_time_col;
00096 extern str str_received_time_col;
00097 extern str str_id_col;
00098 extern str str_sender_col;
00099
00100 void PRINT_DLG(FILE* out, dlg_t* _d);
00101
00102 void printf_subs(subs_t* subs);
00103
00104 int query_db_notify(str* pres_uri,pres_ev_t* event, subs_t* watcher_subs );
00105
00106 int publ_notify(presentity_t* p, str pres_uri, str* body, str* offline_etag,
00107 str* rules_doc);
00108
00109 int notify(subs_t* subs, subs_t* watcher_subs, str* n_body,int force_null_body);
00110
00111 int send_notify_request(subs_t* subs, subs_t * watcher_subs,
00112 str* n_body,int force_null_body);
00113
00114 char* get_status_str(int flag);
00115
00116 #endif