imc_mng.h

00001 /*
00002  * $Id$
00003  *
00004  * imc module - instant messaging conferencing 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-10-06  first version (anca)
00027  */
00028 
00029 
00030 
00031 #ifndef _IMC_MNG_H_
00032 #define _IMC_MNG_H_
00033 
00034 
00035 
00036 #include "../../locking.h"
00037 #include "../../str.h"
00038 #include "../../parser/parse_from.h"
00039 
00040 #define IMC_MEMBER_OWNER        1<<0
00041 #define IMC_MEMBER_ADMIN        1<<1
00042 #define IMC_MEMBER_INVITED      1<<2
00043 #define IMC_MEMBER_DELETED  1<<3
00044 #define IMC_MEMBER_SKIP     1<<4
00045 
00046 typedef struct _imc_member
00047 {
00048         unsigned int hashid;
00049         str uri;
00050         str user;
00051         str domain;
00052         int flags;
00053         struct _imc_member * next;
00054         struct _imc_member * prev;
00055 } imc_member_t, *imc_member_p;
00056 
00057 #define IMC_ROOM_PRIV   1<<0
00058 #define IMC_ROOM_DELETED 1<<1
00059 typedef struct del_member
00060 {
00061         str room_name;
00062         str room_domain;
00063         str inv_uri;
00064         str member_name;
00065         str member_domain;
00066 }del_member_t;
00067 
00068 
00069 typedef struct _imc_room
00070 {
00071         unsigned int hashid;
00072         str uri;
00073         str name;
00074         str domain;
00075         int flags;
00076         int nr_of_members;
00077         imc_member_p members;
00078         struct _imc_room * next;
00079         struct _imc_room * prev;
00080 } imc_room_t, *imc_room_p;
00081 
00082 typedef struct _imc_hentry
00083 {
00084         imc_room_p rooms;
00085         gen_lock_t lock;
00086 } imc_hentry_t, *imc_hentry_p;
00087 
00088 imc_member_p imc_add_member(imc_room_p room, str* user, str* domain, int flags);
00089 imc_member_p imc_get_member(imc_room_p room, str* user, str* domain);
00090 int imc_del_member(imc_room_p room, str* user, str* domain);
00091 
00092 imc_room_p imc_add_room(str* name, str* domain, int flags);
00093 imc_room_p imc_get_room(str* name, str* domain);
00094 int imc_del_room(str* name, str* domain);
00095 int imc_release_room(imc_room_p room);
00096 
00097 int imc_htable_init(void);
00098 int imc_htable_destroy(void);
00099 
00100 
00101 
00102 #endif
00103