[OpenSIPS-Users] CDRtool

Tijmen de Mes tijmen at ag-projects.com
Mon Sep 29 20:10:58 CEST 2014


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 <eremina.net at gmail.com>
Reply: OpenSIPS users mailling list <users at lists.opensips.org>>
Date: 29 september 2014 at 18:30:00
To: OpenSIPS users mailling list <users at lists.opensips.org>>
Subject:  Re: [OpenSIPS-Users] CDRtool  

This code in rating.php...

2014-09-29 22:18 GMT+06:00 Pavel Eremin <eremina.net at gmail.com>:
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  
Users at lists.opensips.org  
http://lists.opensips.org/cgi-bin/mailman/listinfo/users  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20140929/5ce49031/attachment.htm>


More information about the Users mailing list