Hello,

received is added because the client requests that via rport parameter or because of using rport. If the processed request is REGISTER, you can try removing rport/received parameters from Via, then do msg_apply_changes().

However, without rport enforcement, the response might not be routed back, because SIP says to send it back to the address in Via, which is invalid in websocket case.

Maybe you can rewrite headers in nginx or use kamailio as a proxy/load balancer instead of nginx and then you have plenty of options to play with sip headers.

Cheers,
Daniel

On 06/10/14 02:39, Gonzalo Gasca wrote:
I'm using Kamailio as SIP Registrar using Websockets.
My topology looks like this:

Sip client (sipml5) ---> wss ---> Nginx ---> ws ---> Kamailio 4.1.5

When I look into my SipMl5 application in the Register Message 200 OK
from Kamailio I see the Nginx private IP address 172.31.22.2

Via: SIP/2.0/WSS
df7jal23ls0d.invalid;rport=37111;received=172.31.22.2;branch=z9hG4bKtv75otkzmPVsdNWevweLt4TN9JnLnQ0p

How can I remove private IP Address in Via header to achieve topology hiding?

 From Kamailio logs:

Oct  6 00:34:21 ip-172-31-27-85 /usr/sbin/kamailio[8941]: DEBUG:
registrar [reply.c:374]: build_contact(): created Contact HF: Contact:
<sips:gogasca@df7jal23ls0d.invalid;rtcweb-breaker=no;transport=wss>;expires=200#015#012
Oct  6 00:34:21 ip-172-31-27-85 /usr/sbin/kamailio[8941]: DEBUG: sl
[sl.c:288]: send_reply(): reply in stateless mode (sl)
Oct  6 00:34:21 ip-172-31-27-85 /usr/sbin/kamailio[8941]: DEBUG:
<core> [msg_translator.c:204]: check_via_address():
check_via_address(172.31.22.2, df7jal23ls0d.invalid, 0)
O


Version: kamailio 4.1.5 (x86_64/linux)

# ------ topoh --------

modparam("topoh", "mask_key", "opencall")
modparam("topoh", "mask_ip", "<Public IP Address of Kamailio>")
modparam("topoh", "vparam_prefix", "llamato")
modparam("topoh", "mask_callid", 1)
modparam("topoh", "sanity_checks", 1)


_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda

_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

Reply via email to