[OpenSIPS-Users] Custom E164 Dialplan on CDRTool

Mike Tesliuk mike at ultra.net.br
Tue Oct 4 16:11:02 CEST 2011


Hello Guys,

Im sorry for te long delay,

Justo to know of all the change that was necessary to me was.

1) - Create your e164 rule

class E164_Brazil extends E164 {
    function E164_Brazil ($intAccessCode='00',
$natAccessCode='55[1-9][1-9]',
$CountryCode='',$ENUMtldRegexp="([1-9][0-9]{7,})") {
        $this->regexp_international =
"/^".$intAccessCode."([0-9][0-9]{5,})\$/";
        $this->regexp_national      =
"/^".$natAccessCode."([2-9][0-9]{7})\$/";

        $this->CountryCode          = trim($CountryCode);
        $this->ENUMtldRegexp        = trim($ENUMtldRegexp);
    }
}


2) - Comment these variables on your cdr_generic.php file
      //var $intAccessCode       = '00';
     //var $natAccessCode       = '0';
       // var $E164_class          = 'E164_Europe';

3) - Changes these values on your global.inc file

                       "E164_class"         => "E164_Brazil", // change the
class name for your needed
                     "intAccessCode"      => "",           // give this
blank because was specified on your e164 rule
                    "natAccessCode"      => "",            // give this
blank because was specified on your e164 rule




Below the result on cdrtool

To (dialed URI): 551135444444 at XX.XX.XX.YY
Canonical URI: 551135444444 at XX.XX.XX.YY
Next Hop URI: 00551135444444 at XX.XX.XX.XX
Destination: BRAZIL SAO PAULO (5511)

Span: 1
Duration: 3 s
ProfileId: grn_premium / weekend
RateId: grn_premium / 0-24h
Rate: 0.0305 / 60 s
Price: 0.0015


2011/8/30 Mike Tesliuk <mike at ultra.net.br>

> Hello Guys,
>
>
> 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
>
> Below the code that i insert on cdr_generic
>
>
> class E164_Brazil extends E164 {
>     function E164_Brazil ($intAccessCode='00',
> $natAccessCode='55[1-9][1-9]',$CountryCode='',$ENUMtldRegexp="([2-9]{7,})")
> {
>         $this->regexp_international =
> "/^".$intAccessCode."([1-9][0-9]{5,})\$/";
>         $this->regexp_national      =
> "/^".$natAccessCode."([2-9][0-9]{6,})\$/";
>         $this->CountryCode          = trim($CountryCode);
>         $this->ENUMtldRegexp        = trim($ENUMtldRegexp);
>     }
> }
>
> 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
>
>
> I put on my global.inc datasource (opensips section) the value
>
>                     "E164_class"         => "E164_Brazil",
>
> i  reload cdrtool, i restart cdrtool, but all my calls are not billed (all
> are on-net to cdrtool)
>
> Id *Start Time* *Flow* *SIP Caller* *Location* *Sip Proxy* *Apps* *SIP
> Destination* *Dur* *Price* *KBIn* *KBOut* *Status* *Codecs*  1N<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#> 2011-08-30
> 09:57:51 on-net MY_USER at MY_SERVER
> audio 551135444444 at MY_SERVER 00:05
> 37.89 92.97 Ok (200) G711u
>
> If i try to call with internation prefix (00) i get my call billed
> correctly
>
>
>  Have sombody an idea about where is my mistake ?
>
>
> Thanks for all
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20111004/475be387/attachment.htm>


More information about the Users mailing list