[OpenSIPS-Users] OpenSIPS 3.1 - Test if cache is empty?

Mark Allen mark at allenclan.co.uk
Wed Dec 2 16:36:10 EST 2020


Good point - I'll do that

On Wed, 2 Dec 2020 at 16:33, Liviu Chircu <liviu at opensips.org> wrote:

> On 02.12.2020 18:16, Mark Allen wrote:
>
> Thanks so much for your help Liviu. In the end, I used the $shv() approach
> you suggested. It worked like a dream! :-)
>
> In opensips.cfg:
>
>     loadmodule "cfgutils.so"
>         modparam("cfgutils", "shvset", "cacheValid=i:0")
>
>     route{
>         if ($shv(cacheValid) == 0) {
>
> Glad it worked!  Depending on the volume of traffic flowing through your
> instance, maybe it would be better to perform the "is cache valid" check
> within a timer route [1] at a frequency of your choosing, rather than on
> each SIP request.
>
> [1]: https://www.opensips.org/Documentation/Script-Routes-3-2#toc8
>
> --
> Liviu Chircuwww.twitter.com/liviuchircu | www.opensips-solutions.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20201202/95bdbd4e/attachment.html>


More information about the Users mailing list