Hello Guys, <br><br>Im sorry for te long delay, <br><br>Justo to know of all the change that was necessary to me was.<br><br>1) - Create your e164 rule<br><br>class E164_Brazil extends E164 {<br> function E164_Brazil ($intAccessCode='00', $natAccessCode='55[1-9][1-9]',<div id=":3ff">
$CountryCode='',$ENUMtldRegexp="([1-9][0-9]{7,})") {<br>
$this->regexp_international = "/^".$intAccessCode."([0-9][0-9]{5,})\$/";<br> $this->regexp_national = "/^".$natAccessCode."([2-9][0-9]{7})\$/";<div class="im">
<br> $this->CountryCode = trim($CountryCode);<br>
$this->ENUMtldRegexp = trim($ENUMtldRegexp);<br> }<br>}<br><br><br></div>2) - Comment these variables on your cdr_generic.php file<br> //var $intAccessCode = '00';<br> //var $natAccessCode = '0';<br>
// var $E164_class = 'E164_Europe';<br><br>3) - Changes these values on your global.inc file<br><br> "E164_class" => "E164_Brazil", // change the class name for your needed<br>
"intAccessCode" => "", // give this blank because was specified on your e164 rule<br> "natAccessCode" => "", // give this blank because was specified on your e164 rule<br>
<br><br><br><br>Below the result on cdrtool<br><br><table cellpadding="0" cellspacing="0" border="0"><tbody><tr></tr><tr>
<td>To (dialed URI):</td>
<td>551135444444@XX.XX.XX.YY</td>
</tr>
<tr>
<td><br></td>
<td>Canonical URI: </td>
<td>551135444444@XX.XX.XX.YY</td>
</tr>
<tr>
<td><br></td>
<td>Next Hop URI:</td>
<td>00551135444444@XX.XX.XX.XX</td>
</tr>
<tr>
<td><br></td>
<td>Destination: </td>
<td>BRAZIL SAO PAULO (5511)</td></tr></tbody></table><br><br>Span: 1<br>
Duration: 3 s<br>
ProfileId: grn_premium / weekend<br>
RateId: grn_premium / 0-24h<br>
Rate: 0.0305 / 60 s<br>
Price: 0.0015</div><br><br><div class="gmail_quote">2011/8/30 Mike Tesliuk <span dir="ltr"><<a href="mailto:mike@ultra.net.br">mike@ultra.net.br</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hello Guys, <br><br><br>Im trying to change the E164 rule used by cdrtool to charge my calls (is a test enviroment), i create on library/cdr_generic.php the class E164_Brazil<br><br>Below the code that i insert on cdr_generic<br>
<br><br>class E164_Brazil extends E164 {<br> function E164_Brazil ($intAccessCode='00', $natAccessCode='55[1-9][1-9]',$CountryCode='',$ENUMtldRegexp="([2-9]{7,})") {<br> $this->regexp_international = "/^".$intAccessCode."([1-9][0-9]{5,})\$/";<br>
$this->regexp_national = "/^".$natAccessCode."([2-9][0-9]{6,})\$/";<br> $this->CountryCode = trim($CountryCode);<br> $this->ENUMtldRegexp = trim($ENUMtldRegexp);<br>
}<br>}<br><br>Just to jusitfy the Brazil country code is 55 and our area codes are [1-9][1-9], later we have the number with 8 digits start from 2 <br><br><br>I put on my global.inc datasource (opensips section) the value<br>
<br> "E164_class" => "E164_Brazil",<br><br>i reload cdrtool, i restart cdrtool, but all my calls are not billed (all are on-net to cdrtool)<br><br><table cellspacing="2" width="100%" border="0">
<tbody><tr bgcolor="lightgrey"><td>Id</td>
<td><b>Start Time</b></td>
<td><b>Flow</b></td>
<td><b>SIP Caller</b></td>
<td><b>Location</b></td>
<td><b>Sip Proxy</b></td>
<td><b>Apps</b></td>
<td><b>SIP Destination</b></td>
<td><b>Dur</b></td>
<td><b>Price</b></td>
<td align="right"><b>KBIn</b></td>
<td align="right"><b>KBOut</b></td>
<td align="right"><b>Status</b></td>
<td align="right"><b>Codecs</b></td>
</tr>
<tr bgcolor="white">
<td valign="top"><a href="http://ser1.ultra.net.br/CDRTool/callsearch.phtml?cdr_source=opensips_radius&cdr_table=radacct201108&order_by=RadAcctId&order_type=DESC&begin_datetime=1314659280&end_datetime=1314744900&maxrowsperpage=15&action=search#" target="_blank">1N</a></td>
<td valign="top">2011-08-30 09:57:51</td>
<td valign="top">on-net</td>
<td valign="top">MY_USER@MY_SERVER</td>
<td valign="top"></td>
<td valign="top"><br></td>
<td valign="top">audio</td>
<td valign="top">551135444444@MY_SERVER
</td>
<td align="right" valign="top">00:05</td>
<td align="right" valign="top"><br></td>
<td align="right" valign="top">37.89 </td>
<td align="right" valign="top">92.97</td>
<td align="right" valign="top"><font color="green"> Ok (200)</font></td>
<td align="right" valign="top">G711u</td></tr></tbody></table><br><br>If i try to call with internation prefix (00) i get my call billed correctly<br><br><br> Have sombody an idea about where is my mistake ?<br><br>
<br>Thanks for all<br>
</blockquote></div><br>