CDRtool

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

CDRtool

Pavel Eremin-3
Hi, All! Let's dance with CDRTool

I am trying to use it on heavy load system and get stack.

Why in this code author match canonical number with string started by 0?(in hard way) Because of this line all calls are postpaid...:(

            if (!preg_match("/^0[9-0]{1,}@/",$CDR->CanonicalURINormalized)) {
                $log=sprintf ("MaxSessionTime=unlimited Type=prepaid CallId=%s BillingParty=%s DestId=None",$NetFields['callid'],$CDR->BillingPartyId);
                syslog(LOG_NOTICE, $log);
                $this->logRuntime();
                $ret="none"."\n"."type=prepaid";
                return $ret;
            } else {
                if (!$CDR->DestinationId) {
                    $log = sprintf ("error: cannot figure out the destination id for %s",$CDR->CanonicalURI);
                    $this->logRuntime();
                    syslog(LOG_NOTICE, $log);
                    $ret=$log."\n"."type=prepaid";
                    return $ret;
                }
            }


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: CDRtool

Pavel Eremin-3
This code in rating.php...

2014-09-29 22:18 GMT+06:00 Pavel Eremin <[hidden email]>:
Hi, All! Let's dance with CDRTool

I am trying to use it on heavy load system and get stack.

Why in this code author match canonical number with string started by 0?(in hard way) Because of this line all calls are postpaid...:(

            if (!preg_match("/^0[9-0]{1,}@/",$CDR->CanonicalURINormalized)) {
                $log=sprintf ("MaxSessionTime=unlimited Type=prepaid CallId=%s BillingParty=%s DestId=None",$NetFields['callid'],$CDR->BillingPartyId);
                syslog(LOG_NOTICE, $log);
                $this->logRuntime();
                $ret="none"."\n"."type=prepaid";
                return $ret;
            } else {
                if (!$CDR->DestinationId) {
                    $log = sprintf ("error: cannot figure out the destination id for %s",$CDR->CanonicalURI);
                    $this->logRuntime();
                    syslog(LOG_NOTICE, $log);
                    $ret=$log."\n"."type=prepaid";
                    return $ret;
                }
            }



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: CDRtool

Tijmen de Mes
Hi,

At this point in the code the call is already prepaid since the account has been found with the query:

$query=sprintf("select * from %s where account = '%s'",addslashes($this->prepaid_table),addslashes($CDR->BillingPartyId));

Normally if the normalized number starts with a 0 it is routed to PSTN, what in most cases has a price. If a number resolves over ENUM, the Normalized URI would not start with a 0, but will be a sip account. 

This is just a convention we made and therefore you also should not have accounts starting with a 0

-- 
Tijmen de Mes
AG-Projects

From: Pavel Eremin [hidden email]
Reply: OpenSIPS users mailling list [hidden email]
Date: 29 september 2014 at 18:30:00
To: OpenSIPS users mailling list [hidden email]
Subject:  Re: [OpenSIPS-Users] CDRtool

This code in rating.php...

2014-09-29 22:18 GMT+06:00 Pavel Eremin <[hidden email]>:
Hi, All! Let's dance with CDRTool

I am trying to use it on heavy load system and get stack.

Why in this code author match canonical number with string started by 0?(in hard way) Because of this line all calls are postpaid...:(

            if (!preg_match("/^0[9-0]{1,}@/",$CDR->CanonicalURINormalized)) {
                $log=sprintf ("MaxSessionTime=unlimited Type=prepaid CallId=%s BillingParty=%s DestId=None",$NetFields['callid'],$CDR->BillingPartyId);
                syslog(LOG_NOTICE, $log);
                $this->logRuntime();
                $ret="none"."\n"."type=prepaid";
                return $ret;
            } else {
                if (!$CDR->DestinationId) {
                    $log = sprintf ("error: cannot figure out the destination id for %s",$CDR->CanonicalURI);
                    $this->logRuntime();
                    syslog(LOG_NOTICE, $log);
                    $ret=$log."\n"."type=prepaid";
                    return $ret;
                }
            }


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: CDRtool

Adrian Georgescu
In reply to this post by Pavel Eremin-3
If you want to dive this deep into CDRTool, it would be a good start to read the documentation, that is all *.txt files in docs/ folder.

--
Adrian




_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

signature.asc (210 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: CDRtool

Pavel Eremin-3

Thanks, i read all of docs and have question about performance. (I Did describe it in another email to community)

30.09.2014 4:56 пользователь "Adrian Georgescu" <[hidden email]> написал:
If you want to dive this deep into CDRTool, it would be a good start to read the documentation, that is all *.txt files in docs/ folder.

--
Adrian




_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: CDRtool

Adrian Georgescu
Rating in real time involves many database and other operations depending on the complexity of the rating tables. Pushing 60 calls per second in a residential scenario will yield a lot of simultaneous calls. You can handle the traffic of many residential subscribers at 60 cps. I am personally surprised you were able to do this on one machine. 

You are trying to use the application in a high density trunking scenario and is no wonder you hit a limit, the application was not designed for being used in such scenario. The idea was to be able to handle 2/3 calls for discrete SIP devices belongs to one SIP account, where each SIP account corresponds to a SIP device like a cable modem used by residential subscribers. You are pushing it to do things beyond its design envelope. 

You should better use the quota system with postpaid rather than real time prepaid for what you describe as it makes little sense to have prepaid balance calculated in real time for high density trunks that generate lots of traffic and associated costs.

Adrian

On 30 Sep 2014, at 09:57, Pavel Eremin <[hidden email]> wrote:

Thanks, i read all of docs and have question about performance. (I Did describe it in another email to community)

30.09.2014 4:56 пользователь "Adrian Georgescu" <[hidden email]> написал:
If you want to dive this deep into CDRTool, it would be a good start to read the documentation, that is all *.txt files in docs/ folder.

--
Adrian




_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

--
Adrian




_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

signature.asc (210 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: CDRtool

Pavel Eremin-3

Thanks for explain some concepts. It is very usefull.

30.09.2014 20:33 пользователь "Adrian Georgescu" <[hidden email]> написал:
Rating in real time involves many database and other operations depending on the complexity of the rating tables. Pushing 60 calls per second in a residential scenario will yield a lot of simultaneous calls. You can handle the traffic of many residential subscribers at 60 cps. I am personally surprised you were able to do this on one machine. 

You are trying to use the application in a high density trunking scenario and is no wonder you hit a limit, the application was not designed for being used in such scenario. The idea was to be able to handle 2/3 calls for discrete SIP devices belongs to one SIP account, where each SIP account corresponds to a SIP device like a cable modem used by residential subscribers. You are pushing it to do things beyond its design envelope. 

You should better use the quota system with postpaid rather than real time prepaid for what you describe as it makes little sense to have prepaid balance calculated in real time for high density trunks that generate lots of traffic and associated costs.

Adrian

On 30 Sep 2014, at 09:57, Pavel Eremin <[hidden email]> wrote:

Thanks, i read all of docs and have question about performance. (I Did describe it in another email to community)

30.09.2014 4:56 пользователь "Adrian Georgescu" <[hidden email]> написал:
If you want to dive this deep into CDRTool, it would be a good start to read the documentation, that is all *.txt files in docs/ folder.

--
Adrian




_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

--
Adrian




_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users