Module: sip-router
Branch: master
Commit: 3653a528efc6f9f760ec31f506b37e567c6ed275
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=3653a52…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Thu Sep 3 13:16:27 2009 +0300
domain(k): new module parameter - register_myself
- cotrol registration of domain list to 'myself' check callbacks
- disabled by default (requested by Juha Heinanen for backward
compatibility)
---
modules_k/domain/doc/domain_admin.xml | 18 ++++++++++++++++++
modules_k/domain/domain_mod.c | 11 ++++++++---
2 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/modules_k/domain/doc/domain_admin.xml
b/modules_k/domain/doc/domain_admin.xml
index d563ce9..9961dea 100644
--- a/modules_k/domain/doc/domain_admin.xml
+++ b/modules_k/domain/doc/domain_admin.xml
@@ -117,6 +117,24 @@ modparam("domain", "domain_col",
"domain_name")
</programlisting>
</example>
</section>
+ <section>
+ <title><varname>register_myself</varname> (integer)</title>
+ <para>
+ Register the list of domains to match 'myself' check:
+ 0 means no myself registration, 1 means enable myself
+ registration.
+ </para>
+ <para>
+ Default value is 0 (disable).
+ </para>
+ <example>
+ <title>register_myself example</title>
+ <programlisting format="linespecific">
+modparam("domain", "register_myself", 1)
+</programlisting>
+ </example>
+ </section>
+
</section>
<section>
diff --git a/modules_k/domain/domain_mod.c b/modules_k/domain/domain_mod.c
index afefee5..fb70d06 100644
--- a/modules_k/domain/domain_mod.c
+++ b/modules_k/domain/domain_mod.c
@@ -77,6 +77,7 @@ static str db_url = {DEFAULT_RODB_URL, DEFAULT_RODB_URL_LEN};
int db_mode = 0; /* Database usage mode: 0 = no cache, 1 = cache */
str domain_table = {DOMAIN_TABLE, DOMAIN_TABLE_LEN}; /* Name of domain table */
str domain_col = {DOMAIN_COL, DOMAIN_COL_LEN}; /* Name of domain column */
+int domain_reg_myself = 0;
/*
* Other module variables
@@ -110,6 +111,7 @@ static param_export_t params[] = {
{"db_mode", INT_PARAM, &db_mode },
{"domain_table", STR_PARAM, &domain_table.s},
{"domain_col", STR_PARAM, &domain_col.s },
+ {"register_myself",INT_PARAM, &domain_reg_myself},
{0, 0, 0}
};
@@ -154,10 +156,13 @@ static int mod_init(void)
LM_ERR("failed to register MI commands\n");
return -1;
}
- if(register_check_self_func(domain_check_self)<0)
+ if(domain_reg_myself!=0)
{
- LM_ERR("failed to register check self function\n");
- return -1;
+ if(register_check_self_func(domain_check_self)<0)
+ {
+ LM_ERR("failed to register check self function\n");
+ return -1;
+ }
}
db_url.len = strlen(db_url.s);