<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">You should always have a domain name. Invent one to make the software happy.<div><br></div><div>Adrian</div><div><div><br></div><div><div><div>On Apr 9, 2009, at 12:41 PM, Dan-Cristian Bogos wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi Adrian,<br><br>looks much better now, thank you for so fast reaction.<br><br>One thing to comment, while we are here. Not sure what is your policy<br>regarding accounts, but when using a prepaid account without any realm /<br>or even in postpaid scenarios, if the UserName contain no domain part,<br>the following query will hit the database when choosing the customer<br>profile:<br>"""<br>select * from billing_customers<br> where subscriber = 'test'<br> or domain = ''<br> or gateway = '10.0.0.1'<br> or (subscriber = '' and domain = '' and gateway = '')<br> order by subscriber desc, domain desc, gateway desc limit 1<br>"""<br><br>In this case, any predefined rule which has domain empty will match, so<br>the result will be unexpected (cannot call it a real bug, but close).<br>Would it be possible to normalize the domain to something "faked.domain"<br>in case of missing from UserName, or is it against CDRTool internal<br>architecture?<br><br>Thanks again,<br>DanB<br><br>On Thu, 2009-04-09 at 12:17 +0200, Adrian Georgescu wrote:<br><blockquote type="cite">Hi Dan,<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I made a fix for this, please test the last version 6.7.7<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Adrian<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">On Apr 8, 2009, at 9:26 PM, Dan-Cristian Bogos wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">More on the subject ...<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Just to be sure that I am not doing any mistake, the log of mysql<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">for<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">the same command (ShowPrice From=<a href="sip:123@example2.com">sip:123@example2.com</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">To=<a href="sip:0031650222333@example.com">sip:0031650222333@example.com</a> Gateway=10.0.0.1 Duration=59) shows<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">the<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">gateway parameter queried as suspected, faked:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">090408 21:17:22 314 Init DB cdrtool<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> 314 Query select * from billing_customers<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> where subscriber = <a href="mailto:'123@example2.com">'123@example2.com</a>'<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> or domain = 'example2.com'<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> or gateway = '0.0.0.0'<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> or (subscriber = '' and domain = '' and gateway = '')<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> order by subscriber desc, domain desc, gateway desc limit 1<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Ta,<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">DanB<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">On Wed, 2009-04-08 at 17:34 +0200, Dan-Cristian Bogos wrote:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Guys,<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">some strange thing I noticed in the last versions of CDRTool<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">related to<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">usage of the Gateway parameter in ShowPrice. Based on logs it<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">looks like<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">the gateway parameter is somehow faked (or perhaps wrongly<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">converted).<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">1. On ShowPrice commands:<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">* Using default dataset, I have replaced the default entry<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">(gateway,<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">domain, subscriber empty) with (gateway=10.0.0.1 , subscriber and<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">domain<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">empty). Reloaded the cdrtool from console and executed:<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">ShowPrice From=<a href="sip:123@example2.com">sip:123@example2.com</a><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">To=<a href="sip:0031650222333@example.com">sip:0031650222333@example.com</a> Gateway=10.0.0.1 Duration=59<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">The answer was: <br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">0<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">In the syslog I could find: <br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Apr 8 17:12:54 DellLaptop cdrtool[11081]: ShowPrice<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">From=<a href="sip:123@example2.com">sip:123@example2.com</a> To=<a href="sip:0031650222333@example.com">sip:0031650222333@example.com</a><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Gateway=10.0.0.1 Duration=59<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Apr 8 17:12:54 DellLaptop cdrtool[11081]: Error: no customer<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">found in<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">billing_customers table for billing <a href="mailto:party=123@example2.com">party=123@example2.com</a>,<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">domain=example2.com, gateway=0.0.0.0<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">In the mysql table I have:<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">mysql> select * from billing_customers;<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">+----+----------+-------------+-------------------+---------------+-------------------+---------------+-------------------+------------------+-----------+--------------+--------------+<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">| id | gateway | domain | subscriber | profile_name1<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">|<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">profile_name1_alt | profile_name2 | profile_name2_alt | timezone<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">| increment | min_duration | country_code |<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">+----+----------+-------------+-------------------+---------------+-------------------+---------------+-------------------+------------------+-----------+--------------+--------------+<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">| 4 | 10.0.0.1 | | | 441<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"> |<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">| 442 | | Europe/Amsterdam | 0<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">|<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">0 | | <br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">| 5 | | example.com | | 441<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"> |<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">| 442 | | Europe/Amsterdam | 0<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">|<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">0 | | <br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">| 6 | | | <a href="mailto:alice@example.com">alice@example.com</a> | 441<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"> |<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">| 442 | | Europe/Amsterdam | 0<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">|<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">0 | | <br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">+----+----------+-------------+-------------------+---------------+-------------------+---------------+-------------------+------------------+-----------+--------------+--------------+<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">3 rows in set (0.01 sec)<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Ta,<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">DanB<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">_______________________________________________<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Users mailing list<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><br></div></blockquote></div><br></div></div></body></html>