00001 /* 00002 * $Id: ring.h 5215 2008-11-18 11:38:25Z henningw $ 00003 * 00004 * Copyright (C) 2008-2009 1&1 Internet AG 00005 * 00006 * This file is part of Kamailio, a free SIP server. 00007 * 00008 * Kamailio is free software; you can redistribute it and/or modify 00009 * it under the terms of the GNU General Public License as published by 00010 * the Free Software Foundation; either version 2 of the License, or 00011 * (at your option) any later version 00012 * 00013 * Kamailio is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with this program; if not, write to the Free Software 00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00021 */ 00022 00023 /** 00024 * \file 00025 * \brief Module with several utiltity functions related to SIP messages handling 00026 * \ingroup utils 00027 * - Module; \ref utils 00028 */ 00029 00030 #ifndef RING_H 00031 #define RING_H 00032 00033 00034 #define HASHTABLEBITS 13 00035 #define HASHTABLESIZE (((unsigned int)1) << HASHTABLEBITS) 00036 #define HASHTABLEMASK (HASHTABLESIZE - 1) 00037 #define MAXCALLIDLEN 255 00038 00039 00040 extern gen_lock_t *ring_lock; 00041 extern unsigned int ring_timeout; 00042 00043 00044 /*! 00045 * \brief Inserts callid of message into hashtable 00046 * 00047 * Inserts callid of message into hashtable. Any 183 messages with 00048 * this callid that occur in the next ring_timeout seconds, will be 00049 * converted to 180. 00050 * \param msg SIP message 00051 * \param unused1 unused 00052 * \param unused2 unused 00053 * \return 1 on success, -1 otherwise 00054 */ 00055 int ring_insert_callid(struct sip_msg *msg, char *unused1, char *unused2); 00056 00057 00058 /*! 00059 * \brief Initialize the ring hashtable in shared memory 00060 */ 00061 void ring_init_hashtable(void); 00062 00063 00064 /*! 00065 * \brief Destroy the ring hashtable 00066 */ 00067 void ring_destroy_hashtable(void); 00068 00069 00070 /*! 00071 * \brief Callback function that does the work inside the server. 00072 * \param msg SIP message 00073 * \param bar unused 00074 * \return 1 on success, -1 on failure 00075 */ 00076 int ring_filter(struct sip_msg *msg, void *bar); 00077 00078 00079 /*! 00080 * \brief Fixup function for the ring_insert_callid function 00081 * \param param unused 00082 * \param param_no unused 00083 * \return 0 00084 */ 00085 int ring_fixup(void ** param, int param_no); 00086 00087 00088 #endif
1.5.6