<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body>
<div style="color: rgb(33, 33, 33); background-color: rgb(255, 255, 255); text-align: left;" dir="auto">
Do I set the dlg_manage() function in the correct part of kamailio.cfg ?? I set it before sending Invite message to remote side.</div>
<div style="color: rgb(33, 33, 33); background-color: rgb(255, 255, 255); text-align: left;" dir="auto">
<br>
</div>
<div style="color: rgb(33, 33, 33); background-color: rgb(255, 255, 255); text-align: left;" dir="auto">
Any help would be great :)</div>
<div id="ms-outlook-mobile-signature" dir="auto" style="text-align: left;">
<div><br>
</div>
<div dir="auto" style="text-align: left;">Regards</div>
<div dir="auto" style="text-align: left;"><br>
</div>
<div dir="auto" style="text-align: left;">Egemen U.</div>
<div dir="auto" style="text-align: left;"><br>
</div>
Get <a href="https://aka.ms/ghei36">Outlook for Android</a></div>
<div id="id-efab975c-5bfc-4aee-817c-20c8c2c4191c" class="ms-outlook-mobile-reference-message">
<div style="font-family: sans-serif; font-size: 12pt; color: rgb(0, 0, 0);"><br>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg"><strong>From:</strong> sr-users <sr-users-bounces@lists.kamailio.org> on behalf of egemen ulus <ulus_egemen@hotmail.com><br>
<strong>Sent:</strong> Monday, September 14, 2020, 5:11 PM<br>
<strong>To:</strong> Henning Westerholt; Kamailio (SER) - Users Mailing List<br>
<strong>Subject:</strong> Re: [SR-Users] Kamailio does not forward BYE to Asterisk<br>
</div>
<br>
<meta content="text/html; charset=Windows-1252">
<div dir="auto" style="color:rgb(33,33,33); background-color:rgb(255,255,255); text-align:left">
Hi Henning,</div>
<div dir="auto" style="color:rgb(33,33,33); background-color:rgb(255,255,255); text-align:left">
<br>
</div>
<div dir="auto" style="color:rgb(33,33,33); background-color:rgb(255,255,255); text-align:left">
Thank you for your response. I have checked with debug mode, here is the result; It can't find the dialog that is why it sends "404 Not Here" even though callid is the same.</div>
<div dir="auto" style="color:rgb(33,33,33); background-color:rgb(255,255,255); text-align:left">
<br>
</div>
<div dir="auto" style="color:rgb(33,33,33); background-color:rgb(255,255,255); text-align:left">
Dialog that is kept in DB:</div>
<div dir="auto" style="color:rgb(33,33,33); background-color:rgb(255,255,255); text-align:left">
<br>
</div>
<div dir="auto" style="color:rgb(33,33,33); background-color:rgb(255,255,255); text-align:left">
<span>dialog memory records<br>
</span>
<div>dialog:: hash=1056:7783<br>
</div>
<div> state:: 4<br>
</div>
<div> ref_count:: 2<br>
</div>
<div> timestart:: 1600091398<br>
</div>
<div> timeout:: 90338404<br>
</div>
<div> callid:: 18f82088676a5d7f7c94e4f96c34a41f@asterisk_ip<br>
</div>
<div> from_uri:: sip:90850532xyzt@asterisk_ip<br>
</div>
<div> from_tag:: as00b3f8a9<br>
</div>
<div> caller_contact:: sip:908505326011@asterisk_ip:5060<br>
</div>
<div> caller_cseq:: 102<br>
</div>
<div> caller_route_set::<br>
</div>
<div> caller_bind_addr:: udp:kamailio_ip:5060<br>
</div>
<div> callee_bind_addr:: udp:kamailio_ip:5060<br>
</div>
<div> to_uri:: sip:333305458596985@remote_sipserver<br>
</div>
<div> to_tag:: as7cf5b3da<br>
</div>
<div> callee_contact:: sip:333305458596985@:<span style="background-color:rgb(255,255,255); display:inline!important">remote_sipserver:</span>5060<br>
</div>
<div> callee_cseq:: 0<br>
</div>
<div> callee_route_set:: <sip:remote_sipserver;lr><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div dir="auto" style="text-align:left">Debug output for BYE message:</div>
<div dir="auto" style="text-align:left"><br>
</div>
<div>NOTICE: acc [acc.c:317]: acc_log_request(): ACC: <br>
</div>
<span>transaction answered: timestamp=1600091398;method=BYE;from_tag=as7cf5b3da;to_tag=as00b3f8a9;call_id=18f82088676a5d7f7c94e4f96c34a41f@asterisk_ip;code=404;reason=Not here;src_user=333305458596985;src_domain=remote_sipserver;src_ip=remote_sipserver;dst_ouser=90850532xyzt;dst_user=;dst_domain=kamailio_ip</span><br>
</div>
<div id="ms-outlook-mobile-signature" dir="auto" style="text-align:left">
<div><br>
</div>
<div><br>
</div>
<div dir="auto" style="text-align:left">Bye request header:</div>
<div dir="auto" style="text-align:left"><br>
</div>
<div dir="auto" style="text-align:left">BYE sip:90850532xyzt@kamailio_ip SIP/2.0<br>
</div>
<div><br>
</div>
<div dir="auto" style="text-align:left">And this is how I used dlg_manage() in Kamailio cfg (In RELAY):</div>
<div dir="auto" style="text-align:left"><br>
</div>
<div dir="auto" style="text-align:left"><span>if (src_ip == x.x.x.x/26) {<br>
</span>
<div> if (is_method("INVITE|ACK")) {<br>
</div>
<div> setflag(FLT_DLGINFO);<br>
</div>
<div> dlg_manage();<br>
</div>
<div> $var(x) = $tU;<br>
</div>
<div> $var(y) = $(var(x){s.striptail,11});<br>
</div>
<div> $var(recieved)='';<br>
</div>
<div> sql_pvquery("cb", "select ipaddress from prefixes where prefix = $var(y)", "$var(recieved)");<br>
</div>
<div> uac_replace_from("sip:$fU@$var(recieved)");<br>
</div>
<div> xlog("L_WARN","$var(recieved)\n");<br>
</div>
<div> remove_hf("Contact");<br>
</div>
<div> append_hf("Contact: <sip:$fU@$var(recieved)>\r\n", "Call-ID");<br>
</div>
<div> $fs = "udp:" + $var(recieved) + ":5060";<br>
</div>
<div> }<br>
</div>
<div> }<br>
</div>
<div> if (!t_relay()) {<br>
</div>
<div> sl_reply_error();<br>
</div>
<span> }</span><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div dir="auto" style="text-align:left">Regards</div>
<div dir="auto" style="text-align:left"><br>
</div>
<div dir="auto" style="text-align:left">Egemen U.</div>
<div><br>
</div>
Get <a href="https://aka.ms/ghei36">Outlook for Android</a></div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Henning Westerholt <hw@skalatan.de><br>
<b>Sent:</b> Monday, September 14, 2020 3:15:48 PM<br>
<b>To:</b> Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org><br>
<b>Cc:</b> egemen ulus <ulus_egemen@hotmail.com><br>
<b>Subject:</b> RE: Kamailio does not forward BYE to Asterisk</font>
<div> </div>
</div>
<style>
<!--
@font-face
{font-family:"Cambria Math"}
@font-face
{font-family:Calibri}
p.x_MsoNormal, li.x_MsoNormal, div.x_MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif}
a:link, span.x_MsoHyperlink
{color:blue;
text-decoration:underline}
span.x_E-MailFormatvorlage20
{font-family:"Calibri",sans-serif;
color:windowtext}
.x_MsoChpDefault
{font-size:10.0pt}
@page WordSection1
{margin:70.85pt 70.85pt 2.0cm 70.85pt}
-->
</style>
<div lang="DE">
<div class="x_WordSection1">
<p class="x_MsoNormal"><span style="">Hello Egemen,</span></p>
<p class="x_MsoNormal"><span style=""> </span></p>
<p class="x_MsoNormal"><span lang="EN-GB" style="">have you tried to debug it and find out why the BYE is not routed in this particular case from Kamailio? You already mentioned the R-URI, what is in this particular BYE? Is Kamailio listening on all VLAN IPs?
Just to share some ideas.</span></p>
<p class="x_MsoNormal"><span lang="EN-GB" style=""> </span></p>
<p class="x_MsoNormal"><span lang="EN-GB" style="">About the performance question, I know of some installation that have about 5-10 interfaces on a box and did not heard of problems so far.</span></p>
<p class="x_MsoNormal"><span lang="EN-GB" style=""> </span></p>
<p class="x_MsoNormal"><span lang="EN-GB" style="">The main topic to consider here (iMHO) is that it gets a bit complicated to handle many different interfaces in one kamailio, so for that reasons it might be a good idea to split it to different VMs or instances.</span></p>
<p class="x_MsoNormal"><span lang="EN-GB" style=""> </span></p>
<p class="x_MsoNormal"><span lang="EN-GB" style="">Cheers,</span></p>
<p class="x_MsoNormal"><span lang="EN-GB" style=""> </span></p>
<p class="x_MsoNormal"><span lang="EN-GB" style="">Henning</span></p>
<p class="x_MsoNormal"><span lang="EN-GB" style=""> </span></p>
<div>
<p class="x_MsoNormal"><span lang="EN-GB" style="">-- </span></p>
<p class="x_MsoNormal"><span lang="EN-GB" style="">Henning Westerholt – </span><span style=""><a href="https://skalatan.de/blog/"><span lang="EN-GB" style="color:#0563C1">https://skalatan.de/blog/</span></a></span><span lang="EN-GB" style=""></span></p>
<p class="x_MsoNormal"><span lang="EN-GB" style="">Kamailio services – </span><span style=""><a href="https://gilawa.com/"><span lang="EN-GB" style="color:#0563C1">https://gilawa.com</span></a></span><span style="">
<span lang="EN-GB"></span></span></p>
</div>
<p class="x_MsoNormal"><span lang="EN-GB" style=""> </span></p>
<div>
<div style="border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0cm 0cm 0cm">
<p class="x_MsoNormal" style="margin-left:35.4pt"><b>From:</b> sr-users <sr-users-bounces@lists.kamailio.org>
<b>On Behalf Of </b>egemen ulus<br>
<b>Sent:</b> Friday, September 11, 2020 11:58 AM<br>
<b>To:</b> Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org><br>
<b>Subject:</b> [SR-Users] Kamailio does not forward BYE to Asterisk</p>
</div>
</div>
<p class="x_MsoNormal" style="margin-left:35.4pt"> </p>
<div>
<div>
<p class="x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; color:black">Hi all,
</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; color:black">I have an infrastructure with Kamailio (reg), Asterisks farm, and Kamailio (4.3) proxy which dispatches calls.
</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; color:black"> Trunk-1 (Vlan_A)</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; color:black">Kam(reg) <> Asterisk Farm (5) <> Kam(proxy) <> Trunk-2 (Vlan_B)</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; color:black"> Trunk-3 (Vlan_C)</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; color:black">For each trunk, I have to use the IP of the VLAN interface in "contact header". That means when I need to send a call to Trunk-1 I have to set Vlan_A IP address on
the contact header. I have achieved that by rewriting Contact Header. </span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; color:black">###</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; color:black">remove_hf("Contact:");</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; color:black">append_hf("Contact: <<a href="sip:$fU@$var(recieved)">sip:$fU@$var(recieved)</a>>\r\n", "Call-ID"); #by using db</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; color:black">###</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; color:black">But this causes a problem, Kamailio does not forward the BYE message that comes from Trunk-X to Asterisk (In before, the BYE message had Asterisk IP in R-URI). However,
when I use topoh module it forward properly for one trunk. But I can not set multiple mask IP in topoh module.
</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; color:black">I'm using the dialog module and I thought it can handle all requests in one dialog to forward to the correct asterisk but it did not.
</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; color:black">Is there any suggestion for this case?
</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; color:black">And also how many sub-interfaces can Kamailio handle for a good performance? Or do you suggest multiple Kamailio instances instead of multiple sub-interfaces on one
server?</span></p>
</div>
<p class="x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; color:black"> </span></p>
</div>
<div id="x_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2">
<p class="x_MsoNormal" style="margin-left:35.4pt"> </p>
<table class="x_MsoNormalTable" border="1" cellpadding="0" style="margin-left:35.4pt; border:none; border-top:solid #D3D4DE 1.0pt">
<tbody>
<tr>
<td width="55" style="width:41.25pt; border:none; padding:9.75pt .75pt .75pt .75pt">
<p class="x_MsoNormal"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon" target="_blank"><span style="text-decoration:none"><img border="0" width="46" height="29" id="x__x0000_i1025" src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" style="width:.4791in; height:.302in"></span></a></p>
</td>
<td width="470" style="width:352.5pt; border:none; padding:9.0pt .75pt .75pt .75pt">
<p class="x_MsoNormal" style="line-height:13.5pt"><span style="font-size:10.0pt; font-family:"Arial",sans-serif; color:#41424E">Virus-free.
<a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link" target="_blank">
<span style="color:#4453EA">www.avast.com</span></a> </span></p>
</td>
</tr>
</tbody>
</table>
<p class="x_MsoNormal" style="margin-left:35.4pt"> </p>
</div>
</div>
</div>
<br>
</div>
</body>
</html>