<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Vorformatiert Zchn";
        margin:0cm;
        font-size:10.0pt;
        font-family:"Courier New",serif;}
span.HTMLVorformatiertZchn
        {mso-style-name:"HTML Vorformatiert Zchn";
        mso-style-priority:99;
        mso-style-link:"HTML Vorformatiert";
        font-family:Consolas;}
span.E-MailFormatvorlage21
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Hi Lars,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">this should be the relevant check: „sr_dst_max_branches>=MAX_BRANCHES_LIMIT“.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">So, it should be 32, biggest value is then 31. I’ve added some more logging to the git master branch to also log the maximum value and verified it.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">Cheers,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">Henning<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">-- <o:p>
</o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">Henning Westerholt –
</span><span style="mso-fareast-language:EN-US"><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="mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">Kamailio services –
</span><span style="mso-fareast-language:EN-US"><a href="https://gilawa.com/"><span lang="EN-GB" style="color:#0563C1">https://gilawa.com</span></a></span><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-left:35.4pt"><b>From:</b> sr-users <sr-users-bounces@lists.kamailio.org>
<b>On Behalf Of </b>Lars Jansson<br>
<b>Sent:</b> Monday, December 12, 2022 4:32 PM<br>
<b>To:</b> miconda@gmail.com; Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org><br>
<b>Subject:</b> Re: [SR-Users] Increase MAX_BRANCHES_LIMIT<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
<p style="margin-left:35.4pt">Hi Daniel and Henning,<o:p></o:p></p>
<p style="margin-left:35.4pt">Thanks a lot for your answers, this will save me from wasting time on a dead end. 31x31 is plenty, so this is a way forward to workaround the current limitation in tm.<o:p></o:p></p>
<p style="margin-left:35.4pt">Just to see if I understand you correctly, Daniel, regarding the record-routing bit: At first record routing is applied as usual, but when a looped request is received and forked to targets no record routing shall be applied?<o:p></o:p></p>
<p style="margin-left:35.4pt">As a side note I tried setting max_branches=31, but that was not accepted, so I changed to max_branches=30. Perhaps this simply implies that the first branch is enumerated as branch #0 ?<o:p></o:p></p>
<p style="margin-left:35.4pt">Cheers,<br>
Lars<o:p></o:p></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Den 2022-12-12 kl. 09:04, skrev Daniel-Constantin Mierla:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p style="margin-left:35.4pt">Hello,<o:p></o:p></p>
<p style="margin-left:35.4pt">the value 32 for<a name="Logo"> MAX_BRANCHES_LIMIT is a constraint of tm internals which uses a 32 bitmap for some operations, going higher will require coding in tm module.<o:p></o:p></a></p>
<p style="margin-left:35.4pt"><span style="mso-bookmark:Logo">The variant now is to loop one more through kamailio and you can get to 32x32 branches. By doing record route only on one step of looping, then you have this looping only for initial INVITE transaction,
 the re-INVITE, BYE, etc. will go straight.<o:p></o:p></span></p>
<p style="margin-left:35.4pt"><span style="mso-bookmark:Logo">One more note, I am not sure and no time to check the code, one bit might be reserved in the bitmap, so it can be 31x31 branches after one local loop.<o:p></o:p></span></p>
<p style="margin-left:35.4pt"><span style="mso-bookmark:Logo">Cheers,<br>
Daniel<o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="mso-bookmark:Logo">On 10.12.22 13:02, Lars Jansson wrote:<o:p></o:p></span></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p style="margin-left:35.4pt"><span style="mso-bookmark:Logo">Hi,<o:p></o:p></span></p>
<p style="margin-left:35.4pt"><span style="mso-bookmark:Logo">I am building a configuration script where for some traffic flows parallel forking will be needed, and in this case I need to go beyond the default max limit of the max amount of branches.<o:p></o:p></span></p>
<p style="margin-left:35.4pt"><span style="mso-bookmark:Logo">Apart from this specific case the traffic load that kamailio will need to handle is very low, let's say just one second here and there with up to 5 concurrent calls at most.<o:p></o:p></span></p>
<p style="margin-left:35.4pt"><span style="mso-bookmark:Logo">This limit is as far as I understand set here: usr/local/src/kamailio-5.6/kamailio/src/core/config.h<o:p></o:p></span></p>
<p style="margin-left:35.4pt"><span style="mso-bookmark:Logo">And the default limit is:<br>
#define MAX_BRANCHES_LIMIT              32      /*!< limit of maximum number of branches per transaction */<o:p></o:p></span></p>
<p style="margin-left:35.4pt"><span style="mso-bookmark:Logo">Here are the questions I have related to this:<o:p></o:p></span></p>
<p style="margin-left:35.4pt"><span style="mso-bookmark:Logo">1) If I increase the value of this constant in config.h, how high is it reasonable to set this value and still have a stable system?<o:p></o:p></span></p>
<p style="margin-left:35.4pt"><span style="mso-bookmark:Logo">2) If I increase MAX_BRANCHES_LIMIT beyond 32, are there also other parameters that needs to be changed for the system to be able to cope, and if so which</span> parameters?<o:p></o:p></p>
<p style="margin-left:35.4pt">Regards,<br>
Lars<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt"><br>
<br>
<o:p></o:p></p>
<pre style="margin-left:35.4pt">__________________________________________________________<o:p></o:p></pre>
<pre style="margin-left:35.4pt">Kamailio - Users Mailing List - Non Commercial Discussions<o:p></o:p></pre>
<pre style="margin-left:35.4pt"><a href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a><o:p></o:p></pre>
<pre style="margin-left:35.4pt">Important: keep the mailing list in the recipients, do not reply only to the sender!<o:p></o:p></pre>
<pre style="margin-left:35.4pt">Edit mailing list options or unsubscribe:<o:p></o:p></pre>
<pre style="margin-left:35.4pt"><a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><o:p></o:p></pre>
</blockquote>
<pre style="margin-left:35.4pt">-- <o:p></o:p></pre>
<pre style="margin-left:35.4pt">Daniel-Constantin Mierla -- <a href="http://www.asipto.com">www.asipto.com</a><o:p></o:p></pre>
<pre style="margin-left:35.4pt"><a href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a><o:p></o:p></pre>
</blockquote>
</div>
</body>
</html>