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

Jason Penton jason.penton at gmail.com
Thu Jun 12 09:14:58 CEST 2014


Hi Klaus,

You are correct. With IPSEC and NAT - the form of IPSEC used is tunneled as
opposed to transport.

Cheers
Jason


On Wed, Jun 11, 2014 at 5:52 PM, Klaus Darilion <
klaus.mailinglists at pernau.at> wrote:

> Is IMS supposed to work with NAT? AFAIK it uses IPsec and I wonder how it
> should work with NAT?
>
> regards
> Klaus
>
> Am 09.06.2014 00:06, schrieb Carsten Bock:
>
>  Absolutely! The current implementation does not work with NAT... :-(
>>
>>  From Syslog:
>> Jun  9 00:02:48 voiceblue-2 /usr/sbin/kamailio[73629]: DEBUG:
>> ims_usrloc_pcscf [usrloc.c:114]: get_aor_hash(): using host in lookup
>> [192.168.178.23]
>> Jun  9 00:02:48 voiceblue-2 /usr/sbin/kamailio[73629]: DEBUG:
>> ims_usrloc_pcscf [udomain.c:473]: get_pcontact(): Searching for
>> contact in P-CSCF usrloc
>> [sip:4989200011250 at 192.168.178.23:1024;alias=92.225.199.
>> 53~1024~1;line=nnh95z41]
>> Jun  9 00:02:48 voiceblue-2 /usr/sbin/kamailio[73629]: DEBUG:
>> ims_usrloc_pcscf [udomain.c:481]: get_pcontact(): Searching for
>> [sip:4989200011250 at 192.168.178.23:1024;alias=92.225.199.
>> 53~1024~1;line=nnh95z41]
>> and comparing to
>> [sip:4989200011250 at 192.168.178.23:1024;alias=92.225.215.
>> 38~1024~1;line=nnh95z41]
>> Jun  9 00:02:48 voiceblue-2 /usr/sbin/kamailio[73629]: DEBUG:
>> ims_registrar_pcscf [service_routes.c:154]: getContactP(): Received
>> host len 13 (search 13)
>> Jun  9 00:02:48 voiceblue-2 /usr/sbin/kamailio[73629]: DEBUG:
>> ims_registrar_pcscf [service_routes.c:159]: getContactP(): Received
>> host 92.225.215.38 (search 92.225.199.53)
>> Jun  9 00:02:48 voiceblue-2 /usr/sbin/kamailio[73629]: WARNING:
>> ims_registrar_pcscf [service_routes.c:176]: getContactP(): Contact not
>> found based on Contact-header, trying IP/Port/Proto
>> Jun  9 00:02:48 voiceblue-2 /usr/sbin/kamailio[73629]: DEBUG:
>> ims_usrloc_pcscf [usrloc.c:114]: get_aor_hash(): using host in lookup
>> [92.225.199.53]
>> Jun  9 00:02:48 voiceblue-2 /usr/sbin/kamailio[73629]: DEBUG:
>> ims_registrar_pcscf [service_routes.c:180]: getContactP(): No entry in
>> usrloc for 92.225.199.53:1024 (Proto 1) found!
>>
>> I have to find a better way, to deal with NAT. I will continue working
>> on this on tuesday...
>>
>> Thanks,
>> Carsten
>>
>>
>> 2014-06-08 21:30 GMT+02:00 Jason Penton <jason.penton at gmail.com>:
>>
>>> You battling with nat?
>>>
>>> On 6 Jun 2014 19:10, "Carsten Bock" <carsten at ng-voice.com> wrote:
>>>
>>>> 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}
>>>>   };
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> sr-dev mailing list
>>>> sr-dev at lists.sip-router.org
>>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
>>>>
>>>
>>> _______________________________________________
>>> sr-dev mailing list
>>> sr-dev at lists.sip-router.org
>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
>>>
>>>
>>
>>
>
> _______________________________________________
> sr-dev mailing list
> sr-dev at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20140612/153277bb/attachment-0001.html>


More information about the sr-dev mailing list