<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18783">
<STYLE></STYLE>
</HEAD>
<BODY 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> the</FONT><FONT size=2 
face=Arial>&nbsp;CallingStationId is in the form <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: </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: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="FONT: 10pt arial; BACKGROUND: #e4e4e4; font-color: black"><B>From:</B> 
  <A title=danb@sms4sip.com href="mailto:danb@sms4sip.com">DanB</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=listas@b2br.net 
  href="mailto:listas@b2br.net">Alberto Listas</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Cc:</B> <A title=users@lists.opensips.org 
  href="mailto:users@lists.opensips.org">users@lists.opensips.org</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, July 22, 2009 4:23 
  AM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> 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 
  dir=ltr>&lt;<A href="mailto:listas@b2br.net">listas@b2br.net</A>&gt;</SPAN> 
  wrote:<BR>
  <BLOCKQUOTE 
  style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" 
  class=gmail_quote>
    <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> To=<A 
    href="mailto:sip%3A00552181000000@10.0.0.1" 
    target=_blank>sip:00552181000000@10.0.0.1</A> 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 <BR>Stop time: 2009-07-21 14:55:59<BR>Method:Invite from : <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: <A 
    href="mailto:005521810000@10.0.0.1" 
    target=_blank>005521810000@10.0.0.1</A><BR>Next hop <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 <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></BODY></HTML>