On 08/14/2013 07:32 PM, Roberto Fichera wrote:
On 08/14/2013 04:36 PM, Vitaliy Aleksandrov wrote:
If you won't be able to disable SIP ALG on
your router you can fill $avp(received) manually before calling save():
$avp(received) = "sip:" + $si + ":" + $sp +
";transport=" + $proto;
In this case all user location records will have the "received" attribut even
if a UA isn't behind NAT, but I don't
see any problems with that.
This one looks working, but the callee doesn't
answer correctly because the TCP isn't correct:
Contact::
<sip:528@94.94.X.X:1380;transport=TCP;ob>;q=;expires=294;flags=0x0;cflags=0x0;state=0;socket=<tcp:178.79.X.X:5060>;methods=0x1FDF;received=<sip:94.94.X.X:37030;transport=tcp>;user_agent=<PJSUA
v2.1-svn Linux-3.10.5.201/x86_64/glibc-2.17>;reg-id=0
The contact uses a port which isn't translated inside by the router, the received
field shows the right one.
Should I change the Contact header instead? In case, how can I do that?
I didn't understand what "callee doesn't answer correctly" means.
Callee doesn't know what's in the received field of its registration.
The only problem I see is that your router changes ip in the contact
field of REGISTER requests and then kamailio puts this value
(new_ip:old_port) to INVITEs destined to UAs behind your NAT router.
It's not likely, but maybe pjsip doesn't like INVITEs with RURI which
differs from what it put to the contact during registration.
IIRC pjsua prints lots of debugging information. So you can check if
pjsua shows anything when INVITE comes in its log and also attach a
trace of such a call.
P.S. IMHO the best way to pass sip through such routers is sip over TLS.