<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>CDRTool was designed to rate while using user@domain format for SIP URIs. IPs/hostnames only without username are not fully supported, something somewhere will likely break as you have already noticed.</div><div><br></div><div>Adrian</div><div><br></div><div><div>On Jul 22, 2009, at 7:41 PM, Alberto Listas wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div bgcolor="#ffffff"><div><font size="2" face="Arial">Hi Dan,</font></div><div><font size="2" face="Arial"></font>&nbsp;</div><div><font size="2" face="Arial">Thanks for the info, the doc/Rating.txt is very good but</font></div><div><font size="2" face="Arial">sometimes&nbsp;you need previous experience to understand</font></div><div><font size="2" face="Arial">the details.</font></div><div>&nbsp;</div><div><font size="2" face="Arial">I was already using the param:</font></div><div><font size="2" face="Arial">&nbsp;&nbsp;&nbsp; Source-IP=$avp(s:source_ip);</font></div><div><font size="2" face="Arial">But I wasn't setting any values so the SourceIP column was blank.</font></div><div><font size="2" face="Arial">I added a line to the cfg to set the value:</font></div><div><font size="2" face="Arial">&nbsp;&nbsp;&nbsp; $avp(s:source_ip) = $si;</font></div><div><font size="2" face="Arial"></font>&nbsp;</div><div><font size="2" face="Arial">And now the rating identifies the origin by SourceIP</font></div><div><font size="2" face="Arial"><strong>when</strong><span class="Apple-converted-space">&nbsp;</span>the</font><font size="2" face="Arial">&nbsp;CallingStationId is in the form<span class="Apple-converted-space">&nbsp;</span><a href="mailto:123456@1.1.1.1">123456@1.1.1.1</a></font></div><div><font size="2" face="Arial">(and hence the domain is set to the IP of the source)</font></div><div><font size="2" face="Arial">but when CallingStationId is in the form 1.1.1.1 (just the IP)</font></div><div><font size="2" face="Arial">the Domain in the info of the call is blank and the rating does not work.</font></div><div><font size="2" face="Arial"></font>&nbsp;</div><div><font size="2" face="Arial">When the Domain is blank the rating engine use the profile</font></div><div><font size="2" face="Arial">"Customer:<span class="Apple-converted-space">&nbsp;</span></font><a href="mailto:alice@example.com"><font size="2" face="Arial">alice@example.com</font></a><font size="2" face="Arial">"&nbsp;from the default Customer</font></div><div><font size="2" face="Arial">configuration of CDRTool. I suppose this is because this customer</font></div><div><font size="2" face="Arial">has a blank domain field. But this is an error since it should use</font></div><div><font size="2" face="Arial">the default profile instead.</font></div><div><font size="2" face="Arial"></font>&nbsp;</div><div><font size="2" face="Arial">Anyway, Thanks for your help, now it can rate by IP.</font></div><div><font size="2" face="Arial"></font>&nbsp;</div><div><font size="2" face="Arial">Cheers,</font></div><div><font size="2" face="Arial"></font>&nbsp;</div><div><font size="2" face="Arial">Alberto</font></div><div><font size="2" face="Arial"></font>&nbsp;</div><blockquote style="border-left-color: rgb(0, 0, 0); border-left-width: 2px; border-left-style: solid; padding-left: 5px; padding-right: 0px; margin-left: 5px; margin-right: 0px; "><div style="font: normal normal normal 10pt/normal arial; ">----- Original Message -----</div><div style="font: normal normal normal 10pt/normal arial; background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: rgb(228, 228, 228); background-position: initial initial; "><b>From:</b><span class="Apple-converted-space">&nbsp;</span><a title="danb@sms4sip.com" href="mailto:danb@sms4sip.com">DanB</a></div><div style="font: normal normal normal 10pt/normal arial; "><b>To:</b><span class="Apple-converted-space">&nbsp;</span><a title="listas@b2br.net" href="mailto:listas@b2br.net">Alberto Listas</a></div><div style="font: normal normal normal 10pt/normal arial; "><b>Cc:</b><span class="Apple-converted-space">&nbsp;</span><a title="users@lists.opensips.org" href="mailto:users@lists.opensips.org">users@lists.opensips.org</a></div><div style="font: normal normal normal 10pt/normal arial; "><b>Sent:</b><span class="Apple-converted-space">&nbsp;</span>Wednesday, July 22, 2009 4:23 AM</div><div style="font: normal normal normal 10pt/normal arial; "><b>Subject:</b><span class="Apple-converted-space">&nbsp;</span>Re: [OpenSIPS-Users] CDRTool does not identify by IP origin from OpenSips</div><div><br></div>Hi Alberto,<div><br></div><div>By default CDRTool takes the gateway parameter out of&nbsp;Source IP (nicely explained also in the doc/RATING.TXT) and if you don't modify the defaults, out of radacct.SourceIP column.</div><div><br></div><div>In order to identify the gateway, you need to enforce that SourceIP inside opensips script to whatever IP you want to be used as your gateway.</div><div>Example of params in opensips.cfg:</div><div>modparam("acc", "radius_extra", " &nbsp; &nbsp; &nbsp;&nbsp;Source-IP=$avp(s:mygtw)")</div><div><br></div><div>Another trick you can use is to write your own radius sql query which places the SourceIP from another radius attribute received.</div><div><br></div><div>Cheers,</div><div>DanB</div><br><div class="gmail_quote">On Tue, Jul 21, 2009 at 9:44 PM, Alberto Listas<span class="Apple-converted-space">&nbsp;</span><span dir="ltr">&lt;<a href="mailto:listas@b2br.net">listas@b2br.net</a>&gt;</span><span class="Apple-converted-space">&nbsp;</span>wrote:<br><blockquote class="gmail_quote" style="border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; padding-left: 1ex; "><div bgcolor="#ffffff"><div><font size="2" face="Arial"><div><font size="2" face="Arial">Hi,<br><br>I am having a difficulty with the rating in CDRTool. When I telnet and give this command:<br><br>ShowPrice From=<a href="mailto:sip%3A005521810000@10.0.0.4" target="_blank">sip:005521810000@10.0.0.4</a><span class="Apple-converted-space">&nbsp;</span>To=<a href="mailto:sip%3A00552181000000@10.0.0.1" target="_blank">sip:00552181000000@10.0.0.1</a><span class="Apple-converted-space">&nbsp;</span>Gateway=10.0.0.4 Duration=30</font></div><div><font size="2" face="Arial">(IPs where changed)</font></div><font size="2" face="Arial"><div><br>The rating engine identifies the customer by the gateway and rates correctly.<br><br>When the call comes from the OpenSips it doesn't identify the customer and uses<br>the default profile:<br><br>Start time: 2009-07-21 14:55:24<span class="Apple-converted-space">&nbsp;</span><br>Stop time: 2009-07-21 14:55:59<br>Method:Invite from :<span class="Apple-converted-space">&nbsp;</span><br><a href="mailto:From%3A5521083200000@10.0.0.4" target="_blank">From:5521083200000@10.0.0.4</a><br>Domain:10.0.0.4<br>To (dialed URI):<a href="mailto:005521810000@10.0.0.4" target="_blank">005521810000@10.0.0.4</a><br>Canonical URI:<span class="Apple-converted-space">&nbsp;</span><a href="mailto:005521810000@10.0.0.1" target="_blank">005521810000@10.0.0.1</a><br>Next hop<span class="Apple-converted-space">&nbsp;</span><a href="mailto:URI%3A005521810000@10.0.0.2" target="_blank">URI:005521810000@10.0.0.2</a><br>Destination: BRAZIL CELL (55218)<br>Billing<span class="Apple-converted-space">&nbsp;</span><a href="mailto:Party%3A5521810000@10.0.0.4" target="_blank">Party:5521810000@10.0.0.4</a><br>Reseller:<br></div><div>Duration: 35 s<br>App: audio<br>Destination: 55218<br>Customer: default<br>Connect: 0.0000 ......</div><div><br>Should I set some different variable to FreeRadius for it to identify the GATEWAY?</div></font></font></div><div><font size="2" face="Arial"></font>&nbsp;</div><div><font size="2" face="Arial">Thanks,</font></div><div><font size="2" face="Arial"></font>&nbsp;</div><font color="#888888"><div><font size="2" face="Arial">Alberto</font></div></font></div><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></blockquote></div><br></blockquote>_______________________________________________<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">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br></div></span></blockquote></div><br></body></html>