[OpenSIPS-Users] CDRTool Prepaid

Philipp Hoffmann philipp.hoffmann at arcor.de
Tue Apr 6 18:10:30 CEST 2010


 
Mhhh,... Laszlo, can do you send me a example for my cdr_genric.php, which my allow to send the can_uri to cdrtool directly in e.164?

Philipp





----- Original Nachricht ----
Von:     Laszlo <laszlo at voipfreak.net>
An:      Philipp Hoffmann <philipp.hoffmann at arcor.de>
Datum:   04.04.2010 21:50
Betreff: Re: Re: Re: Re: Re: [OpenSIPS-Users] CDRTool Prepaid

> Ahh, that is just a theoretical thing how you sending it to cdrtool. The
> default format have the european logic (so internatinal starts with 00).
> 
> Or if you have concerned about showing it in cdrtool with + as a leading
> char, then just strip it out here:
> 
> 
>  $NumberStack['NumberPrint']     = "+".$NumberStack['E164'];
> 
> in cdr_generic.php
> 
> For sending it directly in E164 format (so the canonical uri) will require
> a
> bit more extensive rewrite of the logic.
> 
> 2010/4/4 Philipp Hoffmann <philipp.hoffmann at arcor.de>
> 
> >  Yes, right.
> >
> > - Philipp
> >
> >
> > ----- Original Nachricht ----
> > Von:     Laszlo <laszlo at voipfreak.net>
> > An:      Philipp Hoffmann <philipp.hoffmann at arcor.de>
> > Datum:   04.04.2010 21:35
> > Betreff: Re: Re: Re: Re: [OpenSIPS-Users] CDRTool Prepaid
> >
> > > So the Canonical URI like how it was in the screenshot?
> > > http://img143.imageshack.us/img143/6237/cdruh.jpg
> > >
> > > 2010/4/4 Philipp Hoffmann <philipp.hoffmann at arcor.de>
> > >
> > > > Right, but I want to give CDRTool the number IN the E.164-formation.
> No
> > > > translation required.
> > > >
> > > >
> > > > ----- Original Nachricht ----
> > > > Von:     Laszlo <laszlo at voipfreak.net>
> > > > An:      Philipp Hoffmann <philipp.hoffmann at arcor.de>
> > > > Datum:   04.04.2010 21:14
> > > > Betreff: Re: Re: Re: [OpenSIPS-Users] CDRTool Prepaid
> > > >
> > > > > International is accessed with 00, right?
> > > > > What about the national plan? How you determine if it's a national
> > > call?
> > > > >
> > > > > 2010/4/4 Philipp Hoffmann <philipp.hoffmann at arcor.de>
> > > > >
> > > > > > Thanks, can do you give my a example class for my case?
> > > > > >
> > > > > > Currently plan:
> > > > > >
> > > > > > class E164_Europe extends E164 {
> > > > > >     function E164_Europe ($intAccessCode='00',
> > > > > >
> > $natAccessCode='0',$CountryCode='',$ENUMtldRegexp="([1-9][0-9]{7,})")
> > > {
> > > > > >        $this->regexp_international =
> > > > > > "/^".$intAccessCode."([1-9][0-9]{5,})\$/";
> > > > > >        $this->regexp_national      =
> > > > > > "/^".$natAccessCode."([1-9][0-9]{3,})\$/";
> > > > > >        $this->CountryCode          = trim($CountryCode);
> > > > > >        $this->ENUMtldRegexp        = trim($ENUMtldRegexp);
> > > > > >     }
> > > > > > }
> > > > > >
> > > > > > Philipp
> > > > > >
> > > > > > ----- Original Nachricht ----
> > > > > > Von:     Laszlo <laszlo at voipfreak.net>
> > > > > > An:      Philipp Hoffmann <philipp.hoffmann at arcor.de>
> > > > > > Datum:   04.04.2010 21:02
> > > > > > Betreff: Re: Re: [OpenSIPS-Users] CDRTool Prepaid
> > > > > >
> > > > > > > Also, take a look at CDRTool/library/cdr_generic.php
> > > > > > >
> > > > > > > class E164_Europe extends E164 {
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > 2010/4/4 Laszlo <laszlo at voipfreak.net>
> > > > > > >
> > > > > > > > Sure, just fit the E164class to your needs.
> > > > > > > > http://download.ag-projects.com/CDRTool/doc/RATING.txt
> > > > > > > >
> > > > > > > > "
> > > > > > > >
> > > > > > > > The longest match for the chosen destination field is
> performed
> > > by
> > > > > the
> > > > > > > >
> > > > > > > > E164_class, which by default uses E164_Europe that defines an
> > > > > European
> > > > > > > > numbering plan. It assumes the destinations start with a zero
> > for
> > > a
> > > > > > > national
> > > > > > > > call and with double zero for an international call. See
> > > > > > cdr_generic.php
> > > > > > > for
> > > > > > > >
> > > > > > > > the actual logic.
> > > > > > > >
> > > > > > > > If your dialing plan is different, you must use other
> provided
> > > > class
> > > > > > like
> > > > > > > > E164_US or create a custom class and point to it in
> global.inc
> > > for
> > > > > each
> > > > > > > > datasource as follows:
> > > > > > > >
> > > > > > > > 'E164_class'=>'MyE164Class',
> > > > > > > >
> > > > > > > > For example the pre-defined E164_US class from
> cdr_generic.php
> > > > > matches
> > > > > > > the
> > > > > > > > American dialing plan."
> > > > > > > >
> > > > > > > >
> > > > > > > > 2010/4/4 Philipp Hoffmann <philipp.hoffmann at arcor.de>
> > > > > > > >
> > > > > > > >> Yeeeaaaarr!!!
> > > > > > > >>
> > > > > > > >> Thanks, now it works! :-)
> > > > > > > >>
> > > > > > > >> Is there a way to send the number directly in the E.164 -
> > format
> > > > to
> > > > > > > >> CDRTool?
> > > > > > > >>
> > > > > > > >> Philipp
> > > > > > > >>
> > > > > > > >> ----- Original Nachricht ----
> > > > > > > >> Von:     Laszlo <laszlo at voipfreak.net>
> > > > > > > >> An:      philipp.hoffmann at arcor.de
> > > > > > > >> Datum:   04.04.2010 20:32
> > > > > > > >> Betreff: Re: [OpenSIPS-Users] CDRTool Prepaid
> > > > > > > >>
> > > > > > > >> > Hmm, and what if you try to insert this code snipped after
> > the
> > > > > > > beginning
> > > > > > > >> of
> > > > > > > >> > the main route block?
> > > > > > > >> >
> > > > > > > >> > if (uri=~"^sip:[1-9][0-9]*")
> > > > > > > >> > {
> > > > > > > >> >        prefix("00");
> > > > > > > >> >       $avp(s:can_uri) = $ru;
> > > > > > > >> >       strip(2);
> > > > > > > >> > };
> > > > > > > >> >
> > > > > > > >> >
> > > > > > > >> > so after route {
> > > > > > > >> >
> > > > > > > >> > -Laszlo
> > > > > > > >> >
> > > > > > > >> > 2010/4/4 Philipp Hoffmann <philipp.hoffmann at arcor.de>
> > > > > > > >> >
> > > > > > > >> > >  Hi Laszlo,
> > > > > > > >> > >
> > > > > > > >> > > thanks for your reply.
> > > > > > > >> > >
> > > > > > > >> > > Take a look:
> > > > > > > >> > > http://img143.imageshack.us/img143/6237/cdruh.jpg
> > > > > > > >> > >
> > > > > > > >> > > hoff01 at sip.hns-rechenzentrum.de, is my subscriber and
> > > billing
> > > > > > > >> costumer
> > > > > > > >> > for
> > > > > > > >> > > this call.
> > > > > > > >> > >
> > > > > > > >> > > I use OpenSIPS's functions prefix, strip to get the
> right
> > > > > > > >> e.164-number.
> > > > > > > >> > > So, I have change the CDRTool's standard class for
> number
> > > > > > > translation,
> > > > > > > >> > for
> > > > > > > >> > > the right result:
> > > > > > > >> > >
> > > > > > > >> > > 49 => Germany
> > > > > > > >> > > 800 => Prefix for free calls
> > > > > > > >> > > 3301000 => Hotline of the Germany telecom (Deutsche
> > Telekom)
> > > > > > > >> > >
> > > > > > > >> > > 83.169.18.105 is our SS7 interconnection gateway.
> > > > > > > >> > >
> > > > > > > >> > > Why set CDRTool Customer: subscriber=
> > > > > > > >> pierrel01 at sip.hns-rechenzentrum.de?
> > > > > > > >> > I
> > > > > > > >> > > didn't set any CDRTool param in my opensips.cfg.
> > > > > > > >> > >
> > > > > > > >> > > Philipp
> > > > > > > >> > >
> > > > > > > >> > > Am 04.04.2010 19:49, schrieb Laszlo:
> > > > > > > >> > >
> > > > > > > >> > > Hi Philipp,
> > > > > > > >> > >
> > > > > > > >> > > 2010/4/4 Philipp Hoffmann <philipp.hoffmann at arcor.de>
> > > > > > > >> > >
> > > > > > > >> > >> Dear list,
> > > > > > > >> > >>
> > > > > > > >> > >> I have created a prepaid account in our CDRTool
> database,
> > > but
> > > > I
> > > > > > > >> recived
> > > > > > > >> > >> any time "postpaid not limited" in syslog:
> > > > > > > >> > >>
> > > > > > > >> > >> Apr  3 11:32:33 ser1 call-control[2215]: Call id
> > > > > 535fc5df9397086
> > > > > > of
> > > > > > > >> > >> user at domain.de to sip:498003301000 at xx.xx.xx.xx
> > > > > > :5060;transport=udp
> > > > > > > is
> > > > > > > >> > >> postpaid not limited
> > > > > > > >> > >>
> > > > > > > >> > >> .... but if I manualy check this, the MySQL result
> tells:
> > > > > > > >> > >>
> > > > > > > >> > >> mysql> select * from prepaid where account =
> > > 'user at domain.de
> > > > ';
> > > > > > > >> > >>
> > > > > > > >> > >>
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> +----+-------------+----------------------------------+---------+-----------
> 
> > >
> > > > >
> > > > > > >
> > > > > > > >> >
> > ----------+-----------------+-----------------+--------------+
> > > > > > > >> > >> | id | reseller_id | account                          |
> > > > balance
> > > > > |
> > > > > > > >> > >> change_date         | active_sessions | session_counter
> |
> > > > > > > >> max_sessions |
> > > > > > > >> > >>
> > > > > > > >> > >>
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> +----+-------------+----------------------------------+---------+-----------
> 
> > >
> > > > >
> > > > > > >
> > > > > > > >> >
> > ----------+-----------------+-----------------+--------------+
> > > > > > > >> > >> | 10 |           0 | user at domain.de |  5.0000 |
> > 0000-00-00
> > > > > > 00:00:00
> > > > > > > >> |
> > > > > > > >> > >>             |               0 |            2 |
> > > > > > > >> > >>
> > > > > > > >> > >>
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> +----+-------------+----------------------------------+---------+-----------
> 
> > >
> > > > >
> > > > > > >
> > > > > > > >> >
> > ----------+-----------------+-----------------+--------------+
> > > > > > > >> > >> 1 row in set (0.00 sec)
> > > > > > > >> > >>
> > > > > > > >> > >> Another example for this:
> > > > > > > >> > >>
> > > > > > > >> > >> > > telnet xx.xx.xx.xx 9024
> > > > > > > >> > >> MaxSessionTime Duration=36000 CallId=535fc5df9397086
> > From=
> > > > > > > >> > >> sip:user at domain.de <sip%3Auser at domain.de> <
> > sip%3Auser at domain.de <sip%253Auser at domain.de>> <
> > > > sip%3Auser at domain.de <sip%253Auser at domain.de>
> <sip%253Auser at domain.de<sip%25253Auser at domain.de>
> > >>
> > > > > <sip%3Auser at domain.de <sip%253Auser at domain.de>
> > > <sip%253Auser at domain.de <sip%25253Auser at domain.de>><
> > sip%253Auser at domain.de
> <sip%25253Auser at domain.de><sip%25253Auser at domain.de<sip%2525253Auser at domain.
> de>
> > >
> > > > >
> > > > > > >
> > > > > > > <sip%3Auser at domain.de <sip%253Auser at domain.de> <
> > sip%253Auser at domain.de <sip%25253Auser at domain.de>>
> > > > > <sip%253Auser at domain.de <sip%25253Auser at domain.de> <
> > sip%25253Auser at domain.de <sip%2525253Auser at domain.de>>><
> > > > sip%253Auser at domain.de <sip%25253Auser at domain.de>
> > > <sip%25253Auser at domain.de <sip%2525253Auser at domain.de>><
> > sip%25253Auser at domain.de <sip%2525253Auser at domain.de>
> > <sip%2525253Auser at domain.
> > > de>
> > > > >
> > > > > > >>
> > > > > > > >> Gateway=xx.xx.xx.xx To=
> > > > > > > >> > >> sip:498003301000 at xx.xx.xx.xx:5060;transport=udp
> > > > > > > >> > >>
> > > > > > > >> > >> type=prepaid
> > > > > > > >> > >>
> > > > > > > >> > >> Callcontrol's config.ini point to the right cdrtool
> host.
> > > > > > > >> > >>
> > > > > > > >> > >> Any idea?
> > > > > > > >> > >>
> > > > > > > >> > >> Regards,
> > > > > > > >> > >> Philipp
> > > > > > > >> > >>
> > > > > > > >> > >
> > > > > > > >> > > If you have a look at the cdrs in cdrtool, all fields
> are
> > > > filled
> > > > > > > >> > correctly?
> > > > > > > >> > > Like canonical uri, etc.
> > > > > > > >> > > Can you paste an example event from radacct?
> > > > > > > >> > >
> > > > > > > >> > > -Laszlo
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> > > _______________________________________________
> > > > > > > >> > > Users mailing list
> > > > > > > >> > >
> > > > > > > >> > Users at lists.opensips.orghttp://
> > > > > > > >> lists.opensips.org/cgi-bin/mailman/listinfo/u
> > > > > > > >> > sers
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> > > _______________________________________________
> > > > > > > >> > > Users mailing list
> > > > > > > >> > > Users at lists.opensips.org
> > > > > > > >> > > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> 



More information about the Users mailing list