<p>Some comments:</p>

<ul>
<li>loading ordered on priority is using an SQL extension, making the module to fail when used with db_text, db_mongodb or other no-sql backends. This has to be reworked to get rid of the ordering extension specific to sql or made a configuration file option (module parameter)</li>
<li>is it a reason to restrict the matching only to r-uri parts of user@domain? May be useful to match also on transport or other parameters. I would live the matching against the full value of the r-uri inside the code. In the config one can set the $ru to whatever it likes to match</li>
<li>the code around the printing of sort_order is looking weird, as you add sort_order.len (which is set before to 0) to the buffer -- it is harmless but doesn't look good when someone is checking the code</li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/kamailio/kamailio/pull/152#issuecomment-111125689">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZTTE_IEEEkJWmKEUdfPgfpLxw1vyks5oSX85gaJpZM4EShTb.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
  <div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
    <link itemprop="url" href="https://github.com/kamailio/kamailio/pull/152#issuecomment-111125689"></link>
    <meta itemprop="name" content="View Pull Request"></meta>
  </div>
  <meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>