[OpenSER-Users] userblacklist

Helmut Kuper helmut.kuper at ewetel.de
Tue Apr 22 13:00:41 CEST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

I enhanced userblacklist module in that way, that check_user_blacklist
function has now 2 additional, but optional, parameters:

check_user_blacklist(string user, string domain [, string
number_to_check][, string table])

Purpose of all this is to have serveral user individual blacklists for
e.g. incoming and outgoing calls. You have to create one table for each
userblacklist in your database. Table layout is same as default
"userblacklist" table. Whitelist is the same for all userblacklists
supported. Global blacklist behaviour was not touched by this work.



The new behaviour is like this:

number_to-check must be a PV or empty
table must be a PV or string

Modparams "use_domain" and "db_url" are global for all userblacklist
tables. Modparam "db_table" is default value if no table parameter was
given.


a) check_user_blacklist(string user, string domain) or
check_user_blacklist(string user, string domain [, "", ""])

	behaves as known.


b) check_user_blacklist(string user, string domain, string
number_to_check) or check_user_blacklist(string user, string domain,
string number_to_check, "")

	checks number_to_check against user's prefix using table given in
mod_param dt_table.


c) check_user_blacklist(string user, string domain, string
number_to_check, string table)

	checks number_to_check against user's prefix using given table instead
of default mod_param db_table.


d) check_user_blacklist(string user, string domain, "", string table)

	checks R-URI against user's prefix using given table instead of
mod_param db_table.


Additionally I fixed a potential seg fault caused by strncpy without
using MAXNUMBERLEN to protect target buffer in function
"check_user_blacklist".

Further e164 numbers (leading '+' sign) as number_to_check or in R-URI
are now allowed. "+" is stripped off in function "check_user_blacklist"
befor calling dt_longest_match().


Is there a chance to get this into trunk?

regards
Helmut
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkgNxVkACgkQ4tZeNddg3dxl3ACgundUW1M5AGTr1dGYI88l+F1r
+egAniet3EBR5eH/NDND8dsLwyXxCR91
=3YjD
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.c
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20080422/4cae790e/attachment.asc>


More information about the sr-users mailing list