[sr-dev] git:master:880a14a6: uac: Add reg_hash_size parameter

Daniel-Constantin Mierla miconda at gmail.com
Wed May 5 20:45:28 CEST 2021


Module: kamailio
Branch: master
Commit: 880a14a6f45af27001ec348e9b44134915bcbeb7
URL: https://github.com/kamailio/kamailio/commit/880a14a6f45af27001ec348e9b44134915bcbeb7

Author: Alex Hermann <alex at hexla.nl>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2021-05-05T20:45:23+02:00

uac: Add reg_hash_size parameter

Allow configuring the hash table size. The default(4) is hardly usable
on anything but a test system.

---

Modified: src/modules/uac/doc/uac_admin.xml
Modified: src/modules/uac/uac.c

---

Diff:  https://github.com/kamailio/kamailio/commit/880a14a6f45af27001ec348e9b44134915bcbeb7.diff
Patch: https://github.com/kamailio/kamailio/commit/880a14a6f45af27001ec348e9b44134915bcbeb7.patch

---

diff --git a/src/modules/uac/doc/uac_admin.xml b/src/modules/uac/doc/uac_admin.xml
index c8271974a3..352d038ea2 100644
--- a/src/modules/uac/doc/uac_admin.xml
+++ b/src/modules/uac/doc/uac_admin.xml
@@ -459,6 +459,26 @@ modparam("uac", "reg_random_delay", 300)
 			</example>
 		</section>
 
+		<section id="uac.p.reg_hash_size">
+			<title><varname>reg_hash_size</varname> (int)</title>
+			<para>
+			 The number of entries of the hash table used by uac_reg to store the
+			 registration records is 2^hash_size. For hash_size=4, the number of
+			 slots of the hash table is 16.
+			</para>
+			<para>
+				<emphasis>Default value is <quote>4</quote> (16 slots).</emphasis>
+			</para>
+			<example>
+				<title>Set <varname>reg_hash_size</varname> parameter</title>
+				<programlisting format="linespecific">
+...
+modparam("uac", "reg_hash_size", 10)
+...
+				</programlisting>
+			</example>
+		</section>
+
 		<section id="uac.p.reg_db_table">
 			<title><varname>reg_db_table</varname> (string)</title>
 			<para>
diff --git a/src/modules/uac/uac.c b/src/modules/uac/uac.c
index 486fed2894..5f0a3ad635 100644
--- a/src/modules/uac/uac.c
+++ b/src/modules/uac/uac.c
@@ -181,6 +181,7 @@ static param_export_t params[] = {
 	{"reg_random_delay",	INT_PARAM,			&reg_random_delay      },
 	{"reg_active",	INT_PARAM,			&reg_active_param      },
 	{"reg_gc_interval",		INT_PARAM,	&_uac_reg_gc_interval	},
+	{"reg_hash_size",	INT_PARAM,			&reg_htable_size      },
 	{"default_socket",	PARAM_STR, &uac_default_socket},
 	{"event_callback",	PARAM_STR,	&uac_event_callback},
 	{0, 0, 0}




More information about the sr-dev mailing list