[OpenSIPS-Users] Database Searching
Mark Farmer
farmorg at gmail.com
Wed Aug 28 08:41:11 EDT 2019
Thanks for the reply, certainly a few options to consider :)
To be more specific, the table contains $ua identifiers:
MariaDB [tt]> select * from user_agent;
+----+------------------+
| id | ua |
+----+------------------+
| 1 | sipcli |
| 2 | sipvicious |
| 3 | sip-scan |
| 4 | sipsak |
| 5 | sundayddr |
| 6 | friendly-scanner |
| 7 | iWar |
| 8 | CSipSimple |
| 9 | SIVuS |
| 10 | Gulp |
| 11 | sipv |
| 12 | smap |
| 13 | friendly-request |
| 14 | VaxIPUserAgent |
| 15 | VaxSIPUserAgent |
| 16 | siparmyknife |
| 17 | Test Agent |
+----+------------------+
What I'd like to do is something like:
if($ua ~=(search_ua_column_for_match) {
exit;
}
I should add that I'm using OpenSIPS 3.0
On Wed, 28 Aug 2019 at 13:31, Alexey Kazantsev via Users <
users at lists.opensips.org> wrote:
> Hi Mark,
>
> I haven't understood well enough what data do you store in the table.
>
> Something designed by OpenSIPS developers? E.g. 'subscribers' table.
> Or some custom data which you use in your script say via AVPs?
>
> If it's possible to store it as key-value pairs, I'd recommend you using
> local cache [1], [2], [3]
>
> [1] https://www.opensips.org/Documentation/Script-CoreFunctions-3-0#toc4
> [2] https://www.opensips.org/Documentation/Script-CoreFunctions-3-0#toc5
>
> [3] https://www.opensips.org/Documentation/Script-CoreFunctions-3-0#toc6
>
> [4] https://opensips.org/html/docs/modules/3.0.x/cachedb_redis.html
> [5] https://opensips.org/html/docs/modules/3.0.x/cachedb_sql.html
> [6] https://opensips.org/html/docs/modules/3.0.x/exec.html
>
> Depending on your OpenSIPS architecture it can be more optimal to use
> Redis [4],
> for example in case of OpenSIPS cluster.
>
> You may use CACHEDB_SQL [5] (I never used it).
> You may execute some script with the EXEC [6] function.
>
> If your table is tiny and your system architecture allows it,
> you may store data not in MariaDB but in SQLite.
>
> So, as you see, many things depend on the overall size of your system,
> and it's not so easy to give some certain advice without knowing
> its architecture and load level.
>
>
>
> -----------------------------------------------
> BR, Alexey
> http://alexeyka.zantsev.com/
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
--
Mark Farmer
farmorg at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20190828/7efa0337/attachment-0001.html>
More information about the Users
mailing list