Hi, Bogdan. <div><br></div><div>I have got one more error with module db_text.</div><div><br></div><div><div>loadmodule "avpops.so"</div><div>modparam("avpops","db_url","text:///etc/opensips/dbtext/")</div>
<div>modparam("avpops","avp_table","usr_preferences")</div><div>modparam("avpops","use_domain",0)</div><div>modparam("avpops","uuid_column","uuid")</div>
<div>modparam("avpops","username_column","username")</div><div>modparam("avpops","domain_column","domain")</div><div>modparam("avpops","attribute_column","attribute")</div>
<div>modparam("avpops","type_column","type")</div><div>modparam("avpops","value_column","value")</div><div>...</div><div>avp_db_load("mediaproxy-RU","$avp(s:mediaproxy_ip)")</div>
<div>...</div><div><br></div><div>usr_preferences:</div><div><div>id(int,auto) uuid(str) username(str) domain(str) attribute(str) type(int) value(str) last_modified(double,null)</div><div>10:mediaproxy-DEFAULT:mediaproxy-DEFAULT:domain:mediaproxy_ip:0:value:0</div>
<div>20:mediaproxy-RU:mediaproxy-RU:domain:mediaproxy_ip:0:value:0</div></div></div><div><br></div><div>And I see in log:</div><div><div>Feb 2 12:03:51 dev-sip /usr/sbin/opensips[19536]: DBG:db_text:dbt_load_file: loading file [/etc/opensips/dbtext//usr_preferences]</div>
<div>Feb 2 12:03:51 dev-sip /usr/sbin/opensips[19536]: ERROR:db_text:dbt_query: table does not exist!</div><div>Feb 2 12:03:51 dev-sip /usr/sbin/opensips[19536]: ERROR:avpops:ops_dbload_avps: db_load failed</div><br><div class="gmail_quote">
2010/1/26 Bogdan-Andrei Iancu <span dir="ltr"><<a href="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Leonid,<br>
<br>
Thanks for testing - I uploaded the fix on the 1.6 branch also.<div class="im"><br>
<br>
Regards,<br>
Bogdan<br>
<br>
Леонид Наседкин wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Hi, Bogdan.<br>
Its working now. Thanks. <br></div>
2010/1/26 Bogdan-Andrei Iancu <<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a> <mailto:<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a>>><div>
<div></div><div class="h5"><br>
<br>
Hi Leonid,<br>
<br>
An official fix is available on SVN trunk (rev 6534). I would<br>
really appreciate if you could give it a try and test - if ok, I<br>
will do the backport.<br>
<br>
Thanks and regards,<br>
Bogdan<br>
<br>
<br>
Bogdan-Andrei Iancu wrote:<br>
<br>
Ok, I will investigate to come up with an official fix.<br>
<br>
Thanks and regards,<br>
Bogdan<br>
<br>
Леонид Наседкин wrote:<br>
<br>
Hi Bogdan<br>
Thank you. Its working now.<br>
<br>
2010/1/15 Bogdan-Andrei Iancu <<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a><br>
<mailto:<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a>><br>
<mailto:<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a><br>
<mailto:<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a>>>><br>
<br>
Hi Leonid,<br>
<br>
Looks like there is a compatibility bug between<br>
permission and<br>
db_text modules when comes to DB data types....Give me<br>
couple of<br>
days to sort this out.<br>
<br>
In the mean while, if you want to use db_text for<br>
permissions,<br>
please use the attached patch.<br>
<br>
Thanks and regards,<br>
Bogdan<br>
<br>
<br>
Леонид Наседкин wrote:<br>
<br>
Hi there.<br>
I'm trying to use permission module with db_text,<br>
and it's not<br>
working, and I can't understand what's wrong.<br>
Opensips 1.6.1 svnrevision: 2:6509<br>
<br>
In opensips.cfg:<br>
loadmodule "db_text.so"<br>
modparam("db_text", "db_mode", 0)<br>
loadmodule "permissions.so"<br>
modparam("permissions","db_url",<br>
"text:///etc/opensips/dbtext")<br>
<br>
In /etc/opensips/dbtext/address:<br>
id(int,auto) grp(int) ip(str) mask(int) port(int)<br>
proto(str)<br>
pattern(str,null) context_info(str,null)<br>
10:1:10.100.0.0:23:5060:udp::<br>
20:1:10.110.0.0:23:5060:udp::<br>
30:1:10.120.0.0:23:5060:udp::<br>
<br>
LOG:<br>
<br>
DBG:core:init_mod: initializing module permissions<br>
DBG:permissions:mod_init: initializing...<br>
WARNING:permissions:parse_config_file: file not found:<br>
/etc/opensips/permissions.allow<br>
WARNING:permissions:mod_init: default allow file<br>
(/etc/opensips/permissions.allow) not found =><br>
empty rule set<br>
WARNING:permissions:parse_config_file: file not found:<br>
/etc/opensips/permissions.deny<br>
WARNING:permissions:mod_init: default deny file<br>
(/etc/opensips/permissions.deny) not found => empty<br>
rule set<br>
DBG:core:find_mod_export: found <db_bind_api> in module<br>
db_text [/usr/lib/opensips/modules/]<br>
DBG:core:db_bind_mod: using db bind api for db_text<br>
INFO:db_text:dbt_init: using database at:<br>
/etc/opensips/dbtext/<br>
DBG:db_text:dbt_cache_get_db: looking for db<br>
/etc/opensips/dbtext/!<br>
DBG:db_text:dbt_cache_get_db: new db!<br>
DBG:db_text:dbt_load_file: request for table [version]<br>
DBG:db_text:dbt_load_file: db is<br>
[/etc/opensips/dbtext/]<br>
DBG:db_text:dbt_load_file: loading file<br>
[/etc/opensips/dbtext//version]<br>
DBG:db_text:dbt_table_new: mtime is 1263556066<br>
DBG:db_text:dbt_load_file: column[0] is STR!<br>
DBG:db_text:dbt_load_file: column[1] is INT!<br>
DBG:db_text:dbt_query: new res with 1 cols<br>
DBG:db_text:dbt_result_new: new res with 1 cols<br>
DBG:core:db_new_result: allocate 28 bytes for<br>
result set at<br>
0x816b044<br>
DBG:core:db_allocate_columns: allocate 16 bytes for<br>
result<br>
columns at 0x816aedc<br>
DBG:core:db_allocate_rows: allocate 28 bytes for<br>
result rows<br>
and values at 0x816b090<br>
DBG:core:db_free_columns: freeing result columns at<br>
0x816aedc<br>
DBG:core:db_free_rows: freeing 1 rows<br>
DBG:core:db_free_row: freeing row values at 0x816b098<br>
DBG:core:db_free_rows: freeing rows at 0x816b090<br>
DBG:core:db_free_result: freeing result set at<br>
0x816b044<br>
DBG:db_text:dbt_load_file: request for table [address]<br>
DBG:db_text:dbt_load_file: db is<br>
[/etc/opensips/dbtext/]<br>
DBG:db_text:dbt_load_file: loading file<br>
[/etc/opensips/dbtext//address]<br>
DBG:db_text:dbt_table_new: mtime is 1263558311<br>
DBG:db_text:dbt_load_file: column[0] is INT!<br>
DBG:db_text:dbt_load_file: column[1] is INT!<br>
DBG:db_text:dbt_load_file: column[2] is STR!<br>
DBG:db_text:dbt_load_file: column[3] is INT!<br>
DBG:db_text:dbt_load_file: column[4] is INT!<br>
DBG:db_text:dbt_load_file: column[5] is STR!<br>
DBG:db_text:dbt_load_file: column[6] is STR!<br>
DBG:db_text:dbt_load_file: column[7] is STR!<br>
DBG:db_text:dbt_query: new res with 8 cols<br>
DBG:db_text:dbt_result_new: new res with 8 cols<br>
DBG:core:db_new_result: allocate 28 bytes for<br>
result set at<br>
0x816b004<br>
DBG:core:db_allocate_columns: allocate 128 bytes<br>
for result<br>
columns at 0x8186b68<br>
DBG:core:db_allocate_rows: allocate 504 bytes for<br>
result rows<br>
and values at 0x8186bf4<br>
DBG:permissions:reload_address_table: number of rows in<br>
address table: 3<br>
ERROR:permissions:reload_address_table: database<br>
problem<br>
DBG:core:db_free_columns: freeing result columns at<br>
0x8186b68<br>
DBG:core:db_free_rows: freeing 3 rows<br>
DBG:core:db_free_row: freeing row values at 0x8186c0c<br>
DBG:core:db_free_row: freeing row values at 0x8186cac<br>
DBG:core:db_free_row: freeing row values at 0x8186d4c<br>
DBG:core:db_free_rows: freeing rows at 0x8186bf4<br>
DBG:core:db_free_result: freeing result set at<br>
0x816b004<br>
CRITICAL:permissions:init_address: reload of<br>
address table failed<br>
ERROR:permissions:mod_init: failed to initialize the<br>
allow_address function<br>
ERROR:core:init_mod: failed to initialize module<br>
permissions<br>
ERROR:core:main: error while initializing modules<br>
DBG:db_text:destroy: destroy ...<br>
<br>
<br>
-- WBR, Leonid Nasedkin<br>
icq: 256816<br>
skype: leonidnasedkin<br>
------------------------------------------------------------------------<br>
<br>
<br>
<br>
<br>
-- Bogdan-Andrei Iancu<br></div></div>
<a href="http://www.voice-system.ro" target="_blank">www.voice-system.ro</a> <<a href="http://www.voice-system.ro" target="_blank">http://www.voice-system.ro</a>><div class="im"><br>
<br>
<br>
<br>
<br>
-- <br>
WBR, Leonid Nasedkin<br>
cell: +7 923 731 0077<br>
icq: 256816<br>
skype: leonidnasedkin<br>
</div></blockquote><div><div></div><div class="h5">
<br>
<br>
-- <br>
Bogdan-Andrei Iancu<br>
<a href="http://www.voice-system.ro" target="_blank">www.voice-system.ro</a><br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>WBR, Leonid Nasedkin<br>cell: +7 923 731 0077<br>icq: 256816<br>skype: leonidnasedkin<br>
</div>