1 /**
2  *
3  * Copyright (C) 2018 Charles Chance (Sipcentric Ltd)
4  *
5  * This file is part of Kamailio, a free SIP server.
6  *
7  * Kamailio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version
11  *
12  * Kamailio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
20  */
21 
22 #ifndef _PRESENCE_DMQ_H_
23 #define _PRESENCE_DMQ_H_
24 
25 #include "presentity.h"
26 #include "../dmq/bind_dmq.h"
27 #include "../../core/utils/srjson.h"
28 #include "../../core/strutils.h"
29 #include "../../core/parser/msg_parser.h"
30 #include "../../core/parser/parse_content.h"
31 
32 extern dmq_api_t pres_dmqb;
33 extern dmq_peer_t *pres_dmq_peer;
34 extern dmq_resp_cback_t pres_dmq_resp_callback;
35 
36 typedef enum
37 {
38 	PRES_DMQ_NONE,
39 	PRES_DMQ_UPDATE_PRESENTITY,
40 	PRES_DMQ_SYNC,
41 } pres_dmq_action_t;
42 
43 int pres_dmq_initialize();
44 int pres_dmq_handle_msg(
45 		struct sip_msg *msg, peer_reponse_t *resp, dmq_node_t *node);
46 int pres_dmq_replicate_presentity(presentity_t *presentity, str *body,
47 		int new_t, str *cur_etag, char *sphere, str *ruid, dmq_node_t *node);
48 int pres_dmq_resp_callback_f(
49 		struct sip_msg *msg, int code, dmq_node_t *node, void *param);
50 #endif
51