[SR-Users] Kamailio as SBC and far end nat

Klaus Darilion klaus.mailinglists at pernau.at
Thu Jul 19 16:27:53 CEST 2012


There is only one thing left: keep-alive. To keep the NAT pinhole open 
you need periodic traffic from/to the client. Either enable NAT keep 
alive on the SIP client, or on Kamailio (nathelper module and save() the 
contacts just for the purpose of nathelper keep-alive) or on Avaya (e.g. 
if Avaya can send periodic OPTIONS that could help). A dirty workaround 
would be to set registration expiration to a small value, e.g. 45 seconds.

regards
Klaus

On 19.07.2012 15:40, Daniel-Constantin Mierla wrote:
> Hello,
>
> for dialogs (like subscriptions or invites), you have to use record
> routing (see rr module) -- so for initial subscribe/invite you have to
> add record-route header in kamailio, then do loose routing for requests
> within the dialog (like notify) -- the default config file coming with
> kamailio has such logic there.
>
> For registrations, I would suggest the usage of Path extensions, which
> is an ietf rfc, but the registrar server has to support that (avaya sip
> server in your case). Alternative will be to replace the contact in
> register (you can do it for subscribe as well) requests with ip of
> kamailio and a parameter that encodes the nat box ip/port.
>
> A similar mechanism is used by add_contact_alias() function from
> nathelper module to help going through nat -- you can actually use it in
> conjunction with record routing for invites/subscriptions.
>
> Cheers,
> Daniel
>
>
> On 7/19/12 1:12 PM, Martin Schiøtz wrote:
>> Hi
>>
>> I'm trying to configure kamailio version 3.3.0 to be a Session Border
>> Controller which only purpose is to handle far-end-nat.
>>
>> On the far end site I have a SIP client with IP '192.168.1.2' which is
>> NAT'ed to IP 'zz.zz.85.230'. The SIP ALG is disabled on the NAT
>> firewall. The SIP client is communicating with the kamailio server and
>> the Kamailio server is forwarding every thing to an Avaya SIP server
>> 'xx.xx.173.15' and vice versa. The kamilio is konfigured to do this
>> stateless.
>>
>> The REGISTER and SUBSCRIBE part works fine. The kamailio is using the
>> 'Via:' field and I also needed to do subst on the 'Contact:' field in
>> order for our SIP server to communicate back to the kamailio. But when
>> I get to the NOTIFY packet from the SIP server to the kamailio there
>> is no 'Via:' field or any other information about the SIP clients
>> IP/port and the Kamailio just sends back 'SIP/2.0 404 Not here.' to
>> the SIP server.
>>
>> I guess that this can not be solved with a statless kamailio?
>> I guess that I need some kind of state table in the kamailio - is that
>> possible without doing REGISTER directly with the kamailio?
>> Any other good ideas are welcome?
>>
>> Cheers,
>> Martin
>>
>>
>> Tell me if need more info the issue?
>> -----
>> #
>> T xx.xx.173.15:38059 -> yy.yy.159.211:5060 [AP]
>> NOTIFY sip:2001012 at yy.yy.159.211:5060;transport=TCP SIP/2.0.
>> Call-ID: NjQ5ZDNlYzRjOWFjMzMzN2JlYzAwMTg4ODYwZTJlYWY..
>> From: "2001012"
>> <sip:2001012 at bsosip.domain.dk>;tag=-667195155*1*016asm-callprocessing.sar229435981~1342570131099~1170998434~1.
>>
>> To: "2001012" <sip:2001012 at bsosip.domain.dk>;tag=7ca0af7d.
>> CSeq: 3 NOTIFY.
>> Contact: <sip:xx.xx.173.14:15060>.
>> Via: SIP/2.0/TCP
>> xx.xx.173.15;branch=z9hG4bK4DEAAD0E478B838008189457-AP;ft=xx.xx.173.15~13c4.
>>
>> Via: SIP/2.0/UDP
>> xx.xx.173.14:15070;branch=z9hG4bK4DEAAD0E478B838008189457.
>> Via: SIP/2.0/TCP
>> xx.xx.173.14:15070;branch=z9hG4bK4DEAAD0E478B838018189455.
>> Event: message-summary.
>> Content-Type: application/simple-message-summary.
>> Content-Length: 69.
>> Subscription-State: active;expires=299.
>> Max-Forwards: 68.
>> User-Agent:  AVAYA-SM-6.1.4.0.614005.
>> .
>> Messages-Waiting: no.
>> Message-Account: sip:2001012 at bsosip.domain.dk.
>>
>> ##
>> T yy.yy.159.211:5060 -> xx.xx.173.15:38059 [AP]
>> SIP/2.0 404 Not here.
>> Call-ID: NjQ5ZDNlYzRjOWFjMzMzN2JlYzAwMTg4ODYwZTJlYWY..
>> From: "2001012"
>> <sip:2001012 at bsosip.domain.dk>;tag=-667195155*1*016asm-callprocessing.sar229435981~1342570131099~1170998434~1.
>>
>> To: "2001012" <sip:2001012 at bsosip.domain.dk>;tag=7ca0af7d.
>> CSeq: 3 NOTIFY.
>> Via: SIP/2.0/TCP
>> xx.xx.173.15;branch=z9hG4bK4DEAAD0E478B838008189457-AP;ft=xx.xx.173.15~13c4;rport=38059.
>>
>> Via: SIP/2.0/UDP
>> xx.xx.173.14:15070;branch=z9hG4bK4DEAAD0E478B838008189457.
>> Via: SIP/2.0/TCP
>> xx.xx.173.14:15070;branch=z9hG4bK4DEAAD0E478B838018189455.
>> Server: kamailio (3.3.0 (i386/linux)).
>> Content-Length: 0.
>> .
>>
>> #
>> T xx.xx.173.15:38059 -> yy.yy.159.211:5060 [A]
>> ......
>> #
>> T yy.yy.159.211:5060 -> xx.xx.173.15:38059 [AP]
>> SIP/2.0 404 Not here.
>> Call-ID: NjQ5ZDNlYzRjOWFjMzMzN2JlYzAwMTg4ODYwZTJlYWY..
>> From: "2001012"
>> <sip:2001012 at bsosip.domain.dk>;tag=-667195155*1*016asm-callprocessing.sar229435981~1342570131099~1170998434~1.
>>
>> To: "2001012" <sip:2001012 at bsosip.domain.dk>;tag=7ca0af7d.
>> CSeq: 3 NOTIFY.
>> Via: SIP/2.0/TCP
>> xx.xx.173.15;rport=38059;branch=z9hG4bK4DEAAD0E478B838008189457-AP;ft=xx.xx.173.15~13c4.
>>
>> Via: SIP/2.0/UDP
>> xx.xx.173.14:15070;branch=z9hG4bK4DEAAD0E478B838008189457.
>> Via: SIP/2.0/TCP
>> xx.xx.173.14:15070;branch=z9hG4bK4DEAAD0E478B838018189455.
>> Server: kamailio (3.3.0 (i386/linux)).
>> Content-Length: 0.
>> -----
>>
>> _______________________________________________
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>> sr-users at lists.sip-router.org
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>




More information about the sr-users mailing list