[prev in list] [next in list] [prev in thread] [next in thread]
List: openser-users
Subject: Re: [SR-Users] rtjson + mhomed and record route (corrected)
From: Diego Nadares <dnadares () gmail ! com>
Date: 2016-12-23 13:18:46
Message-ID: CAP-r+er0KhTgP_=a-SLkMHP0J9_CLJLQ1vSissQjRP3dkvEjSQ () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
I don't know if it's the right way but with modparam("rr",
"enable_double_rr", 1) adds both rr and topoh shows the correct one.
U 2016/12/23 09:58:23.818391 xxx.xxx.xxx.01:5060 -> xxx.xxx.xxx.02:5060
INVITE sip:11111111111@xxx.xxx.xxx.02 SIP/2.0.
Via: SIP/2.0/UDP xxx.xxx.xxx.01:5060;branch=z9hG4bK637b1bca.
Max-Forwards: 70.
U 2016/12/23 09:58:24.031593 172.16.213.38:5060 -> 172.16.208.11:5060
INVITE sip:1153526112@172.16.208.11:5060;user=phone SIP/2.0.
---> Record-Route:
<sip:172.16.213.38;r2=on;lr;ftag=as74a2be20;did=828.389>.<---
Record-Route: <sip:127.0.0.8;line=sr-N6IAzBFsMGZLM>.
So, it;s working now!
Cheers,
Diego
2016-12-22 12:20 GMT-03:00 Diego Nadares <dnadares@gmail.com>:
> Hi list,
>
> We have two eth, one with a private ip and the other with a public ip. We
> have MHOMED configured. The call comes from private network and then is
> routed to a public network via rtjson routing. The call is routed but the
> thing is that the record route is being set with the private one (It's the
> same when calls come from public and is routed to a private network, record
> route has the public and not the private).
>
> With mhomed configured shouldn't Record Route be updated as VIA header?
>
> ".... When activated, sip-router will select a socket that can reach the
> destination (to be able to connect to the remote address). (sip-router
> opens a UDP socket to the destination, then it retrieves the local IP which
> was assigned by the operating system to the new UDP socket. Then this
> socket will be closed and the retrieved IP address will be used as IP
> address in the Via/Record-Route headers)..."
>
> This is part of ngrep
>
> U 2016/12/22 11:24:15.019643 172.16.213.21:5060 -> 172.16.213.38:5060
> INVITE sip:11111111111@172.16.213.38:5060 SIP/2.0.
> Via: SIP/2.0/UDP 172.16.213.21:5060;branch=z9hG4bK-13024-1-0.
> From: "Test" <sip:2222222222@172.16.213.21:5060;user=phone>;tag=1.
> To: <sip:1111111111@172.16.213.38:5060>.
> Call-ID: 1-13024@172.16.213.21.
> CSeq: 1 INVITE.
> Contact: "2222222222 <sip:2222222222@172.16.213.21:5060>.
> ....
>
> U 2016/12/22 11:24:15.023923 172.16.213.38:5060 -> 172.16.213.21:5060
> SIP/2.0 100 trying -- your call is important to us.
> Via: SIP/2.0/UDP 172.16.213.21:5060;branch=z9hG4bK-13024-1-0.
> ....
>
> U 2016/12/22 11:24:15.038695 XXX.XXX.XXX.01:5060 -> XXX.XXX.XXX.02:5060
> INVITE sip:1111111111 <011%201111-1111>@XXX.XXX.XXX.02:5060 SIP/2.0.
> *-----> Record-Route: <sip:172.16.213.38;lr;ftag=1;did=1111>. <----*
> Via: SIP/2.0/UDP XXX.XXX.XXX.01;branch=z9hG4bKc09f
> Via: SIP/2.0/UDP 127.0.0.8;branch=z9hG4bKsr-j4IPOlV7MGQKatycM.NLOBF6
>
> This is my cfg
>
> mhomed=1
>
> request_route {
>
>
> # per request initial checks
> route(REQINIT);
>
> # NAT detection
> #route(NATDETECT);
>
> # CANCEL processing
> if (is_method("CANCEL")) {
> if (t_check_trans()) {
> route(RELAY);
> }
> exit;
> }
>
> # handle requests within SIP dialogs
> route(WITHINDLG);
>
> ### only initial requests (no To tag)
>
> # handle retransmissions
> if(t_precheck_trans()) {
> t_check_trans();
> exit;
> }
> t_check_trans();
>
> # authentication
> route(AUTH);
>
> # record routing for dialog forming requests (in case they are
> routed)
> # - remove preloaded route headers
> remove_hf("Route");
> if (is_method("INVITE|SUBSCRIBE")) {
> record_route();
> }
> ....
>
> Thanks in advance.
>
> Diego
>
> 2016-12-22 12:08 GMT-03:00 Diego Nadares <dnadares@gmail.com>:
>
>> Hi list,
>>
>> We have two eth, one with a private ip and the other with a public ip.
>> We have MHOMED configured. The call comes from private network and then is
>> routed to a public network via rtjson routing. The is routed but the thing
>> is that the record route is being set with the private one (It's the same
>> when calls come from public and is routed to a private network, record
>> route has the public and not the private).
>>
>> With mhomed configured shouldn't Record Route be updated as VIA header
>>
>> ".... When activated, sip-router will select a socket that can reach the
>> destination (to be able to connect to the remote address). (sip-router
>> opens a UDP socket to the destination, then it retrieves the local IP which
>> was assigned by the operating system to the new UDP socket. Then this
>> socket will be closed and the retrieved IP address will be used as IP
>> address in the Via/Record-Route headers)..."
>>
>> This is part of ngrep
>>
>> U 2016/12/22 11:24:15.019643 172.16.213.21:5060 -> 172.16.213.38:5060
>> INVITE sip:11111111111@172.16.213.38:5060 SIP/2.0.
>> Via: SIP/2.0/UDP 172.16.213.21:5060;branch=z9hG4bK-13024-1-0.
>> From: "Test" <sip:2222222222@172.16.213.21:5060;user=phone>;tag=1.
>> To: <sip:1111111111@172.16.213.38:5060>.
>> Call-ID: 1-13024@172.16.213.21.
>> CSeq: 1 INVITE.
>> Contact: "2222222222 <sip:2222222222@172.16.213.21:5060>.
>> ....
>>
>> U 2016/12/22 11:24:15.023923 172.16.213.38:5060 -> 172.16.213.21:5060
>> SIP/2.0 100 trying -- your call is important to us.
>> Via: SIP/2.0/UDP 172.16.213.21:5060;branch=z9hG4bK-13024-1-0.
>> ....
>>
>> U 2016/12/22 11:24:15.038695 XXX.XXX.XXX.01:5060 -> XXX.XXX.XXX.02:5060
>> INVITE sip:1111111111 <011%201111-1111>@XXX.XXX.XXX.02:5060 SIP/2.0.
>> *-----> Record-Route: <sip:172.16.213.38;lr;ftag=1;did=1111>. <----*
>> Via: SIP/2.0/UDP XXX.XXX.XXX.01;branch=z9hG4bKc09f
>> Via: SIP/2.0/UDP 127.0.0.8;branch=z9hG4bKsr-j4IPOlV7MGQKatycM.NLOBF6
>>
>> This is my cfg
>>
>> mhomed=1
>>
>> request_route {
>>
>>
>> # per request initial checks
>> route(REQINIT);
>>
>> # NAT detection
>> #route(NATDETECT);
>>
>> # CANCEL processing
>> if (is_method("CANCEL")) {
>> if (t_check_trans()) {
>> route(RELAY);
>> }
>> exit;
>> }
>>
>> # handle requests within SIP dialogs
>> route(WITHINDLG);
>>
>> ### only initial requests (no To tag)
>>
>> # handle retransmissions
>> if(t_precheck_trans()) {
>> t_check_trans();
>> exit;
>> }
>> t_check_trans();
>>
>> # authentication
>> route(AUTH);
>>
>> # record routing for dialog forming requests (in case they are
>> routed)
>> # - remove preloaded route headers
>> remove_hf("Route");
>> if (is_method("INVITE|SUBSCRIBE")) {
>> record_route();
>> }
>>
>>
>> Thanks in advance.
>>
>> Diego.
>>
>>
>
[Attachment #5 (text/html)]
<div dir="ltr">I don't know if it's the right way but with \
modparam("rr", "enable_double_rr", 1) adds both rr and topoh \
shows the correct one.<div><br></div><div><br></div><div><div>U 2016/12/23 \
09:58:23.818391 xxx.xxx.xxx.01:5060 -> xxx.xxx.xxx.02:5060</div><div>INVITE \
sip:11111111111@xxx.xxx.xxx.02 SIP/2.0.</div><div>Via: SIP/2.0/UDP \
xxx.xxx.xxx.01:5060;branch=z9hG4bK637b1bca.</div><div>Max-Forwards: \
70.</div></div><div><br></div><div>U 2016/12/23 09:58:24.031593 <a \
href="http://172.16.213.38:5060">172.16.213.38:5060</a> -> <a \
href="http://172.16.208.11:5060">172.16.208.11:5060</a><br></div><div><div>INVITE \
sip:1153526112@172.16.208.11:5060;user=phone SIP/2.0.</div><div>---> Record-Route: \
<sip:172.16.213.38;r2=on;lr;ftag=as74a2be20;did=828.389>.<---</div><div>Record-Route: \
<sip:127.0.0.8;line=sr-N6IAzBFsMGZLM>.</div></div><div><br></div><div>So, it;s \
working now!</div><div><br></div><div>Cheers,</div><div><br></div><div>Diego</div><div><br></div></div><div \
class="gmail_extra"><br><div class="gmail_quote">2016-12-22 12:20 GMT-03:00 Diego \
Nadares <span dir="ltr"><<a href="mailto:dnadares@gmail.com" \
target="_blank">dnadares@gmail.com</a>></span>:<br><blockquote class="gmail_quote" \
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div \
dir="ltr"><span style="font-size:13px">Hi list,</span><div \
style="font-size:13px"><br><div>We have two eth, one with a private ip and the \
other with a public ip. We have MHOMED configured. The call comes from private \
network and then is routed to a public network via rtjson routing. The call is routed \
but the thing is that the record route is being set with the private one (It's \
the same when calls come from public and is routed to a private network, record route \
has the public and not the private).</div><div><br></div><div>With mhomed configured \
shouldn't Record Route be updated as VIA \
header?</div><div><br></div><div>"....<span \
style="color:rgb(0,0,0);font-family:sans-serif"> </span><span \
style="color:rgb(0,0,0);font-family:sans-serif">When activated, sip-router will \
select a socket that can reach the destination (to be able to connect to the remote \
address). (sip-router opens a UDP socket to the destination, then it retrieves the \
local IP which was assigned by the operating system to the new UDP socket. Then this \
socket will be closed and the retrieved IP address will be used as IP address in the \
Via/Record-Route headers)..."</span></div><div><br></div><div>This is part of \
ngrep</div><div><br></div><div><div>U 2016/12/22 11:24:15.019643 <a \
href="http://172.16.213.21:5060/" target="_blank">172.16.213.21:<wbr>5060</a> -> \
<a href="http://172.16.213.38:5060/" \
target="_blank">172.16.213.38:5060</a></div><div>INVITE <a \
href="http://sip:11111111111@172.16.213.38:5060/" \
target="_blank">sip:11111111111@172.16.<wbr>213.38:5060</a> SIP/2.0.</div><div>Via: \
SIP/2.0/UDP 172.16.213.21:5060;branch=z9hG<wbr>4bK-13024-1-0.</div><div>From: \
"Test" <<a href="mailto:sip%3A2222222222@172.16.213.21" \
target="_blank">sip:2222222222@172.16.213.21</a>:<wbr>5060;user=phone>;tag=1.</div><div>To: \
<<a href="http://sip:1111111111@172.16.213.38:5060/" \
target="_blank">sip:1111111111@172.16.213.38:<wbr>5060</a>>.</div><div>Call-ID: \
<a href="mailto:1-13024@172.16.213.21" \
target="_blank">1-13024@172.16.213.21</a><wbr>.</div><div>CSeq: 1 \
INVITE.</div><div>Contact: "2222222222 <<a \
href="http://sip:2222222222@172.16.213.21:5060/" \
target="_blank">sip:2222222222@172.16.213.21:<wbr>5060</a>>.</div></div><div>....</div><div><br></div><div><div>U \
2016/12/22 11:24:15.023923 <a href="http://172.16.213.38:5060/" \
target="_blank">172.16.213.38:<wbr>5060</a> -> <a \
href="http://172.16.213.21:5060/" \
target="_blank">172.16.213.21:5060</a></div><div>SIP/2.0 100 trying -- your call is \
important to us.</div><div>Via: SIP/2.0/UDP \
172.16.213.21:5060;branch=z9hG<wbr>4bK-13024-1-0.</div></div><div>....</div><div><br></div><div><div>U \
2016/12/22 11:24:15.038695 XXX.XXX.XXX.01:5060 -> \
XXX.XXX.XXX.02:5060</div><div>INVITE sip:<a href="tel:011%201111-1111" \
value="+541111111111" target="_blank">1111111111</a>@XXX.XXX.XXX.02:<wbr>5060 \
SIP/2.0.</div><div><b>-----> Record-Route: \
<sip:172.16.213.38;lr;ftag=1;d<wbr>id=1111>. <----</b></div><div>Via: \
SIP/2.0/UDP XXX.XXX.XXX.01;branch=z9hG4bKc<wbr>09f</div><div>Via: SIP/2.0/UDP \
127.0.0.8;branch=z9hG4bKsr-j4I<wbr>POlV7MGQKatycM.NLOBF6</div></div><div><br></div><div>This \
is my cfg</div><div><br></div><div>mhomed=1</div><div><br></div><div><div>request_route \
{</div><div><br></div><div><br></div><div> # per request initial \
checks</div><div> route(REQINIT);</div><div><br></div><div> # \
NAT detection</div><div> #route(NATDETECT);</div><div><br></div><div> \
# CANCEL processing</div><div> if (is_method("CANCEL")) \
{</div><div> if (t_check_trans()) {</div><div> \
route(RELAY);</div><div> }</div><div> \
exit;</div><div> }</div><div><br></div><div> # handle requests \
within SIP dialogs</div><div> route(WITHINDLG);</div><div><br></div><div> \
### only initial requests (no To tag)</div><div><br></div><div> # handle \
retransmissions</div><div> if(t_precheck_trans()) {</div><div> \
t_check_trans();</div><div> exit;</div><div> \
}</div><div> t_check_trans();</div><div><br></div><div> # \
authentication</div><div> route(AUTH);</div><div><br></div><div> \
# record routing for dialog forming requests (in case they are routed)</div><div> \
# - remove preloaded route headers</div><div> \
remove_hf("Route");</div><div> if \
(is_method("INVITE|SUBSCRIBE")<wbr>) {</div><div> \
record_route();</div><div> }</div></div></div><div \
style="font-size:13px">....</div><div style="font-size:13px"><br></div><div \
style="font-size:13px">Thanks in advance.</div><div \
class="gmail_extra"><br></div><div class="gmail_extra">Diego</div><div \
class="gmail_extra"><br><div class="gmail_quote">2016-12-22 12:08 GMT-03:00 Diego \
Nadares <span dir="ltr"><<a href="mailto:dnadares@gmail.com" \
target="_blank">dnadares@gmail.com</a>></span>:<br><blockquote class="gmail_quote" \
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div \
dir="ltr">Hi list,<div><br><div>We have two eth, one with a private ip and the \
other with a public ip. We have MHOMED configured. The call comes from private \
network and then is routed to a public network via rtjson routing. The is routed but \
the thing is that the record route is being set with the private one (It's the \
same when calls come from public and is routed to a private network, record route has \
the public and not the private).</div><div><br></div><div>With mhomed configured \
shouldn't Record Route be updated as VIA header \
</div><div><br></div><div>"....<span \
style="color:rgb(0,0,0);font-family:sans-serif;font-size:13px"> </span><span \
style="color:rgb(0,0,0);font-family:sans-serif;font-size:13px">When activated, \
sip-router will select a socket that can reach the destination (to be able to connect \
to the remote address). (sip-router opens a UDP socket to the destination, then it \
retrieves the local IP which was assigned by the operating system to the new UDP \
socket. Then this socket will be closed and the retrieved IP address will be used as \
IP address in the Via/Record-Route \
headers)..."</span></div><div><br></div><div>This is part of \
ngrep</div><div><br></div><div><div>U 2016/12/22 11:24:15.019643 <a \
href="http://172.16.213.21:5060" target="_blank">172.16.213.21:5060</a> -> <a \
href="http://172.16.213.38:5060" \
target="_blank">172.16.213.38:5060</a></div><div>INVITE <a \
href="http://sip:11111111111@172.16.213.38:5060" \
target="_blank">sip:11111111111@172.16.213.38:<wbr>5060</a> SIP/2.0.</div><div>Via: \
SIP/2.0/UDP 172.16.213.21:5060;branch=z9hG<wbr>4bK-13024-1-0.</div><div>From: \
"Test" <<a href="mailto:sip%3A2222222222@172.16.213.21" \
target="_blank">sip:2222222222@172.16.213.21</a>:<wbr>5060;user=phone>;tag=1.</div><div>To: \
<<a href="http://sip:1111111111@172.16.213.38:5060" \
target="_blank">sip:1111111111@172.16.213.38:<wbr>5060</a>>.</div><div>Call-ID: <a \
href="mailto:1-13024@172.16.213.21" \
target="_blank">1-13024@172.16.213.21</a>.</div><div>CSeq: 1 \
INVITE.</div><div>Contact: "2222222222 <<a \
href="http://sip:2222222222@172.16.213.21:5060" \
target="_blank">sip:2222222222@172.16.213.21:<wbr>5060</a>>.</div></div><div>....</div><div><br></div><div><div>U \
2016/12/22 11:24:15.023923 <a href="http://172.16.213.38:5060" \
target="_blank">172.16.213.38:5060</a> -> <a href="http://172.16.213.21:5060" \
target="_blank">172.16.213.21:5060</a></div><div>SIP/2.0 100 trying -- your call is \
important to us.</div><div>Via: SIP/2.0/UDP \
172.16.213.21:5060;branch=z9hG<wbr>4bK-13024-1-0.</div></div><div>....</div><div><br></div><div><div>U \
2016/12/22 11:24:15.038695 XXX.XXX.XXX.01:5060 -> \
XXX.XXX.XXX.02:5060</div><div>INVITE sip:<a href="tel:011%201111-1111" \
value="+541111111111" target="_blank">1111111111</a>@XXX.XXX.XXX.02:<wbr>5060 \
SIP/2.0.</div><div><b>-----> Record-Route: \
<sip:172.16.213.38;lr;ftag=1;d<wbr>id=1111>. <----</b></div><div>Via: \
SIP/2.0/UDP XXX.XXX.XXX.01;branch=z9hG4bKc<wbr>09f</div><div>Via: SIP/2.0/UDP \
127.0.0.8;branch=z9hG4bKsr-j4I<wbr>POlV7MGQKatycM.NLOBF6</div></div><div><br></div><div>This \
is my cfg</div><div><br></div><div>mhomed=1</div><div><br></div><div><div>request_route \
{</div><div><br></div><div><br></div><div> # per request initial \
checks</div><div> route(REQINIT);</div><div><br></div><div> # \
NAT detection</div><div> #route(NATDETECT);</div><div><br></div><div> \
# CANCEL processing</div><div> if (is_method("CANCEL")) \
{</div><div> if (t_check_trans()) {</div><div> \
route(RELAY);</div><div> }</div><div> \
exit;</div><div> }</div><div><br></div><div> # handle requests \
within SIP dialogs</div><div> route(WITHINDLG);</div><div><br></div><div> \
### only initial requests (no To tag)</div><div><br></div><div> # handle \
retransmissions</div><div> if(t_precheck_trans()) {</div><div> \
t_check_trans();</div><div> exit;</div><div> \
}</div><div> t_check_trans();</div><div><br></div><div> # \
authentication</div><div> route(AUTH);</div><div><br></div><div> \
# record routing for dialog forming requests (in case they are routed)</div><div> \
# - remove preloaded route headers</div><div> \
remove_hf("Route");</div><div> if \
(is_method("INVITE|SUBSCRIBE")<wbr>) {</div><div> \
record_route();</div><div> \
}</div></div></div><div><br></div><div><br></div><div>Thanks in advance.</div><span \
class="m_-8348965370306492452HOEnZb"><font \
color="#888888"><div><br></div><div>Diego.</div><div><br></div></font></span></div> \
</blockquote></div><br></div></div> </blockquote></div><br></div>
[Attachment #6 (text/plain)]
_______________________________________________
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
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic