Re: [OpenSIPS-Users] Problem with mmgeoip.so
Hi Bogdan. Thank you. Its ok now. 2010/1/26 Bogdan-Andrei Iancu > Hi Leoida, > > found a bug in the module - please update from svn and give it another try. > > Regards, > Bogdan > > Леонид Наседкин wrote: > > Hi. Bogdan. > > > > I got a new trouble. Please look at the last string in log. How can I > > get a normal output? > > > > if (mmg_lookup("lon:lat:cc:reg","$si","$avp(lat_lon)")) { > > xdbg("GEOIP: $(avp(lat_lon)[0]) $(avp(lat_lon)[1]) $(avp(lat_lon)[2]) > > $(avp(lat_lon)[3]) $(avp(lat_lon)[4]) $avp(lat_lon)"); > > } > > > > Jan 26 08:03:50 dev-sip /usr/sbin/opensips[26484]: > > DBG:mmgeoip:mmg_lookup_cmd: mmgeoip:mmg_lookup_cmd: ipaddr:'x.x.x.x'; > > fields:'lon:lat:cc:reg'. > > Jan 26 08:03:50 dev-sip /usr/sbin/opensips[26484]: > > DBG:mmgeoip:mmg_lookup_cmd: mmgeoip:mmg_lookup_cmd: x.x.x.x[lon] > 82.934402 > > Jan 26 08:03:50 dev-sip /usr/sbin/opensips[26484]: > > DBG:mmgeoip:mmg_lookup_cmd: mmgeoip:mmg_lookup_cmd: x.x.x.x[lat] > 55.041100 > > Jan 26 08:03:50 dev-sip /usr/sbin/opensips[26484]: > > DBG:mmgeoip:mmg_lookup_cmd: mmgeoip:mmg_lookup_cmd: x.x.x.x[cc] RU > > Jan 26 08:03:50 dev-sip /usr/sbin/opensips[26484]: > > DBG:mmgeoip:mmg_lookup_cmd: mmgeoip:mmg_lookup_cmd: x.x.x.x[reg] 53 > > Jan 26 08:03:50 dev-sip /usr/sbin/opensips[26484]: GEOIP: 3215296676 > > 3215296676 3215296676 3215296676 3215296676 > > > > > > > > > > 2010/1/25 Bogdan-Andrei Iancu > <mailto:bog...@voice-system.ro>> > > > > Hi Leonid, > > > > Use quotes for 2nd and 3rd parameters of the function -> > > f(mmg_lookup("lon:lat","$si","$avp(lat_lon)")) { > > > > Regards, > > Bogdan > > > > Леонид Наседкин wrote: > > > Hi there. > > > I tried to use mmgeoip.so with configuration from example > > > opensips 1.6.1 > > > > > > loadmodule "mmgeoip.so" > > > modparam("mmgeoip", > > > "mmgeoip_city_db_path","/usr/share/GeoIP/GeoLiteCity.dat") > > > ... > > > if(mmg_lookup("lon:lat",$si,$avp(lat_lon))) { > > > xlog("L_INFO","Source IP latitude:$(avp(lat_lon)[0])\n"); > > > xlog("L_INFO","Source IP longitude:$(avp(lat_lon)[1])\n"); > > > }; > > > > > > ls -la /usr/share/GeoIP/GeoLiteCity.dat > > > -rw-r--r-- 1 root root 28543655 2010-01-25 11:15 > > > /usr/share/GeoIP/GeoLiteCity.dat > > > > > > I got some errors: > > > Jan 25 11:44:08 [10466] CRITICAL:core:yyerror: parse error in > config > > > file, line 300, column 26-43: syntax error > > > Jan 25 11:44:08 [10466] CRITICAL:core:yyerror: parse error in > config > > > file, line 300, column 43-44: bad arguments for command > > > > > > > What is wrong? > > > > > > > > > -- > > > WBR, Leonid Nasedkin > > > > > > > > > > > > > > > ___ > > > Users mailing list > > > Users@lists.opensips.org <mailto:Users@lists.opensips.org> > > > http://lists.opensips.org/cgi-bin/mailman/listinfo/users > > > > > > > > > -- > > Bogdan-Andrei Iancu > > www.voice-system.ro <http://www.voice-system.ro> > > > > > > ___ > > Users mailing list > > Users@lists.opensips.org <mailto:Users@lists.opensips.org> > > http://lists.opensips.org/cgi-bin/mailman/listinfo/users > > > > > > > > > > -- > > WBR, Leonid Nasedkin > > cell: +7 923 731 0077 > > icq: 256816 > > skype: leonidnasedkin > > > > > > ___ > > Users mailing list > > Users@lists.opensips.org > > http://lists.opensips.org/cgi-bin/mailman/listinfo/users > > > > > -- > Bogdan-Andrei Iancu > www.voice-system.ro > > > ___ > Users mailing list > Users@lists.opensips.org > http://lists.opensips.org/cgi-bin/mailman/listinfo/users > -- WBR, Leonid Nasedkin ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Problem with mmgeoip.so
Hi. Bogdan. I got a new trouble. Please look at the last string in log. How can I get a normal output? if (mmg_lookup("lon:lat:cc:reg","$si","$avp(lat_lon)")) { xdbg("GEOIP: $(avp(lat_lon)[0]) $(avp(lat_lon)[1]) $(avp(lat_lon)[2]) $(avp(lat_lon)[3]) $(avp(lat_lon)[4]) $avp(lat_lon)"); } Jan 26 08:03:50 dev-sip /usr/sbin/opensips[26484]: DBG:mmgeoip:mmg_lookup_cmd: mmgeoip:mmg_lookup_cmd: ipaddr:'x.x.x.x'; fields:'lon:lat:cc:reg'. Jan 26 08:03:50 dev-sip /usr/sbin/opensips[26484]: DBG:mmgeoip:mmg_lookup_cmd: mmgeoip:mmg_lookup_cmd: x.x.x.x[lon] 82.934402 Jan 26 08:03:50 dev-sip /usr/sbin/opensips[26484]: DBG:mmgeoip:mmg_lookup_cmd: mmgeoip:mmg_lookup_cmd: x.x.x.x[lat] 55.041100 Jan 26 08:03:50 dev-sip /usr/sbin/opensips[26484]: DBG:mmgeoip:mmg_lookup_cmd: mmgeoip:mmg_lookup_cmd: x.x.x.x[cc] RU Jan 26 08:03:50 dev-sip /usr/sbin/opensips[26484]: DBG:mmgeoip:mmg_lookup_cmd: mmgeoip:mmg_lookup_cmd: x.x.x.x[reg] 53 Jan 26 08:03:50 dev-sip /usr/sbin/opensips[26484]: GEOIP: 3215296676 3215296676 3215296676 3215296676 3215296676 2010/1/25 Bogdan-Andrei Iancu > Hi Leonid, > > Use quotes for 2nd and 3rd parameters of the function -> > f(mmg_lookup("lon:lat","$si","$avp(lat_lon)")) { > > Regards, > Bogdan > > Леонид Наседкин wrote: > > Hi there. > > I tried to use mmgeoip.so with configuration from example > > opensips 1.6.1 > > > > loadmodule "mmgeoip.so" > > modparam("mmgeoip", > > "mmgeoip_city_db_path","/usr/share/GeoIP/GeoLiteCity.dat") > > ... > > if(mmg_lookup("lon:lat",$si,$avp(lat_lon))) { > > xlog("L_INFO","Source IP latitude:$(avp(lat_lon)[0])\n"); > > xlog("L_INFO","Source IP longitude:$(avp(lat_lon)[1])\n"); > > }; > > > > ls -la /usr/share/GeoIP/GeoLiteCity.dat > > -rw-r--r-- 1 root root 28543655 2010-01-25 11:15 > > /usr/share/GeoIP/GeoLiteCity.dat > > > > I got some errors: > > Jan 25 11:44:08 [10466] CRITICAL:core:yyerror: parse error in config > > file, line 300, column 26-43: syntax error > > Jan 25 11:44:08 [10466] CRITICAL:core:yyerror: parse error in config > > file, line 300, column 43-44: bad arguments for command > > > > What is wrong? > > > > > > -- > > WBR, Leonid Nasedkin > > > > > > > > ___ > > Users mailing list > > Users@lists.opensips.org > > http://lists.opensips.org/cgi-bin/mailman/listinfo/users > > > > > -- > Bogdan-Andrei Iancu > www.voice-system.ro > > > ___ > Users mailing list > Users@lists.opensips.org > http://lists.opensips.org/cgi-bin/mailman/listinfo/users > -- WBR, Leonid Nasedkin cell: +7 923 731 0077 icq: 256816 skype: leonidnasedkin ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Error in module permission with db_text
Hi, Bogdan. Its working now. Thanks. 2010/1/26 Bogdan-Andrei Iancu > Hi Leonid, > > An official fix is available on SVN trunk (rev 6534). I would really > appreciate if you could give it a try and test - if ok, I will do the > backport. > > Thanks and regards, > Bogdan > > > Bogdan-Andrei Iancu wrote: > >> Ok, I will investigate to come up with an official fix. >> >> Thanks and regards, >> Bogdan >> >> Леонид Наседкин wrote: >> >> >>> Hi Bogdan >>> Thank you. Its working now. >>> >>> 2010/1/15 Bogdan-Andrei Iancu >> bog...@voice-system.ro>> >>> >>>Hi Leonid, >>> >>>Looks like there is a compatibility bug between permission and >>>db_text modules when comes to DB data typesGive me couple of >>>days to sort this out. >>> >>>In the mean while, if you want to use db_text for permissions, >>>please use the attached patch. >>> >>>Thanks and regards, >>>Bogdan >>> >>> >>>Леонид Наседкин wrote: >>> >>>Hi there. >>>I'm trying to use permission module with db_text, and it's not >>>working, and I can't understand what's wrong. >>>Opensips 1.6.1 svnrevision: 2:6509 >>> >>>In opensips.cfg: >>>loadmodule "db_text.so" >>>modparam("db_text", "db_mode", 0) >>>loadmodule "permissions.so" >>>modparam("permissions","db_url", "text:///etc/opensips/dbtext") >>> >>>In /etc/opensips/dbtext/address: >>>id(int,auto) grp(int) ip(str) mask(int) port(int) proto(str) >>>pattern(str,null) context_info(str,null) >>>10:1:10.100.0.0:23:5060:udp:: >>>20:1:10.110.0.0:23:5060:udp:: >>>30:1:10.120.0.0:23:5060:udp:: >>> >>>LOG: >>> >>>DBG:core:init_mod: initializing module permissions >>>DBG:permissions:mod_init: initializing... >>>WARNING:permissions:parse_config_file: file not found: >>>/etc/opensips/permissions.allow >>>WARNING:permissions:mod_init: default allow file >>>(/etc/opensips/permissions.allow) not found => empty rule set >>>WARNING:permissions:parse_config_file: file not found: >>>/etc/opensips/permissions.deny >>>WARNING:permissions:mod_init: default deny file >>>(/etc/opensips/permissions.deny) not found => empty rule set >>>DBG:core:find_mod_export: found in module >>>db_text [/usr/lib/opensips/modules/] >>>DBG:core:db_bind_mod: using db bind api for db_text >>>INFO:db_text:dbt_init: using database at: /etc/opensips/dbtext/ >>>DBG:db_text:dbt_cache_get_db: looking for db >>>/etc/opensips/dbtext/! >>>DBG:db_text:dbt_cache_get_db: new db! >>>DBG:db_text:dbt_load_file: request for table [version] >>>DBG:db_text:dbt_load_file: db is [/etc/opensips/dbtext/] >>>DBG:db_text:dbt_load_file: loading file >>>[/etc/opensips/dbtext//version] >>>DBG:db_text:dbt_table_new: mtime is 1263556066 >>>DBG:db_text:dbt_load_file: column[0] is STR! >>>DBG:db_text:dbt_load_file: column[1] is INT! >>>DBG:db_text:dbt_query: new res with 1 cols >>>DBG:db_text:dbt_result_new: new res with 1 cols >>>DBG:core:db_new_result: allocate 28 bytes for result set at >>>0x816b044 >>>DBG:core:db_allocate_columns: allocate 16 bytes for result >>>columns at 0x816aedc >>>DBG:core:db_allocate_rows: allocate 28 bytes for result rows >>>and values at 0x816b090 >>>DBG:core:db_free_columns: freeing result columns at 0x816aedc >>>DBG:core:db_free_rows: freeing 1 rows >>>DBG:core:db_free_row: freeing row values at 0x816b098 >>>DBG:core:db_free_rows: freeing rows at 0x816b090 >>>DBG:core:db_free_result: freeing result set at 0x816b044 >>>DBG:db_text:dbt_load_file: request for table [address] >>>DBG:db_text:dbt_load_file: db is [/etc/opensips/dbtext/] >>>DBG:db_text:dbt_load_file: loading file >>>[/etc/opensips/dbtext//address] >>>DBG:db_text:dbt_table_new: mtime is
[OpenSIPS-Users] Problem with mmgeoip.so
Hi there. I tried to use mmgeoip.so with configuration from example opensips 1.6.1 loadmodule "mmgeoip.so" modparam("mmgeoip", "mmgeoip_city_db_path","/usr/share/GeoIP/GeoLiteCity.dat") ... if(mmg_lookup("lon:lat",$si,$avp(lat_lon))) { xlog("L_INFO","Source IP latitude:$(avp(lat_lon)[0])\n"); xlog("L_INFO","Source IP longitude:$(avp(lat_lon)[1])\n"); }; ls -la /usr/share/GeoIP/GeoLiteCity.dat -rw-r--r-- 1 root root 28543655 2010-01-25 11:15 /usr/share/GeoIP/GeoLiteCity.dat I got some errors: Jan 25 11:44:08 [10466] CRITICAL:core:yyerror: parse error in config file, line 300, column 26-43: syntax error Jan 25 11:44:08 [10466] CRITICAL:core:yyerror: parse error in config file, line 300, column 43-44: bad arguments for command What is wrong? -- WBR, Leonid Nasedkin ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Error in module permission with db_text
Hi Bogdan Thank you. Its working now. 2010/1/15 Bogdan-Andrei Iancu > Hi Leonid, > > Looks like there is a compatibility bug between permission and db_text > modules when comes to DB data typesGive me couple of days to sort this > out. > > In the mean while, if you want to use db_text for permissions, please use > the attached patch. > > Thanks and regards, > Bogdan > > > Леонид Наседкин wrote: > >> Hi there. >> I'm trying to use permission module with db_text, and it's not working, >> and I can't understand what's wrong. >> Opensips 1.6.1 svnrevision: 2:6509 >> >> In opensips.cfg: >> loadmodule "db_text.so" >> modparam("db_text", "db_mode", 0) >> loadmodule "permissions.so" >> modparam("permissions","db_url", "text:///etc/opensips/dbtext") >> >> In /etc/opensips/dbtext/address: >> id(int,auto) grp(int) ip(str) mask(int) port(int) proto(str) >> pattern(str,null) context_info(str,null) >> 10:1:10.100.0.0:23:5060:udp:: >> 20:1:10.110.0.0:23:5060:udp:: >> 30:1:10.120.0.0:23:5060:udp:: >> >> LOG: >> >> DBG:core:init_mod: initializing module permissions >> DBG:permissions:mod_init: initializing... >> WARNING:permissions:parse_config_file: file not found: >> /etc/opensips/permissions.allow >> WARNING:permissions:mod_init: default allow file >> (/etc/opensips/permissions.allow) not found => empty rule set >> WARNING:permissions:parse_config_file: file not found: >> /etc/opensips/permissions.deny >> WARNING:permissions:mod_init: default deny file >> (/etc/opensips/permissions.deny) not found => empty rule set >> DBG:core:find_mod_export: found in module db_text >> [/usr/lib/opensips/modules/] >> DBG:core:db_bind_mod: using db bind api for db_text >> INFO:db_text:dbt_init: using database at: /etc/opensips/dbtext/ >> DBG:db_text:dbt_cache_get_db: looking for db /etc/opensips/dbtext/! >> DBG:db_text:dbt_cache_get_db: new db! >> DBG:db_text:dbt_load_file: request for table [version] >> DBG:db_text:dbt_load_file: db is [/etc/opensips/dbtext/] >> DBG:db_text:dbt_load_file: loading file [/etc/opensips/dbtext//version] >> DBG:db_text:dbt_table_new: mtime is 1263556066 >> DBG:db_text:dbt_load_file: column[0] is STR! >> DBG:db_text:dbt_load_file: column[1] is INT! >> DBG:db_text:dbt_query: new res with 1 cols >> DBG:db_text:dbt_result_new: new res with 1 cols >> DBG:core:db_new_result: allocate 28 bytes for result set at 0x816b044 >> DBG:core:db_allocate_columns: allocate 16 bytes for result columns at >> 0x816aedc >> DBG:core:db_allocate_rows: allocate 28 bytes for result rows and values at >> 0x816b090 >> DBG:core:db_free_columns: freeing result columns at 0x816aedc >> DBG:core:db_free_rows: freeing 1 rows >> DBG:core:db_free_row: freeing row values at 0x816b098 >> DBG:core:db_free_rows: freeing rows at 0x816b090 >> DBG:core:db_free_result: freeing result set at 0x816b044 >> DBG:db_text:dbt_load_file: request for table [address] >> DBG:db_text:dbt_load_file: db is [/etc/opensips/dbtext/] >> DBG:db_text:dbt_load_file: loading file [/etc/opensips/dbtext//address] >> DBG:db_text:dbt_table_new: mtime is 1263558311 >> DBG:db_text:dbt_load_file: column[0] is INT! >> DBG:db_text:dbt_load_file: column[1] is INT! >> DBG:db_text:dbt_load_file: column[2] is STR! >> DBG:db_text:dbt_load_file: column[3] is INT! >> DBG:db_text:dbt_load_file: column[4] is INT! >> DBG:db_text:dbt_load_file: column[5] is STR! >> DBG:db_text:dbt_load_file: column[6] is STR! >> DBG:db_text:dbt_load_file: column[7] is STR! >> DBG:db_text:dbt_query: new res with 8 cols >> DBG:db_text:dbt_result_new: new res with 8 cols >> DBG:core:db_new_result: allocate 28 bytes for result set at 0x816b004 >> DBG:core:db_allocate_columns: allocate 128 bytes for result columns at >> 0x8186b68 >> DBG:core:db_allocate_rows: allocate 504 bytes for result rows and values >> at 0x8186bf4 >> DBG:permissions:reload_address_table: number of rows in address table: 3 >> ERROR:permissions:reload_address_table: database problem >> DBG:core:db_free_columns: freeing result columns at 0x8186b68 >> DBG:core:db_free_rows: freeing 3 rows >> DBG:core:db_free_row: freeing row values at 0x8186c0c >> DBG:core:db_free_row: freeing row values at 0x8186cac >> DBG:core:db_free_row: freeing row values at 0x8186d4c >> DBG:core:db_free_rows: freeing rows at 0x8186bf4 >> DBG:core:db_free_result: freeing result set at 0x816b004 >> CRITICAL:permissions:init_address: r
[OpenSIPS-Users] Error in module permission with db_text
Hi there. I'm trying to use permission module with db_text, and it's not working, and I can't understand what's wrong. Opensips 1.6.1 svnrevision: 2:6509 In opensips.cfg: loadmodule "db_text.so" modparam("db_text", "db_mode", 0) loadmodule "permissions.so" modparam("permissions","db_url", "text:///etc/opensips/dbtext") In /etc/opensips/dbtext/address: id(int,auto) grp(int) ip(str) mask(int) port(int) proto(str) pattern(str,null) context_info(str,null) 10:1:10.100.0.0:23:5060:udp:: 20:1:10.110.0.0:23:5060:udp:: 30:1:10.120.0.0:23:5060:udp:: LOG: DBG:core:init_mod: initializing module permissions DBG:permissions:mod_init: initializing... WARNING:permissions:parse_config_file: file not found: /etc/opensips/permissions.allow WARNING:permissions:mod_init: default allow file (/etc/opensips/permissions.allow) not found => empty rule set WARNING:permissions:parse_config_file: file not found: /etc/opensips/permissions.deny WARNING:permissions:mod_init: default deny file (/etc/opensips/permissions.deny) not found => empty rule set DBG:core:find_mod_export: found in module db_text [/usr/lib/opensips/modules/] DBG:core:db_bind_mod: using db bind api for db_text INFO:db_text:dbt_init: using database at: /etc/opensips/dbtext/ DBG:db_text:dbt_cache_get_db: looking for db /etc/opensips/dbtext/! DBG:db_text:dbt_cache_get_db: new db! DBG:db_text:dbt_load_file: request for table [version] DBG:db_text:dbt_load_file: db is [/etc/opensips/dbtext/] DBG:db_text:dbt_load_file: loading file [/etc/opensips/dbtext//version] DBG:db_text:dbt_table_new: mtime is 1263556066 DBG:db_text:dbt_load_file: column[0] is STR! DBG:db_text:dbt_load_file: column[1] is INT! DBG:db_text:dbt_query: new res with 1 cols DBG:db_text:dbt_result_new: new res with 1 cols DBG:core:db_new_result: allocate 28 bytes for result set at 0x816b044 DBG:core:db_allocate_columns: allocate 16 bytes for result columns at 0x816aedc DBG:core:db_allocate_rows: allocate 28 bytes for result rows and values at 0x816b090 DBG:core:db_free_columns: freeing result columns at 0x816aedc DBG:core:db_free_rows: freeing 1 rows DBG:core:db_free_row: freeing row values at 0x816b098 DBG:core:db_free_rows: freeing rows at 0x816b090 DBG:core:db_free_result: freeing result set at 0x816b044 DBG:db_text:dbt_load_file: request for table [address] DBG:db_text:dbt_load_file: db is [/etc/opensips/dbtext/] DBG:db_text:dbt_load_file: loading file [/etc/opensips/dbtext//address] DBG:db_text:dbt_table_new: mtime is 1263558311 DBG:db_text:dbt_load_file: column[0] is INT! DBG:db_text:dbt_load_file: column[1] is INT! DBG:db_text:dbt_load_file: column[2] is STR! DBG:db_text:dbt_load_file: column[3] is INT! DBG:db_text:dbt_load_file: column[4] is INT! DBG:db_text:dbt_load_file: column[5] is STR! DBG:db_text:dbt_load_file: column[6] is STR! DBG:db_text:dbt_load_file: column[7] is STR! DBG:db_text:dbt_query: new res with 8 cols DBG:db_text:dbt_result_new: new res with 8 cols DBG:core:db_new_result: allocate 28 bytes for result set at 0x816b004 DBG:core:db_allocate_columns: allocate 128 bytes for result columns at 0x8186b68 DBG:core:db_allocate_rows: allocate 504 bytes for result rows and values at 0x8186bf4 DBG:permissions:reload_address_table: number of rows in address table: 3 ERROR:permissions:reload_address_table: database problem DBG:core:db_free_columns: freeing result columns at 0x8186b68 DBG:core:db_free_rows: freeing 3 rows DBG:core:db_free_row: freeing row values at 0x8186c0c DBG:core:db_free_row: freeing row values at 0x8186cac DBG:core:db_free_row: freeing row values at 0x8186d4c DBG:core:db_free_rows: freeing rows at 0x8186bf4 DBG:core:db_free_result: freeing result set at 0x816b004 CRITICAL:permissions:init_address: reload of address table failed ERROR:permissions:mod_init: failed to initialize the allow_address function ERROR:core:init_mod: failed to initialize module permissions ERROR:core:main: error while initializing modules DBG:db_text:destroy: destroy ... -- WBR, Leonid Nasedkin icq: 256816 skype: leonidnasedkin ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users