Hello guys,
I0ve freated a view taken from other tables to use with the permissions module, the result looks like this:
And some values:
23 10 192.198.1.215 32 0 Training-215 Still, Kamailio complaints with:
0(5796) DEBUG: <core> [db_res.c:188]: db_allocate_rows(): allocate 48 bytes for rows at 0x7f69510651b8 0(5796) DEBUG: <core> [db_row.c:117]: db_allocate_row(): allocate 160 bytes for row values at 0x7f6951065250 0(5796) DEBUG: <core> [db_val.c:74]: db_str2val(): converting INT [10] 0(5796) DEBUG: <core> [db_val.c:118]: db_str2val(): converting STRING [67.215.186.215] 0(5796) DEBUG: <core> [db_val.c:85]: db_str2val(): converting BIGINT [32] 0(5796) DEBUG: <core> [db_val.c:85]: db_str2val(): converting BIGINT [0] 0(5796) DEBUG: <core> [db_val.c:118]: db_str2val(): converting STRING [Training-215] 0(5796) DEBUG: <core> [db_row.c:117]: db_allocate_row(): allocate 160 bytes for row values at 0x7f6951065358 0(5796) DEBUG: <core> [db_val.c:74]: db_str2val(): converting INT [10] 0(5796) DEBUG: <core> [db_val.c:118]: db_str2val(): converting STRING [67.215.186.216] 0(5796) DEBUG: <core> [db_val.c:85]: db_str2val(): converting BIGINT [32] 0(5796) DEBUG: <core> [db_val.c:85]: db_str2val(): converting BIGINT [0] 0(5796) DEBUG: <core> [db_val.c:118]: db_str2val(): converting STRING [PBX-Service] 0(5796) DEBUG: <core> [db_row.c:117]: db_allocate_row(): allocate 160 bytes for row values at 0x7f6951065460 0(5796) DEBUG: <core> [db_val.c:74]: db_str2val(): converting INT [10] 0(5796) DEBUG: <core> [db_val.c:118]: db_str2val(): converting STRING [67.215.186.212] 0(5796) DEBUG: <core> [db_val.c:85]: db_str2val(): converting BIGINT [32] 0(5796) DEBUG: <core> [db_val.c:85]: db_str2val(): converting BIGINT [0] 0(5796) DEBUG: <core> [db_val.c:118]: db_str2val(): converting STRING [JuanPablo] 0(5796) DEBUG: permissions [address.c:142]: reload_address_table(): Number of rows in address table: 3 0(5796) DEBUG: permissions [address.c:169]: reload_address_table(): failure during checks of database value 3 (subnet size/CIDR) in address table 0(5796) ERROR: permissions [address.c:247]: reload_address_table(): database problem - invalid record 0(5796) DEBUG: <core> [db_res.c:79]: db_free_columns(): freeing 5 columns 0(5796) DEBUG: <core> [db_res.c:83]: db_free_columns(): freeing RES_NAMES[0] at 0x7f6951064790 0(5796) DEBUG: <core> [db_res.c:83]: db_free_columns(): freeing RES_NAMES[1] at 0x7f6951064718 0(5796) DEBUG: <core> [db_res.c:83]: db_free_columns(): freeing RES_NAMES[2] at 0x7f6951063950 0(5796) DEBUG: <core> [db_res.c:83]: db_free_columns(): freeing RES_NAMES[3] at 0x7f6951064340 0(5796) DEBUG: <core> [db_res.c:83]: db_free_columns(): freeing RES_NAMES[4] at 0x7f6951064498 0(5796) DEBUG: <core> [db_res.c:96]: db_free_columns(): freeing result names at 0x7f6951064610 0(5796) DEBUG: <core> [db_res.c:101]: db_free_columns(): freeing result types at 0x7f6951064808 0(5796) DEBUG: <core> [db_res.c:52]: db_free_rows(): freeing 3 rows 0(5796) DEBUG: <core> [db_row.c:95]: db_free_row(): freeing row values at 0x7f6951065250 0(5796) DEBUG: <core> [db_row.c:95]: db_free_row(): freeing row values at 0x7f6951065358 0(5796) DEBUG: <core> [db_row.c:95]: db_free_row(): freeing row values at 0x7f6951065460 0(5796) DEBUG: <core> [db_res.c:60]: db_free_rows(): freeing rows at 0x7f69510651b8 0(5796) DEBUG: <core> [db_res.c:138]: db_free_result(): freeing result set at 0x7f6951065118 0(5796) CRITICAL: permissions [address.c:359]: init_addresses(): reload of address table failed 0(5796) DEBUG: <core> [db_pool.c:100]: pool_remove(): removing connection from the pool 0(5796) ERROR: permissions [permissions.c:614]: mod_init(): failed to initialize the allow_address function 0(5796) ERROR: <core> [core/sr_module.c:968]: init_mod(): Error while initializing module permissions (/usr/local/kamailio5/lib64/kamailio/modules/permissions.so) ERROR: error while initializing modules
Can anyone help?
thanks! Regards,
David Villasmil email: david.villasmil.work@gmail.com phone: +34669448337 ᐧ
The view i created on mysql returns an INT for port and mask, it looks like kamailio doesn't like this... It looks to be expecting a smallint??
the view returns an INT and that fails.... ᐧ
Regards,
David Villasmil email: david.villasmil.work@gmail.com phone: +34669448337
On Wed, May 10, 2017 at 4:08 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
Hello guys,
I0ve freated a view taken from other tables to use with the permissions module, the result looks like this:
And some values:
23 10 192.198.1.215 32 0 Training-215 Still, Kamailio complaints with:
0(5796) DEBUG: <core> [db_res.c:188]: db_allocate_rows(): allocate 48 bytes for rows at 0x7f69510651b8 0(5796) DEBUG: <core> [db_row.c:117]: db_allocate_row(): allocate 160 bytes for row values at 0x7f6951065250 0(5796) DEBUG: <core> [db_val.c:74]: db_str2val(): converting INT [10] 0(5796) DEBUG: <core> [db_val.c:118]: db_str2val(): converting STRING [67.215.186.215] 0(5796) DEBUG: <core> [db_val.c:85]: db_str2val(): converting BIGINT [32] 0(5796) DEBUG: <core> [db_val.c:85]: db_str2val(): converting BIGINT [0] 0(5796) DEBUG: <core> [db_val.c:118]: db_str2val(): converting STRING [Training-215] 0(5796) DEBUG: <core> [db_row.c:117]: db_allocate_row(): allocate 160 bytes for row values at 0x7f6951065358 0(5796) DEBUG: <core> [db_val.c:74]: db_str2val(): converting INT [10] 0(5796) DEBUG: <core> [db_val.c:118]: db_str2val(): converting STRING [67.215.186.216] 0(5796) DEBUG: <core> [db_val.c:85]: db_str2val(): converting BIGINT [32] 0(5796) DEBUG: <core> [db_val.c:85]: db_str2val(): converting BIGINT [0] 0(5796) DEBUG: <core> [db_val.c:118]: db_str2val(): converting STRING [PBX-Service] 0(5796) DEBUG: <core> [db_row.c:117]: db_allocate_row(): allocate 160 bytes for row values at 0x7f6951065460 0(5796) DEBUG: <core> [db_val.c:74]: db_str2val(): converting INT [10] 0(5796) DEBUG: <core> [db_val.c:118]: db_str2val(): converting STRING [67.215.186.212] 0(5796) DEBUG: <core> [db_val.c:85]: db_str2val(): converting BIGINT [32] 0(5796) DEBUG: <core> [db_val.c:85]: db_str2val(): converting BIGINT [0] 0(5796) DEBUG: <core> [db_val.c:118]: db_str2val(): converting STRING [JuanPablo] 0(5796) DEBUG: permissions [address.c:142]: reload_address_table(): Number of rows in address table: 3 0(5796) DEBUG: permissions [address.c:169]: reload_address_table(): failure during checks of database value 3 (subnet size/CIDR) in address table 0(5796) ERROR: permissions [address.c:247]: reload_address_table(): database problem - invalid record 0(5796) DEBUG: <core> [db_res.c:79]: db_free_columns(): freeing 5 columns 0(5796) DEBUG: <core> [db_res.c:83]: db_free_columns(): freeing RES_NAMES[0] at 0x7f6951064790 0(5796) DEBUG: <core> [db_res.c:83]: db_free_columns(): freeing RES_NAMES[1] at 0x7f6951064718 0(5796) DEBUG: <core> [db_res.c:83]: db_free_columns(): freeing RES_NAMES[2] at 0x7f6951063950 0(5796) DEBUG: <core> [db_res.c:83]: db_free_columns(): freeing RES_NAMES[3] at 0x7f6951064340 0(5796) DEBUG: <core> [db_res.c:83]: db_free_columns(): freeing RES_NAMES[4] at 0x7f6951064498 0(5796) DEBUG: <core> [db_res.c:96]: db_free_columns(): freeing result names at 0x7f6951064610 0(5796) DEBUG: <core> [db_res.c:101]: db_free_columns(): freeing result types at 0x7f6951064808 0(5796) DEBUG: <core> [db_res.c:52]: db_free_rows(): freeing 3 rows 0(5796) DEBUG: <core> [db_row.c:95]: db_free_row(): freeing row values at 0x7f6951065250 0(5796) DEBUG: <core> [db_row.c:95]: db_free_row(): freeing row values at 0x7f6951065358 0(5796) DEBUG: <core> [db_row.c:95]: db_free_row(): freeing row values at 0x7f6951065460 0(5796) DEBUG: <core> [db_res.c:60]: db_free_rows(): freeing rows at 0x7f69510651b8 0(5796) DEBUG: <core> [db_res.c:138]: db_free_result(): freeing result set at 0x7f6951065118 0(5796) CRITICAL: permissions [address.c:359]: init_addresses(): reload of address table failed 0(5796) DEBUG: <core> [db_pool.c:100]: pool_remove(): removing connection from the pool 0(5796) ERROR: permissions [permissions.c:614]: mod_init(): failed to initialize the allow_address function 0(5796) ERROR: <core> [core/sr_module.c:968]: init_mod(): Error while initializing module permissions (/usr/local/kamailio5/lib64/ kamailio/modules/permissions.so) ERROR: error while initializing modules
Can anyone help?
thanks! Regards,
David Villasmil email: david.villasmil.work@gmail.com phone: +34669448337 <+34%20669%2044%2083%2037> ᐧ
On Wed, May 10, 2017 at 05:31:28PM +0200, David Villasmil wrote:
The view i created on mysql returns an INT for port and mask, it looks like kamailio doesn't like this... It looks to be expecting a smallint??
the view returns an INT and that fails.... ᐧ
Sound awfully familiar: https://lists.kamailio.org/pipermail/sr-users/2017-April/096750.html
Short story even shorter: use casts to match the orginal row types.
I don't think I can... there's no cast to smallint :( On Wed, May 10, 2017 at 8:37 PM Daniel Tryba d.tryba@pocos.nl wrote:
On Wed, May 10, 2017 at 05:31:28PM +0200, David Villasmil wrote:
The view i created on mysql returns an INT for port and mask, it looks
like
kamailio doesn't like this... It looks to be expecting a smallint??
the view returns an INT and that fails.... ᐧ
Sound awfully familiar: https://lists.kamailio.org/pipermail/sr-users/2017-April/096750.html
Short story even shorter: use casts to match the orginal row types.
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
On Wed, May 10, 2017 at 06:54:49PM +0000, David Villasmil wrote:
I don't think I can... there's no cast to smallint :(
Indeed, but take a look at this workaround with a custom function returning a smallint: http://ask.brothersoft.com/how-to-convert-from-int-to-smallint-86641.html (which contains an obviuos error). But using the custom function in a view works: create view testSI as select convToSmallInt(anint) from testT; select * from testSI; +-----------------------+ | convToSmallInt(anint) | +-----------------------+ | 123 | | 432 | | 5344 | | 32767 | +-----------------------+ 4 rows in set, 1 warning (0.00 sec)