<p>As another solution, when using KEMI, I did it by defining a local map/array and then looping and using ipops functions, like next one in Lua:</p>
<pre><code>ALLOWADDR={
    "10.10.10.0/24",,
    "10.11.11.11/32"
};

function ksr_is_src_trusted()
    local srcaddr = KSR.pv.get("$si");
    for idx, val in pairs(ALLOWADDR) do
        if KSR.ipops.ip_is_in_subnet(srcaddr, val) > 0 then
            return true;
        end
    end
    return false;
end
</code></pre>
<p>Then reload Lua script.</p>
<p>Also, if you match on IP only, then you can use dispatcher module, there are functions to match addresses in a group.</p>
<p>Then, permissions module has functionality to work with text files, but I am not sure they map on trusted or address table, never used those features, but I expect to be something documented in the readme.</p>
<p>Finally, I actually considered to implement an embedded solution in the module to work with a text file for address matching (I am not using allow_trusted(), only allow_address()), but I didn't get there yet, finding other variants so far when I wanted to avoid database.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/2037?email_source=notifications&email_token=ABO7UZMLI2ZWP4LPYQS77WTQFUCZNA5CNFSM4INCULJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4ZBJCQ#issuecomment-523375754">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZPZPLTWS52X3RYC7GLQFUCZNANCNFSM4INCULJA">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABO7UZPPH5QZMTU6WLHJIWLQFUCZNA5CNFSM4INCULJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4ZBJCQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/2037?email_source=notifications\u0026email_token=ABO7UZMLI2ZWP4LPYQS77WTQFUCZNA5CNFSM4INCULJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4ZBJCQ#issuecomment-523375754",
"url": "https://github.com/kamailio/kamailio/issues/2037?email_source=notifications\u0026email_token=ABO7UZMLI2ZWP4LPYQS77WTQFUCZNA5CNFSM4INCULJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4ZBJCQ#issuecomment-523375754",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>