diff --git a/mem/f_malloc.c b/mem/f_malloc.c index 053b589d810..fa8cb49e159 100644 --- a/mem/f_malloc.c +++ b/mem/f_malloc.c @@ -1,7 +1,7 @@ /* * Copyright (C) 2001-2003 FhG Fokus * - * This file is part of sip-router, a free SIP server. + * This file is part of Kamailio, a free SIP server. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -16,30 +16,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* - * History: - * -------- - * created by andrei - * 2003-07-06 added fm_realloc (andrei) - * 2004-07-19 fragments book keeping code and support for 64 bits - * memory blocks (64 bits machine & size >=2^32) - * GET_HASH s/ 4Gb mem., switched to long (andrei) - * 2005-03-02 added fm_info() (andrei) - * 2005-12-12 fixed realloc shrink real_used accounting (andrei) - * fixed initial size (andrei) - * 2006-02-03 fixed realloc out of mem. free bug (andrei) - * 2006-04-07 s/DBG/MDBG (andrei) - * 2007-02-23 added fm_available() (andrei) - * 2007-06-23 added hash bitmap (andrei) - * 2009-09-28 added fm_sums() (patch from Dragos Vingarzan) - * 2010-03-11 fix big fragments bug (smaller fragment was wrongly - * returned sometimes) (andrei) - * 2010-03-12 fix real_used stats for realloc: a realloc that shrank an - * allocation accounted twice fro the frag. overhead (andrei) - * 2010-09-30 fixed search for big fragments using the hash bitmap - * (only the first bucket was tried) (andrei) - */ /** * \file diff --git a/mem/f_malloc.h b/mem/f_malloc.h index 099284a6eba..fef53cb6e9f 100644 --- a/mem/f_malloc.h +++ b/mem/f_malloc.h @@ -1,7 +1,7 @@ /* * Copyright (C) 2001-2003 FhG Fokus * - * This file is part of sip-router, a free SIP server. + * This file is part of Kamailio, a free SIP server. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -16,17 +16,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* - * History: - * -------- - * 2003-05-21 on sparc64 roundto 8 even in debugging mode (so malloc'ed - * long longs will be 64 bit aligned) (andrei) - * 2004-07-19 support for 64 bit (2^64 mem. block) and more info - * for the future de-fragmentation support (andrei) - * 2004-11-10 support for > 4Gb mem., switched to long (andrei) - * 2007-06-23 added hash bitmap (andrei) - */ - /** * \file * \brief Simple, very fast, malloc library diff --git a/mem/ll_malloc.c b/mem/ll_malloc.c index 3226844f426..7e3b7d1190c 100644 --- a/mem/ll_malloc.c +++ b/mem/ll_malloc.c @@ -1,8 +1,9 @@ -/* $Id$ - * +/* * shared memory, multi-process safe, pool based, mostly lockless version of * f_malloc * + * This file is part of Kamailio, a free SIP server. + * * Copyright (C) 2007 iptelorg GmbH * * Permission to use, copy, modify, and distribute this software for any @@ -17,25 +18,6 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* - * History: - * -------- - * created by andrei - * 2003-07-06 added fm_realloc (andrei) - * 2004-07-19 fragments book keeping code and support for 64 bits - * memory blocks (64 bits machine & size >=2^32) - * GET_HASH s/ 4Gb mem., switched to long (andrei) - * 2005-03-02 added fm_info() (andrei) - * 2005-12-12 fixed realloc shrink real_used accounting (andrei) - * fixed initial size (andrei) - * 2006-02-03 fixed realloc out of mem. free bug (andrei) - * 2006-04-07 s/DBG/MDBG (andrei) - * 2007-02-23 added fm_available() (andrei) - * 2007-06-09 forked from the fm_maloc code (andrei) - * 2007-06-11 forked from the sfm_maloc code (andrei) - */ - #ifdef LL_MALLOC diff --git a/mem/ll_malloc.h b/mem/ll_malloc.h index 34c4fb35b16..ad366cd11bc 100644 --- a/mem/ll_malloc.h +++ b/mem/ll_malloc.h @@ -1,8 +1,9 @@ -/* $Id$ - * +/* * shared memory, multi-process safe, pool based, mostly lockless version of * f_malloc * + * This file is part of Kamailio, a free SIP server. + * * Copyright (C) 2007 iptelorg GmbH * * Permission to use, copy, modify, and distribute this software for any @@ -17,17 +18,6 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* - * History: - * -------- - * 2003-05-21 on sparc64 roundto 8 even in debugging mode (so malloc'ed - * long longs will be 64 bit aligned) (andrei) - * 2004-07-19 support for 64 bit (2^64 mem. block) and more info - * for the future de-fragmentation support (andrei) - * 2004-11-10 support for > 4Gb mem., switched to long (andrei) - * 2007-06-11 forked from the sf_malloc code (andrei) - */ - #if !defined(ll_malloc_h) #define ll_malloc_h diff --git a/mem/mem.c b/mem/mem.c index 51d9050c6ab..ac7ddc88571 100644 --- a/mem/mem.c +++ b/mem/mem.c @@ -1,7 +1,7 @@ /* * Copyright (C) 2001-2003 FhG Fokus * - * This file is part of sip-router, a free SIP server. + * This file is part of Kamailio, a free SIP server. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -16,10 +16,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * - * History: - * -------- - * 2003-04-08 init_mallocs split into init_{pkg,shm}_malloc (andrei) - * */ /** diff --git a/mem/mem.h b/mem/mem.h index 65ea670ee1e..d90fcf48cf5 100644 --- a/mem/mem.h +++ b/mem/mem.h @@ -1,7 +1,7 @@ /* * Copyright (C) 2001-2003 FhG Fokus * - * This file is part of sip-router, a free SIP server. + * This file is part of Kamailio, a free SIP server. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -16,16 +16,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* - * History: - * -------- - * 2003-03-10 __FUNCTION__ is a gcc-ism, defined it to "" for sun cc - * (andrei) - * 2003-03-07 split init_malloc into init_pkg_mallocs & init_shm_mallocs - * (andrei) - * 2007-02-23 added pkg_info() and pkg_available() (andrei) - */ - /** * \defgroup mem SIP-router memory manager * \brief SIP-router internal memory manager diff --git a/mem/memdbg.h b/mem/memdbg.h index b59f2812623..65af555f1d9 100644 --- a/mem/memdbg.h +++ b/mem/memdbg.h @@ -1,6 +1,8 @@ /* * Copyright (C) 2006 iptelorg GmbH * + * This file is part of Kamailio, a free SIP server. + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. @@ -14,12 +16,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* - * History: - * -------- - * 2006-04-07 created by andrei - */ - /** * \file * \brief Malloc debug messages diff --git a/mem/meminfo.h b/mem/meminfo.h index 74583846bd4..9c7760db34c 100644 --- a/mem/meminfo.h +++ b/mem/meminfo.h @@ -1,7 +1,7 @@ /* * Copyright (C) 2001-2003 FhG Fokus * - * This file is part of sip-router, a free SIP server. + * This file is part of Kamailio, a free SIP server. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -16,13 +16,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* - * History: - * -------- - * 2005-03-02 created (andrei) - * 2005-07-25 renamed meminfo to mem_info due to name conflict on solaris - */ - /** * \file * \brief Memory manager (malloc) informations and statistics diff --git a/mem/memtest.c b/mem/memtest.c index 2cec6c65bfe..1b8f17850de 100644 --- a/mem/memtest.c +++ b/mem/memtest.c @@ -1,9 +1,7 @@ /* - * $Id$ - * * Copyright (C) 2001-2003 FhG Fokus * - * This file is part of sip-router, a free SIP server. + * This file is part of Kamailio, a free SIP server. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/mem/q_malloc.c b/mem/q_malloc.c index b6a0546b9f6..070a2282fea 100644 --- a/mem/q_malloc.c +++ b/mem/q_malloc.c @@ -1,7 +1,7 @@ /* * Copyright (C) 2001-2003 FhG Fokus * - * This file is part of sip-router, a free SIP server. + * This file is part of Kamailio, a free SIP server. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -16,25 +16,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* - * History: - * -------- - * ????-??-?? created by andrei - * 2003-04-14 more debugging added in DBG_QM_MALLOC mode (andrei) - * 2003-06-29 added qm_realloc (andrei) - * 2004-07-19 fragments book keeping code and support for 64 bits - * memory blocks (64 bits machine & size>=2^32) (andrei) - * GET_HASH s/ 4Gb mem., switched to long (andrei) - * 2005-03-02 added qm_info() (andrei) - * 2005-12-12 fixed realloc shrink real_used & used accounting; - * fixed initial size (andrei) - * 2006-02-03 fixed realloc out of mem. free bug (andrei) - * 2006-04-07 s/DBG/MDBG (andrei) - * 2007-02-23 added fm_available() (andrei) - * 2009-09-28 added fm_sums() (patch from Dragos Vingarzan) - */ - /** * \file * \brief Simple & fast malloc library diff --git a/mem/q_malloc.h b/mem/q_malloc.h index ee107f91808..0e9a70656db 100644 --- a/mem/q_malloc.h +++ b/mem/q_malloc.h @@ -1,7 +1,7 @@ /* * Copyright (C) 2001-2003 FhG Fokus * - * This file is part of sip-router, a free SIP server. + * This file is part of Kamailio, a free SIP server. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -16,16 +16,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* - * History: - * -------- - * 2003-05-21 on sparc64 roundto 8 even in debugging mode (so malloc'ed - * long longs will be 64 bit aligned) (andrei) - * 2004-07-19 support for 64 bit (2^64 mem. block) and more info - * for the future de-fragmentation support (andrei) - * 2004-11-10 support for > 4Gb mem. (switched to long) (andrei) - */ - /** * \file * \brief Simple & fast malloc library diff --git a/mem/sf_malloc.c b/mem/sf_malloc.c index c83d557a6ff..5cb02586600 100644 --- a/mem/sf_malloc.c +++ b/mem/sf_malloc.c @@ -1,7 +1,8 @@ -/* $Id$ - * +/* * shared memory, multi-process safe, pool based version of f_malloc * + * This file is part of Kamailio, a free SIP server. + * * Copyright (C) 2007 iptelorg GmbH * * Permission to use, copy, modify, and distribute this software for any @@ -16,24 +17,6 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* - * History: - * -------- - * created by andrei - * 2003-07-06 added fm_realloc (andrei) - * 2004-07-19 fragments book keeping code and support for 64 bits - * memory blocks (64 bits machine & size >=2^32) - * GET_HASH s/ 4Gb mem., switched to long (andrei) - * 2005-03-02 added fm_info() (andrei) - * 2005-12-12 fixed realloc shrink real_used accounting (andrei) - * fixed initial size (andrei) - * 2006-02-03 fixed realloc out of mem. free bug (andrei) - * 2006-04-07 s/DBG/MDBG (andrei) - * 2007-02-23 added fm_available() (andrei) - * 2007-06-09 forked from the fm_maloc code (andrei) - */ - #ifdef SF_MALLOC diff --git a/mem/sf_malloc.h b/mem/sf_malloc.h index 3e74a68be90..262d2bb1b33 100644 --- a/mem/sf_malloc.h +++ b/mem/sf_malloc.h @@ -1,7 +1,8 @@ -/* $Id$ - * +/* * shared memory, multi-process safe, pool based version of f_malloc * + * This file is part of Kamailio, a free SIP server. + * * Copyright (C) 2007 iptelorg GmbH * * Permission to use, copy, modify, and distribute this software for any @@ -16,16 +17,6 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* - * History: - * -------- - * 2003-05-21 on sparc64 roundto 8 even in debugging mode (so malloc'ed - * long longs will be 64 bit aligned) (andrei) - * 2004-07-19 support for 64 bit (2^64 mem. block) and more info - * for the future de-fragmentation support (andrei) - * 2004-11-10 support for > 4Gb mem., switched to long (andrei) - * 2007-06-09 forked from the f_malloc code (andrei) - */ #if !defined(sf_malloc_h) diff --git a/mem/shm_mem.c b/mem/shm_mem.c index 0cb47ee8c39..de78213aaed 100644 --- a/mem/shm_mem.c +++ b/mem/shm_mem.c @@ -1,9 +1,7 @@ /* - - * * Copyright (C) 2001-2003 FhG Fokus * - * This file is part of sip-router, a free SIP server. + * This file is part of Kamailio, a free SIP server. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -18,16 +16,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* - * History: - * -------- - * 2003-03-12 split shm_mem_init in shm_getmem & shm_mem_init_mallocs - * (andrei) - * 2004-07-27 ANON mmap support, needed on darwin (andrei) - * 2004-09-19 shm_mem_destroy: destroy first the lock & then unmap (andrei) - * 2007-06-10 support for sfm_malloc & shm_malloc_destroy() (andrei) - */ - /** * \file * \brief Shared memory functions diff --git a/mem/shm_mem.h b/mem/shm_mem.h index b65ad1f5f73..eadccb54edf 100644 --- a/mem/shm_mem.h +++ b/mem/shm_mem.h @@ -3,7 +3,7 @@ * * Copyright (C) 2001-2003 FhG Fokus * - * This file is part of sip-router, a free SIP server. + * This file is part of Kamailio, a free SIP server. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -18,16 +18,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* - * History: - * -------- - * 2003-06-29 added shm_realloc & replaced shm_resize (andrei) - * 2003-11-19 reverted shm_resize to the old version, using - * realloc causes terrible fragmentation (andrei) - * 2005-03-02 added shm_info() & re-eneabled locking on shm_status (andrei) - * 2007-02-23 added shm_available() (andrei) - * 2007-06-10 support for sf_malloc (andrei) - */ /** * \file diff --git a/mem/src_loc.h b/mem/src_loc.h index 5de5ef5c7ef..33c2df695c5 100644 --- a/mem/src_loc.h +++ b/mem/src_loc.h @@ -1,6 +1,8 @@ /* * Copyright (C) 2009 iptelorg GmbH * + * This file is part of Kamailio, a free SIP server. + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. @@ -14,12 +16,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* - * History: - * -------- - * 2009-10-08 initial version (andrei) -*/ - /** * \file * \brief Helper definitions for internal memory manager diff --git a/modules/kazoo/kazoo.c b/modules/kazoo/kazoo.c index d110131dec5..89484d1ab3e 100644 --- a/modules/kazoo/kazoo.c +++ b/modules/kazoo/kazoo.c @@ -70,6 +70,8 @@ struct timeval kz_sock_tv = (struct timeval){0,100000}; struct timeval kz_amqp_tv = (struct timeval){0,100000}; struct timeval kz_qtimeout_tv = (struct timeval){2,0}; struct timeval kz_ack_tv = (struct timeval){0,100000}; +struct timeval kz_timer_tv = (struct timeval){0,200000}; +int kz_timer_ms = 200; str dbk_consumer_event_key = str_init("Event-Category"); @@ -148,6 +150,7 @@ static param_export_t params[] = { // {"mwi_expires", INT_PARAM, &dbk_mwi_expires}, {"amqp_connection", STR_PARAM|USE_FUNC_PARAM,(void*)kz_amqp_add_connection}, {"amqp_max_channels", INT_PARAM, &dbk_channels}, + {"amqp_timmer_process_interval", INT_PARAM, &kz_timer_ms}, {"amqp_consumer_ack_timeout_micro", INT_PARAM, &kz_ack_tv.tv_usec}, {"amqp_consumer_ack_timeout_sec", INT_PARAM, &kz_ack_tv.tv_sec}, {"amqp_interprocess_timeout_micro", INT_PARAM, &kz_sock_tv.tv_usec}, @@ -235,6 +238,11 @@ static int mod_init(void) { if(!kz_amqp_init()) { return -1; } + + if(kz_timer_ms > 0) { + kz_timer_tv.tv_usec = (kz_timer_ms % 1000) * 1000; + kz_timer_tv.tv_sec = kz_timer_ms / 1000; + } if(dbk_pua_mode == 1) { kz_db_url.len = kz_db_url.s ? strlen(kz_db_url.s) : 0; diff --git a/modules/kazoo/kz_amqp.c b/modules/kazoo/kz_amqp.c index 498347edf39..f1534d8bdf4 100644 --- a/modules/kazoo/kz_amqp.c +++ b/modules/kazoo/kz_amqp.c @@ -35,6 +35,7 @@ extern struct timeval kz_sock_tv; extern struct timeval kz_amqp_tv; extern struct timeval kz_qtimeout_tv; extern struct timeval kz_ack_tv; +extern struct timeval kz_timer_tv; extern int dbk_internal_loop_count; extern int dbk_consumer_loop_count; @@ -1909,6 +1910,7 @@ void kz_amqp_timeout_proc(int child_no) int i; while(1) { struct timeval now; + usleep(kz_timer_tv.tv_usec); for(i=0; i < dbk_channels; i++) { gettimeofday(&now, NULL); if(channels[i].state == KZ_AMQP_CALLING @@ -1972,7 +1974,7 @@ void kz_amqp_publisher_proc(int child_no) while(OK) { FD_ZERO(&fdset); FD_SET(data_pipe, &fdset); - selret = select(FD_SETSIZE, &fdset, NULL, NULL, &kz_sock_tv); + selret = select(FD_SETSIZE, &fdset, NULL, NULL, NULL); if (selret < 0) { LM_ERR("select() failed: %s\n", strerror(errno)); continue; diff --git a/modules/sipt/ss7_parser.c b/modules/sipt/ss7_parser.c index 9315e43d448..e7554f832f6 100644 --- a/modules/sipt/ss7_parser.c +++ b/modules/sipt/ss7_parser.c @@ -316,13 +316,14 @@ int isup_update_bci_1(struct sdp_mangler * mangle, int charge_indicator, int cal return 1; } - if (len < sizeof(struct isup_acm_fixed)) + // add minus 1 because the optinal pointer is optional + if (len < sizeof(struct isup_acm_fixed) -1 ) return -1; bci = (charge_indicator & 0x3) | ((called_status & 0x3)<<2) | ((called_category & 0x3)<<4) | ((e2e_indicator & 0x3)<<6); - add_body_segment(mangle, offsetof(struct isup_acm_fixed, backwards_call_ind), &bci, 1); + replace_body_segment(mangle, offsetof(struct isup_acm_fixed, backwards_call_ind), 1, &bci, 1); return sizeof(struct isup_acm_fixed); } diff --git a/modules/userblacklist/db.c b/modules/userblacklist/db.c index b4d8d426e76..bebb574bb7a 100644 --- a/modules/userblacklist/db.c +++ b/modules/userblacklist/db.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright (C) 2007 1&1 Internet AG * * This file is part of Kamailio, a free SIP server. diff --git a/modules/userblacklist/db.h b/modules/userblacklist/db.h index 26a3ab7385c..bc463e3f0a3 100644 --- a/modules/userblacklist/db.h +++ b/modules/userblacklist/db.h @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright (C) 2007 1&1 Internet AG * * This file is part of Kamailio, a free SIP server. diff --git a/modules/userblacklist/db_userblacklist.c b/modules/userblacklist/db_userblacklist.c index 09f51438e92..cb8fcd52610 100644 --- a/modules/userblacklist/db_userblacklist.c +++ b/modules/userblacklist/db_userblacklist.c @@ -1,4 +1,3 @@ - /*! * \file * \ingroup db diff --git a/modules/userblacklist/db_userblacklist.h b/modules/userblacklist/db_userblacklist.h index ccf1475ba15..87b31c947a2 100644 --- a/modules/userblacklist/db_userblacklist.h +++ b/modules/userblacklist/db_userblacklist.h @@ -1,4 +1,3 @@ - /*! * \file * \ingroup db diff --git a/modules/userblacklist/userblacklist.c b/modules/userblacklist/userblacklist.c index 73bcd0ca24b..494c92a947e 100644 --- a/modules/userblacklist/userblacklist.c +++ b/modules/userblacklist/userblacklist.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright (C) 2007 1&1 Internet AG * * This file is part of Kamailio, a free SIP server.