Hi. Bogdan.<div><br></div><div>I got a new trouble. Please look at the last string in log. How can I get a normal output? </div><div><br></div><div><div>if (mmg_lookup("lon:lat:cc:reg","$si","$avp(lat_lon)")) {</div>
<div> 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)");</div><div>}</div><div><br></div><div><div>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'.</div>
<div>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</div><div>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</div>
<div>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</div><div>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</div>
<div>Jan 26 08:03:50 dev-sip /usr/sbin/opensips[26484]: GEOIP: 3215296676 3215296676 3215296676 3215296676 3215296676</div><div><br></div><div><br></div></div><div><br></div><br><div class="gmail_quote">2010/1/25 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>
Use quotes for 2nd and 3rd parameters of the function -><br>
<div class="im">f(mmg_lookup("lon:lat","$si","$avp(lat_lon)")) {<br>
<br>
</div>Regards,<br>
<font color="#888888">Bogdan<br>
</font><div><div></div><div class="h5"><br>
Леонид Наседкин wrote:<br>
> Hi there.<br>
> I tried to use mmgeoip.so with configuration from example<br>
> opensips 1.6.1<br>
><br>
> loadmodule "mmgeoip.so"<br>
> modparam("mmgeoip",<br>
> "mmgeoip_city_db_path","/usr/share/GeoIP/GeoLiteCity.dat")<br>
> ...<br>
> if(mmg_lookup("lon:lat",$si,$avp(lat_lon))) {<br>
> xlog("L_INFO","Source IP latitude:$(avp(lat_lon)[0])\n");<br>
> xlog("L_INFO","Source IP longitude:$(avp(lat_lon)[1])\n");<br>
> };<br>
><br>
> ls -la /usr/share/GeoIP/GeoLiteCity.dat<br>
> -rw-r--r-- 1 root root 28543655 2010-01-25 11:15<br>
> /usr/share/GeoIP/GeoLiteCity.dat<br>
><br>
> I got some errors:<br>
> Jan 25 11:44:08 [10466] CRITICAL:core:yyerror: parse error in config<br>
> file, line 300, column 26-43: syntax error<br>
> Jan 25 11:44:08 [10466] CRITICAL:core:yyerror: parse error in config<br>
> file, line 300, column 43-44: bad arguments for command <mmg_lookup><br>
><br>
> What is wrong?<br>
><br>
><br>
> --<br>
> WBR, Leonid Nasedkin<br>
><br>
</div></div>> ------------------------------------------------------------------------<br>
<div><div></div><div class="h5">><br>
> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
> <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
><br>
<br>
<br>
--<br>
Bogdan-Andrei Iancu<br>
<a href="http://www.voice-system.ro" target="_blank">www.voice-system.ro</a><br>
<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><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>