00001 /** 00002 * $Id: xjab_base.h 4518 2008-07-28 15:39:28Z henningw $ 00003 * 00004 * eXtended JABber module 00005 * 00006 * Copyright (C) 2001-2003 FhG Fokus 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 00025 /*** 00026 * --- 00027 * 00028 * History 00029 * ------- 00030 * 2003-06-05 previously added macro replaced with 'xj_extract_aor', (dcm) 00031 * 2003-05-09 added macro for adjusting a SIP address, (dcm) 00032 */ 00033 00034 00035 #ifndef _XJAB_BASE_H_ 00036 #define _XJAB_BASE_H_ 00037 00038 #include "../../str.h" 00039 00040 #define XJ_NULL 0 00041 #define XJ_SEND_MESSAGE 1 00042 #define XJ_JOIN_JCONF 2 00043 #define XJ_EXIT_JCONF 4 00044 #define XJ_GO_ONLINE 8 00045 #define XJ_GO_OFFLINE 16 00046 #define XJ_REG_WATCHER 32 00047 #define XJ_DEL_WATCHER 64 00048 00049 #define XJ_FLAG_OPEN 0 00050 #define XJ_FLAG_CLOSE 1 00051 00052 typedef void (*pa_callback_f)(str* _user, str* _contact, int _state, void *p); 00053 00054 /********** ***/ 00055 00056 typedef struct _xj_jkey 00057 { 00058 int hash; 00059 int flag; 00060 str *id; 00061 } t_xj_jkey, *xj_jkey; 00062 00063 /********** ***/ 00064 00065 typedef struct _xj_sipmsg 00066 { 00067 int type; // type of message 00068 xj_jkey jkey; // pointer to FROM 00069 str to; // destination 00070 str msg; // message body 00071 pa_callback_f cbf; // callback function 00072 void *p; // callback parameter 00073 } t_xj_sipmsg, *xj_sipmsg; 00074 00075 /********** LOOK AT IMPLEMENTATION OF FUNCTIONS FOR DESCRIPTION ***/ 00076 00077 void xj_sipmsg_free(xj_sipmsg); 00078 00079 /********** ***/ 00080 00081 int xj_jkey_cmp(void*, void*); 00082 void xj_jkey_free_p(void*); 00083 void xj_jkey_free(xj_jkey); 00084 00085 /********** ***/ 00086 00087 int xj_get_hash(str*, str*); 00088 char *shahash(const char *); 00089 00090 int xj_extract_aor(str*, int); 00091 00092 #endif 00093
1.5.6