1 /*
2  * imc module - instant messaging conferencing implementation
3  *
4  * Copyright (C) 2006 Voice Sistem S.R.L.
5  *
6  * This file is part of Kamailio, a free SIP server.
7  *
8  * Kamailio is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version
12  *
13  * Kamailio is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
21  *
22  */
23 
24 
25 
26 #ifndef _IMC_MNG_H_
27 #define _IMC_MNG_H_
28 
29 
30 
31 #include "../../core/locking.h"
32 #include "../../core/str.h"
33 #include "../../core/parser/parse_from.h"
34 
35 #define IMC_MEMBER_OWNER	(1<<0)
36 #define IMC_MEMBER_ADMIN	(1<<1)
37 #define IMC_MEMBER_INVITED	(1<<2)
38 #define IMC_MEMBER_DELETED  (1<<3)
39 #define IMC_MEMBER_SKIP     (1<<4)
40 
41 typedef struct _imc_member
42 {
43 	unsigned int hashid;
44 	str uri;
45 	str user;
46 	str domain;
47 	int flags;
48 	struct _imc_member * next;
49 	struct _imc_member * prev;
50 } imc_member_t, *imc_member_p;
51 
52 #define IMC_ROOM_PRIV		(1<<0)
53 #define IMC_ROOM_DELETED	(1<<1)
54 typedef struct del_member
55 {
56 	str room_name;
57 	str room_domain;
58 	str inv_uri;
59 	str member_name;
60 	str member_domain;
61 }del_member_t;
62 
63 
64 typedef struct _imc_room
65 {
66 	unsigned int hashid;
67 	str uri;
68 	str name;
69 	str domain;
70 	int flags;
71 	int nr_of_members;
72 	imc_member_p members;
73 	struct _imc_room * next;
74 	struct _imc_room * prev;
75 } imc_room_t, *imc_room_p;
76 
77 typedef struct _imc_hentry
78 {
79 	imc_room_p rooms;
80 	gen_lock_t lock;
81 } imc_hentry_t, *imc_hentry_p;
82 
83 imc_member_p imc_add_member(imc_room_p room, str* user, str* domain, int flags);
84 imc_member_p imc_get_member(imc_room_p room, str* user, str* domain);
85 int imc_del_member(imc_room_p room, str* user, str* domain);
86 
87 imc_room_p imc_add_room(str* name, str* domain, int flags);
88 imc_room_p imc_get_room(str* name, str* domain);
89 int imc_del_room(str* name, str* domain);
90 int imc_release_room(imc_room_p room);
91 
92 int imc_htable_init(void);
93 int imc_htable_destroy(void);
94 
95 
96 
97 #endif
98 
99