presence/notify.h

Go to the documentation of this file.
00001 /*
00002  * $Id: notify.h 4625 2008-08-07 08:37:04Z henningw $
00003  *
00004  * presence module -presence server implementation
00005  *
00006  * Copyright (C) 2006 Voice Sistem S.R.L.
00007  *
00008  * This file is part of Kamailio, a free SIP server.
00009  *
00010  * Kamailio is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version
00014  *
00015  * Kamailio is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License 
00021  * along with this program; if not, write to the Free Software 
00022  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00023  *
00024  * History:
00025  * --------
00026  *  2006-08-15  initial version (anca)
00027  */
00028 
00029 /*! \file
00030  * \brief Kamailio presence module :: NOTIFY support
00031  * \ingroup presence 
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;   /* to identify the exact record */
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

Generated on Thu May 24 08:00:51 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6