<p dir="ltr">You battling with nat? </p>
<div class="gmail_quote">On 6 Jun 2014 19:10, "Carsten Bock" <<a href="mailto:carsten@ng-voice.com">carsten@ng-voice.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Module: sip-router<br>
Branch: master<br>
Commit: a9155e4c73d533d0837bfd480ff7d838d18dc995<br>
URL: <a href="http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a9155e4c73d533d0837bfd480ff7d838d18dc995" target="_blank">http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a9155e4c73d533d0837bfd480ff7d838d18dc995</a><br>
<br>
Author: Carsten Bock <<a href="mailto:carsten@ng-voice.com">carsten@ng-voice.com</a>><br>
Committer: Carsten Bock <<a href="mailto:carsten@ng-voice.com">carsten@ng-voice.com</a>><br>
Date: Fri Jun 6 19:09:55 2014 +0200<br>
<br>
ims_usrloc_pcscf: Add option, to disable the "received check" upon lookup.<br>
<br>
---<br>
<br>
.../doc/ims_usrloc_pcscf_admin.xml | 27 ++++++++++++++++++++<br>
modules/ims_usrloc_pcscf/udomain.c | 3 +-<br>
modules/ims_usrloc_pcscf/ul_mod.c | 4 +++<br>
3 files changed, 33 insertions(+), 1 deletions(-)<br>
<br>
diff --git a/modules/ims_usrloc_pcscf/doc/ims_usrloc_pcscf_admin.xml b/modules/ims_usrloc_pcscf/doc/ims_usrloc_pcscf_admin.xml<br>
index 43c91f8..2bdb7c1 100644<br>
--- a/modules/ims_usrloc_pcscf/doc/ims_usrloc_pcscf_admin.xml<br>
+++ b/modules/ims_usrloc_pcscf/doc/ims_usrloc_pcscf_admin.xml<br>
@@ -204,6 +204,33 @@ modparam("ims_usrloc_pcscf", "hashing_type", 1)<br>
</programlisting><br>
</example><br>
</section><br>
+ <section><br>
+ <title>lookup_check_received (int)</title><br>
+<br>
+ <para>If set to 1 (default), the Host in the contact will be checked<br>
+ against the Host, from which the request was received.</para><br>
+<br>
+ <itemizedlist><br>
+ <listitem><br>
+ <para>0 - Upon lookup, do not check the host against received.</para><br>
+ </listitem><br>
+<br>
+ <listitem><br>
+ <para>1 - Compare the host in the contact against the received info.</para><br>
+ </listitem><br>
+ </itemizedlist><br>
+<br>
+ <para><emphasis>Default value is 1.</emphasis></para><br>
+<br>
+ <example><br>
+ <title>Set lookup_check_received parameter</title><br>
+<br>
+ <programlisting format="linespecific">...<br>
+modparam("ims_usrloc_pcscf", "lookup_check_received", 0)<br>
+...<br>
+</programlisting><br>
+ </example><br>
+ </section><br>
</section><br>
<br>
<section><br>
diff --git a/modules/ims_usrloc_pcscf/udomain.c b/modules/ims_usrloc_pcscf/udomain.c<br>
index d655dea..e19b0f4 100644<br>
--- a/modules/ims_usrloc_pcscf/udomain.c<br>
+++ b/modules/ims_usrloc_pcscf/udomain.c<br>
@@ -63,6 +63,7 @@<br>
<br>
extern int db_mode;<br>
extern unsigned int hashing_type;<br>
+extern int lookup_check_received;<br>
<br>
#ifdef STATISTICS<br>
static char *build_stat_name( str* domain, char *var_name)<br>
@@ -471,7 +472,7 @@ int get_pcontact(udomain_t* _d, str* _contact, struct pcontact** _c) {<br>
_contact->len,<br>
_contact->s);<br>
<br>
- if ((c->aorhash == aorhash) && (c->aor.len == _contact->len)<br>
+ if (lookup_check_received && (c->aorhash == aorhash) && (c->aor.len == _contact->len)<br>
&& !memcmp(c->aor.s, _contact->s, _contact->len)) {<br>
*_c = c;<br>
return 0;<br>
diff --git a/modules/ims_usrloc_pcscf/ul_mod.c b/modules/ims_usrloc_pcscf/ul_mod.c<br>
index 998d4bc..d9e2b08 100644<br>
--- a/modules/ims_usrloc_pcscf/ul_mod.c<br>
+++ b/modules/ims_usrloc_pcscf/ul_mod.c<br>
@@ -85,6 +85,8 @@ int db_mode = 0; /*!< Database sync scheme: 0-no db, 1-write throug<br>
int ul_fetch_rows = 2000;<br>
int hashing_type = 0; /*!< has type for storing P-CSCF contacts - 0 - use full contact AOR, 1 - use IP:PORT only */<br>
<br>
+int lookup_check_received = 1; /*!< Should we check received on lookup?<br>
+<br>
db1_con_t* ul_dbh = 0;<br>
db_func_t ul_dbf;<br>
<br>
@@ -109,6 +111,8 @@ static param_export_t params[] = {<br>
{"timer_interval", INT_PARAM, &timer_interval },<br>
{"db_mode", INT_PARAM, &db_mode },<br>
{"hashing_type", INT_PARAM, &hashing_type },<br>
+ {"lookup_check_received", INT_PARAM, &lookup_check_received },<br>
+<br>
{0, 0, 0}<br>
};<br>
<br>
<br>
<br>
_______________________________________________<br>
sr-dev mailing list<br>
<a href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a><br>
</blockquote></div>