[sr-dev] git:master: ims_usrloc_pcscf: Add option, to disable the "received check" upon lookup.

Carsten Bock carsten at ng-voice.com
Fri Jun 6 19:10:31 CEST 2014


Module: sip-router
Branch: master
Commit: a9155e4c73d533d0837bfd480ff7d838d18dc995
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a9155e4c73d533d0837bfd480ff7d838d18dc995

Author: Carsten Bock <carsten at ng-voice.com>
Committer: Carsten Bock <carsten at ng-voice.com>
Date:   Fri Jun  6 19:09:55 2014 +0200

ims_usrloc_pcscf: Add option, to disable the "received check" upon lookup.

---

 .../doc/ims_usrloc_pcscf_admin.xml                 |   27 ++++++++++++++++++++
 modules/ims_usrloc_pcscf/udomain.c                 |    3 +-
 modules/ims_usrloc_pcscf/ul_mod.c                  |    4 +++
 3 files changed, 33 insertions(+), 1 deletions(-)

diff --git a/modules/ims_usrloc_pcscf/doc/ims_usrloc_pcscf_admin.xml b/modules/ims_usrloc_pcscf/doc/ims_usrloc_pcscf_admin.xml
index 43c91f8..2bdb7c1 100644
--- a/modules/ims_usrloc_pcscf/doc/ims_usrloc_pcscf_admin.xml
+++ b/modules/ims_usrloc_pcscf/doc/ims_usrloc_pcscf_admin.xml
@@ -204,6 +204,33 @@ modparam("ims_usrloc_pcscf", "hashing_type", 1)
 </programlisting>
       </example>
     </section>
+ <section>
+      <title>lookup_check_received (int)</title>
+
+      <para>If set to 1 (default), the Host in the contact will be checked
+	against the Host, from which the request was received.</para>
+
+      <itemizedlist>
+        <listitem>
+          <para>0 - Upon lookup, do not check the host against received.</para>
+        </listitem>
+
+        <listitem>
+          <para>1 - Compare the host in the contact against the received info.</para>
+        </listitem>
+      </itemizedlist>
+
+      <para><emphasis>Default value is 1.</emphasis></para>
+
+      <example>
+        <title>Set lookup_check_received parameter</title>
+
+        <programlisting format="linespecific">...
+modparam("ims_usrloc_pcscf", "lookup_check_received", 0)
+...
+</programlisting>
+      </example>
+    </section>
   </section>
 
   <section>
diff --git a/modules/ims_usrloc_pcscf/udomain.c b/modules/ims_usrloc_pcscf/udomain.c
index d655dea..e19b0f4 100644
--- a/modules/ims_usrloc_pcscf/udomain.c
+++ b/modules/ims_usrloc_pcscf/udomain.c
@@ -63,6 +63,7 @@
 
 extern int db_mode;
 extern unsigned int hashing_type;
+extern int lookup_check_received;
 
 #ifdef STATISTICS
 static char *build_stat_name( str* domain, char *var_name)
@@ -471,7 +472,7 @@ int get_pcontact(udomain_t* _d, str* _contact, struct pcontact** _c) {
 				_contact->len,
 				_contact->s);
 
-		if ((c->aorhash == aorhash) && (c->aor.len == _contact->len)
+		if (lookup_check_received && (c->aorhash == aorhash) && (c->aor.len == _contact->len)
 				&& !memcmp(c->aor.s, _contact->s, _contact->len)) {
 			*_c = c;
 			return 0;
diff --git a/modules/ims_usrloc_pcscf/ul_mod.c b/modules/ims_usrloc_pcscf/ul_mod.c
index 998d4bc..d9e2b08 100644
--- a/modules/ims_usrloc_pcscf/ul_mod.c
+++ b/modules/ims_usrloc_pcscf/ul_mod.c
@@ -85,6 +85,8 @@ int db_mode         = 0;						/*!< Database sync scheme: 0-no db, 1-write throug
 int ul_fetch_rows 	= 2000;
 int hashing_type 	= 0;						/*!< has type for storing P-CSCF contacts - 0 - use full contact AOR, 1 - use IP:PORT only */
 
+int lookup_check_received = 1;						/*!< Should we check received on lookup?
+
 db1_con_t* ul_dbh = 0;
 db_func_t ul_dbf; 
 
@@ -109,6 +111,8 @@ static param_export_t params[] = {
 	{"timer_interval",      INT_PARAM, &timer_interval  },
 	{"db_mode",             INT_PARAM, &db_mode         },
 	{"hashing_type",		INT_PARAM, &hashing_type	},
+	{"lookup_check_received",		INT_PARAM, &lookup_check_received	},
+
 	{0, 0, 0}
 };
 




More information about the sr-dev mailing list