[OpenSIPS-Users] AUTH_DB module database queries

John Quick john.quick at smartvox.co.uk
Thu Apr 8 15:49:36 EST 2021

Thanks Bogdan.

John Quick
Smartvox Limited

-----Original Message-----
From: Bogdan-Andrei Iancu <bogdan at opensips.org> 
Sent: 08 April 2021 16:39
To: john.quick at smartvox.co.uk; OpenSIPS users mailling list <users at lists.opensips.org>
Subject: Re: [OpenSIPS-Users] AUTH_DB module database queries

Hi John,

See inline answers.


Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
OpenSIPS Bootcamp 2021 online

On 4/8/21 5:45 PM, John Quick wrote:
> I am auditing an existing opensips.cfg script trying to identify all 
> possible places where a database query is executed.
> The purpose is to optimise performance by reducing the number of DB 
> queries and eliminating any unnecessary synchronous database queries.
> I would like to know more about what happens when the script calls the
> proxy_authorize() function.
> I assume it must be querying the subscriber table, but is this a 
> synchronous query?
yes, it is a blocking query.
> Does the AUTH_DB module do any caching of data or will it always read 
> directly from the DB table?
no caching
> Is there any difference between v2.4 and v3.1 here?
> Is there anything on the roadmap that may be relevant?
> The behaviour of proxy_authorize() could be relevant to system 
> performance and reliability in the following situations:
>   - An OpenSIPS system under heavy load with many call attempts per second
>   - Where an unexpected network or DB-server issue results in slow DB 
> query responses - potentially crashing OpenSIPS
>   - If a "rogue" customer device or malicious hacking attempt 
> generates large numbers of requests which all call proxy_authorize()
you can replace the proxy_authorize() with pv_proxy_authorize() (where you provide the pwd from script) and manage the pwd retrieval from script level, with async queries + caching.
> John Quick
> Smartvox Limited
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

More information about the Users mailing list