[prev in list] [next in list] [prev in thread] [next in thread]
List: serusers
Subject: Re: [SR-Users] alias problem
From: Stoyan Mihaylov <stoyan.v.mihaylov () gmail ! com>
Date: 2012-01-30 15:27:14
Message-ID: CAPScudaaVh2O=LYnOyYg8+srhEOqxVuWUycuJpFCToM8jNbWnA () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Thanks for your response.
What I found is:
1. If call is from phone registered to IP (external or internal) - then I
do not need any of my modifications - ACK goes through loose_route,
or t_check_trans() is OK and ACK is also OK.
2. If call is from phone registered to name (sip.mycompany.com) - then
t_check_trans is not OK, and I have problems.
I understand - it is dirty patch. May be best is if I could somehow replace
from domain name with IP.
At the end - I my dirty solution:
if ( is_method("ACK|BYE") ) {
if ( t_check_trans() ) {
t_relay();
exit;
} else {
route(ACKBYE);
t_relay();
# ACK without matching transaction ... ignore and discard
exit;
}
}
sl_send_reply("404","Uau Not here");
route[ACKBYE] {
#!ifdef WITH_MYFORWARD
xlog("ACKBYE called -$rm-$td-$si");
if(($sht(forw=>$ft))=~"MessageCPIM"){
# Direct messages between clients
return;
}
if(($td=="sip.mycompany.com")||($si=="MyIP")){
$du=$sht(forw=>$ft);
xlog("$du-$rm-$td");
return;
}
#!endif
return;
}
On Mon, Jan 30, 2012 at 11:12 AM, Anca Vamanu <anca.vamanu@1and1.ro> wrote:
> **
> Hi Mihaylov,
>
> If your Asterisk servers add a Record-Route header to the initial Invite,
> for in-dialog requests ( ACK, BYE) you should use *loose_route() *function
> to do the routing. This will make sure the requests go the same path as the
> initial Invite. It is not a good practice to manually route these requests.
>
> Regards,
> Anca
>
>
> On 01/29/2012 11:10 PM, Stoyan Mihaylov wrote:
>
> My whole configuration is:
> [Sip clients] < = > Kamailio 3.2 <=> Asterisk servers (behind Kamailio)
> Asterisk servers have only local IP addresses, and I use t_relay instead
> of forward.
> Kamailio runs on same server as rtpproxy.
> Everything is fine if clients connect to Kamailio with its IP address -
> global, or if they are behind Kamailio with local address.
> When clients connect to Kamailio using sip.ourcompany.com, then call
> (video also) is OK, but ACK and BYE do not work.
> BYE receives not here (404), and ACK die somewhere.
> I forward BYE and ACK in case when src_ip==$td to Asterisk server.
>
> If one of clients use IP - then calls initiated from it are OK (BYE/ACK
> - are going correctly - to Asterisk and to other client also). But calls
> from other client have problems with BYE and ACK.
>
> To use sip.ourcompany.com - I put:
> alias=sip.ourcompany.com
>
>
> route[ACKBYE] {
> #!ifdef WITH_PSTN
> if (is_method("BYE|ACK"))
> {
> xlog("L_ALERT","AB $rm $sht(forw=>$ft) $td");
> if(src_ip==$td){
> #I have to rewrite du - messages loop in Kamailio, I store
> in $sht(forw=>$ft) $du which I use during INVITE.
> $du=$sht(forw=>$ft);
> route(RELAY);
> exit;
> }
> xlog("L_ALERT","ACK,Bye Not me");
> }
> #!endif
> return;
> }
>
>
>
> _______________________________________________
> 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
>
>
[Attachment #5 (text/html)]
Thanks for your response.<div>What I found is:</div><div>1. If call is from phone \
registered to IP (external or internal) - then I do not need any of my modifications \
- ACK goes through loose_route, or t_check_trans() is OK and ACK is also OK.</div> \
<div>2. If call is from phone registered to name (<a \
href="http://sip.mycompany.com">sip.mycompany.com</a>) - then t_check_trans is not \
OK, and I have problems.</div><div>I understand - it is dirty patch. May be best is \
if I could somehow replace from domain name with IP.</div> <div><div>At the end - I \
my dirty solution:</div></div><div><br></div><div><div><span class="Apple-tab-span" \
style="white-space:pre"> </span>if ( is_method("ACK|BYE") ) \
{</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>if ( \
t_check_trans() ) {</div> <div><span class="Apple-tab-span" \
style="white-space:pre"> </span>t_relay();</div><div><span class="Apple-tab-span" \
style="white-space:pre"> </span>exit;</div><div><span class="Apple-tab-span" \
style="white-space:pre"> </span>} else {</div> <div><span class="Apple-tab-span" \
style="white-space:pre"> </span>route(ACKBYE);</div><div><span \
class="Apple-tab-span" style="white-space:pre"> </span>t_relay();</div><div><span \
class="Apple-tab-span" style="white-space:pre"> </span># ACK without matching \
transaction ... ignore and discard</div> <div><span class="Apple-tab-span" \
style="white-space:pre"> </span>exit;</div><div><span class="Apple-tab-span" \
style="white-space:pre"> </span>}</div><div><span class="Apple-tab-span" \
style="white-space:pre"> </span>}</div> <div><span class="Apple-tab-span" \
style="white-space:pre"> </span>sl_send_reply("404","Uau Not \
here");</div></div><div><br></div><div><div>route[ACKBYE] {</div><div>#!ifdef \
WITH_MYFORWARD</div><div>xlog("ACKBYE called -$rm-$td-$si");</div> \
<div><br></div><div><span class="Apple-tab-span" \
style="white-space:pre"> </span>if(($sht(forw=>$ft))=~"MessageCPIM"){</div><div># \
Direct messages between clients</div><div><span class="Apple-tab-span" \
style="white-space:pre"> </span>return;</div> <div><span class="Apple-tab-span" \
style="white-space:pre"> </span>}</div><div><span class="Apple-tab-span" \
style="white-space:pre"> </span>if(($td=="<a \
href="http://sip.mycompany.com">sip.mycompany.com</a>")||($si=="MyIP")){</div>
<div><span class="Apple-tab-span" \
style="white-space:pre"> </span>$du=$sht(forw=>$ft);</div><div><span \
class="Apple-tab-span" \
style="white-space:pre"> </span>xlog("$du-$rm-$td");</div><div><span \
class="Apple-tab-span" style="white-space:pre"> </span>return;</div> <div><span \
class="Apple-tab-span" \
style="white-space:pre"> </span>}</div><div>#!endif</div><div><span \
class="Apple-tab-span" \
style="white-space:pre"> </span>return;</div><div>}</div></div><div><br></div><div><br></div><div>
<br></div><div><br><br><div class="gmail_quote">On Mon, Jan 30, 2012 at 11:12 AM, \
Anca Vamanu <span dir="ltr"><<a \
href="mailto:anca.vamanu@1and1.ro">anca.vamanu@1and1.ro</a>></span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex"> <u></u>
<div bgcolor="#ffffff" text="#000000">
Hi Mihaylov,<br>
<br>
If your Asterisk servers add a Record-Route header to the initial
Invite, for in-dialog requests ( ACK, BYE) you should use <b>loose_route()
</b>function to do the routing. This will make sure the requests go
the same path as the initial Invite. It is not a good practice to
manually route these requests. <br>
<br>
Regards,<br>
Anca <br><div><div class="h5">
<br>
<br>
On 01/29/2012 11:10 PM, Stoyan Mihaylov wrote:
<blockquote type="cite"><span>My whole
configuration is:</span>
<div>[Sip clients] < = > Kamailio 3.2 <=>
Asterisk servers (behind Kamailio)</div>
<div>Asterisk servers have only local IP addresses, and I
use t_relay instead of forward.</div>
<div>Kamailio runs on same server as rtpproxy.</div>
<div>Everything is fine if clients connect to Kamailio with its IP
address - global, or if they are behind Kamailio with local
address.</div>
<div>When clients connect to Kamailio using <a href="http://sip.ourcompany.com" \
target="_blank">sip.ourcompany.com</a>, then call (video also) is OK, but ACK and \
BYE do not work.</div> <div>BYE receives not here (404), and ACK die \
somewhere.</div> <div>I forward BYE and ACK in case when src_ip==$td to Asterisk
server.</div>
<div><br>
</div>
<div>If one of clients use IP - then calls initiated from it are
OK (BYE/ACK - are going correctly - to Asterisk and to other
client also). But calls from other client have problems with BYE
and ACK.</div>
<div><br>
</div>
<div>To use <a href="http://sip.ourcompany.com" \
target="_blank">sip.ourcompany.com</a> - I put:</div>
<div>alias=<a href="http://sip.ourcompany.com" \
target="_blank">sip.ourcompany.com</a></div> <div><br>
</div>
<div><br>
</div>
<div>
<div>
route[ACKBYE] {</div>
<div>#!ifdef WITH_PSTN</div>
<div><span style="white-space:pre-wrap"> </span>if
(is_method("BYE|ACK"))</div>
<div><span style="white-space:pre-wrap"> </span>{</div>
<div>
<span style="white-space:pre-wrap"> \
</span>xlog("L_ALERT","AB $rm $sht(forw=>$ft) $td");</div>
<div><span style="white-space:pre-wrap"> </span>if(src_ip==$td){</div>
<div>#I have to rewrite du - messages loop in Kamailio,
I store in $sht(forw=>$ft) $du which I use during INVITE.</div>
<div><span style="white-space:pre-wrap"> </span>$du=$sht(forw=>$ft);</div>
<div><span style="white-space:pre-wrap"> </span>route(RELAY);</div>
<div><span style="white-space:pre-wrap"> </span>exit;</div>
<div><span style="white-space:pre-wrap"> </span>}</div>
<div><span style="white-space:pre-wrap"> \
</span>xlog("L_ALERT","ACK,Bye Not me");</div>
<div><span style="white-space:pre-wrap"> </span>}</div>
<div>#!endif</div>
<div>return;</div>
<div>}</div>
</div>
<div><br>
</div>
</blockquote>
<br>
</div></div></div>
<br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" \
target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br> \
<br></blockquote></div><br></div>
_______________________________________________
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