فهرست منبع

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

Carsten Bock 11 سال پیش
والد
کامیت
a9155e4c73

+ 27 - 0
modules/ims_usrloc_pcscf/doc/ims_usrloc_pcscf_admin.xml

@@ -201,6 +201,33 @@ modparam("ims_usrloc_pcscf", "db_mode", 1)
         <programlisting format="linespecific">...
 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>

+ 2 - 1
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;

+ 4 - 0
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}
 };