<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 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Century Gothic";
        panose-1:2 11 5 2 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
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="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Adding a function to allow either an MI command to update the weighting or having the probing pull the data from the sources was my first thought, however I’m
 hoping to avoid having to run customized modules just to prevent the need to deal with forward compatibility problems down the road.  I’d almost rather build my own load distribution mechanism than deal with that.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:8.0pt;font-family:"Century Gothic","sans-serif";color:black">Brooks Bridges |
</span></b><span style="font-size:8.0pt;font-family:"Century Gothic","sans-serif";color:black">Sr. Voice Services Engineer<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:8.0pt;font-family:"Century Gothic","sans-serif";color:maroon">O<sup>1</sup> Communications</span></b><span style="font-size:8.0pt;font-family:"Century Gothic","sans-serif";color:blue"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:7.0pt;font-family:"Century Gothic","sans-serif";color:gray">5190 Golden Foothill Pkwy
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:7.0pt;font-family:"Century Gothic","sans-serif";color:gray">El Dorado Hills, CA 95762</span><span style="font-size:7.0pt;font-family:"Century Gothic","sans-serif";color:blue"><o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:7.0pt;font-family:"Century Gothic","sans-serif";color:maroon">office:</span></b><span style="font-size:7.0pt;font-family:"Century Gothic","sans-serif";color:blue">
</span><span style="font-size:7.0pt;font-family:"Century Gothic","sans-serif";color:black">916.235.2097 |</span><span style="font-size:7.0pt;font-family:"Century Gothic","sans-serif";color:blue">
</span><b><span style="font-size:7.0pt;font-family:"Century Gothic","sans-serif";color:maroon">main:</span></b><span style="font-size:7.0pt;font-family:"Century Gothic","sans-serif";color:black"> 888.444.1111, Option 2</span><span style="color:blue"><o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:7.0pt;font-family:"Century Gothic","sans-serif";color:maroon">email:</span></b><span style="font-size:7.0pt;font-family:"Century Gothic","sans-serif";color:blue">
<a href="mailto:bbridges@o1.com">bbridges@o1.com</a> </span><span style="font-size:7.0pt;font-family:"Century Gothic","sans-serif";color:black">| </span><b><span style="font-size:7.0pt;font-family:"Century Gothic","sans-serif";color:maroon">web:</span></b><span style="font-size:7.0pt;font-family:"Century Gothic","sans-serif";color:blue">
</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><a href="http://www.o1.com/"><span style="font-size:7.0pt;font-family:"Century Gothic","sans-serif";color:black">www.o1.com</span></a></span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:blue"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:.5in"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> sr-users [mailto:sr-users-bounces@lists.sip-router.org]
<b>On Behalf Of </b>SamyGo<br>
<b>Sent:</b> Thursday, March 24, 2016 11:38 AM<br>
<b>To:</b> Kamailio (SER) - Users Mailing List<br>
<b>Subject:</b> Re: [SR-Users] dynamic weighting for dispatcher<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="margin-left:.5in">Hi Brooks, <o:p></o:p></p>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">While I was trying to figure issue out with my dispatcher issue here is something that I think might work for you. It do requires modifying little bit C code to pull some weight from a redis/memcache of remote destination
 and use that value instead. Somewhere in this function of dispatcher module possibly:<br>
<br>
Ref: <a href="https://github.com/kamailio/kamailio/blob/master/modules/dispatcher/dispatch.c">https://github.com/kamailio/kamailio/blob/master/modules/dispatcher/dispatch.c</a><br>
<br>
<i>/*! \brief<br>
* Timer for checking probing destinations<br>
*<br>
* This timer is regularly fired.<br>
*/</i><br>
<span style="font-family:"Courier New"">void ds_check_timer(unsigned int ticks, void* param)</span><br>
<br>
Since this is probing at regular intervals, code is already there all it needs is to get a number and set it as the destination's weight. <br>
<br>
<br>
Just my crazy idea, but Daniel or Kamailio team might suggest something much better than this. <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">Regards,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">Sammy<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="margin-left:.5in">On Thu, Mar 24, 2016 at 12:30 PM, Brooks Bridges <<a href="mailto:bbridges@o1.com" target="_blank">bbridges@o1.com</a>> wrote:<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
So I’m building a load balancer solution that needs to monitor remote devices at a specific interval via snmp for certain data (channels and cps) and use that data to create a dynamically updated weight for each of the destinations.  I can’t find any reasonable
 mechanism for updating the weight attribute in the dispatcher module itself without having to do some hacky “update the database column then trigger dispatcher.reload” script, which I very much want to avoid.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
 <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
Is this something I should just be thinking of ditching the dispatcher module and rolling my own design or am I missing something obvious?<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
 <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<b><span style="font-size:8.0pt;font-family:"Century Gothic","sans-serif";color:black">Brooks Bridges |
</span></b><span style="font-size:8.0pt;font-family:"Century Gothic","sans-serif";color:black">Sr. Voice Services Engineer</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<b><span style="font-size:8.0pt;font-family:"Century Gothic","sans-serif";color:maroon">O<sup>1</sup> Communications</span></b><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<span style="font-size:7.0pt;font-family:"Century Gothic","sans-serif";color:gray">5190 Golden Foothill Pkwy
</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<span style="font-size:7.0pt;font-family:"Century Gothic","sans-serif";color:gray">El Dorado Hills, CA 95762</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<b><span style="font-size:7.0pt;font-family:"Century Gothic","sans-serif";color:maroon">office:</span></b><span style="font-size:7.0pt;font-family:"Century Gothic","sans-serif";color:blue">
</span><span style="font-size:7.0pt;font-family:"Century Gothic","sans-serif";color:black">916.235.2097 |</span><span style="font-size:7.0pt;font-family:"Century Gothic","sans-serif";color:blue">
</span><b><span style="font-size:7.0pt;font-family:"Century Gothic","sans-serif";color:maroon">main:</span></b><span style="font-size:7.0pt;font-family:"Century Gothic","sans-serif";color:black"> 888.444.1111, Option 2</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<b><span style="font-size:7.0pt;font-family:"Century Gothic","sans-serif";color:maroon">email:</span></b><span style="font-size:7.0pt;font-family:"Century Gothic","sans-serif";color:blue">
<a href="mailto:bbridges@o1.com" target="_blank">bbridges@o1.com</a> </span><span style="font-size:7.0pt;font-family:"Century Gothic","sans-serif";color:black">| </span><b><span style="font-size:7.0pt;font-family:"Century Gothic","sans-serif";color:maroon">web:</span></b><span style="font-size:7.0pt;font-family:"Century Gothic","sans-serif";color:blue">
</span><span style="color:#1F497D"><a href="http://www.o1.com/" target="_blank"><span style="font-size:7.0pt;font-family:"Century Gothic","sans-serif";color:black">www.o1.com</span></a></span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
 <o:p></o:p></p>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:12.0pt;margin-left:.5in">
<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><o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
</div>
</body>
</html>