[OpenSIPS-Users] need help on connection CDRTool to opensips

ha do haloha201 at yahoo.com
Thu Nov 11 11:55:52 CET 2010


Hi Tijmen

Maybe you forgot to remove the bind interfaces directive in the mysql config.
that is useful information, i edit the my.cnf and now it works fine now

i read the RATING.txt, PREPAID.txt times to times but i cannot understand it


The following steps are performed to rate a CDR:

1. Determination of the billing party    
a. SIP account user at domain 
b. SIP domain of the SIP account
c. Source IP of the session
    d. Default (when none of the above matches)
if there is no sip account user at domain in cdrtool the cdrtool try next 
option(sip domain) if sip domain does not exist it try next option(source ip)and 
then the default option
please let me know if i am wrong

2. Determination of the destination id
a. CanonicalURI (the destination after all lookups inside the SIP Proxy) 
b. SipTranslatedRequestURI (the Request URI as presented by the SIP UA)
c. CalledStationId (the content of the To header, used as a last resort)
if the CanonicalURI does not exist it try to next option(Request URI) ...
please let me know if i am wrong

3. Determination of the costs


i try to test 
1. opensips1 is the registrar server and try to do prepaid for every subscribers 
of opensips
    subscriber registers to opensips1, opensips1 domain 192.168.1.39

2 opensips2 is a gateway
    endpoint-----opensips1-------opensips2----internet-----VOIP service provider

how can i config cdrtool rating all calls from opensips1 and opensips2
could you please guide me some steps to do

i did check the global.inc and cdr_generic.php 
-global.inc is a copy of global.inc.simple.sample and i change 
# Normalize engine settings
$CDRTool['normalize']['defaultCountryCode']      = "84";
-cdr-generic.php does not change


i config  in web

the destination
Ops,Reseller,Trusted 
peer,Domain,Subscriber,Destination,Region,Description,Incr,Min Dur,Max Dur,Max 
Price
2,0,,,,84,,vietnam,6,6,0,

rate
Ops,Reseller,Rate,Destination,App,Connect,Duration,Conn In,Duration In
2,0,84,84,audio,0,998,,

profile
Ops,Reseller,Profile,Rate 1,00-H1,Rate 2,H1-H2,Rate 3,H2-H3,Rate 4,H3-24
2,0,84,84,24,0,0,,0,,0


i just try to see what happen in cdrtool, call from subscriber to subscriber

these are the logs
Nov 11 12:39:46 opensips cdrtool[2302]: MaxSessionTime Duration=36000 
CallId=1289463574-3016-HIEP-PC at 192.168.1.36 From=sip:843000 at 192.168.1.39 
Gateway=192.168.1.36 To=sip:00842000 at 192.168.1.39
Nov 11 12:39:46 opensips cdrtool[2302]: MaxSessionTime=unlimited Type=postpaid 
CallId=1289463574-3016-HIEP-PC at 192.168.1.36 BillingParty=843000 at 192.168.1.39

log of call-control
Call id 1289463575-3016-HIEP-PC at 192.168.1.36 of 843000 at 192.168.1.39 to 
sip:00842000 at 192.168.1.39 is postpaid not limited

it always return postpaid

Thank you




----- Original Message ----
From: Tijmen de Mes <tijmen at ag-projects.com>
To: OpenSIPS users mailling list <users at lists.opensips.org>
Sent: Thu, November 11, 2010 4:42:49 PM
Subject: Re: [OpenSIPS-Users] need help on connection CDRTool to opensips

Hi,

You should verify by hand that you can connect to the database by
executing a mysql -h 192.168.1.39 -u opensips -psips  opensips.

Maybe you forgot to remove the bind interfaces directive in the mysql config.

Best regards,

Tijmen de Mes
AG Projects

On Nov 9, 2010, at 4:11 AM, ha do wrote:

> Hi all
> 
> i installed opensips and mediaproxy in server 1, ip address : 192.168.1.39
> and cdrtool and freeradius in server 2, ip address : 192.168.1.42
> 
> the opensips, mediaproxy, freeradius starting are fine
> 
> 
> i use the link below as a guide
> http://cdrtool.ag-projects.com/browser/doc/INSTALL.txt
> 
> the problem i got only with cdrtool
> Nov  9 04:56:22 cdrtool cdrtool[3219]: Read 12291 PSTN destinations from cache
> in 0 seconds
> Nov  9 04:56:22 cdrtool cdrtool[3219]: Error in connect(): pconnect as 
opensips
> to 192.168.1.39 failed
> Nov  9 04:56:22 cdrtool cdrtool[3219]: Database DB_opensips error:  (0) select 
>*
> from domain
> Nov  9 04:56:22 cdrtool cdrtool[3219]: Error in connect(): pconnect as 
opensips
> to 192.168.1.39 failed
> Nov  9 04:56:22 cdrtool cdrtool[3219]: Database DB_opensips error:  (0) select 
>*
> from trusted
> Nov  9 04:56:22 cdrtool cdrtool[3219]: PSTN destinations cache size: 0.64 MB
> Nov  9 04:56:22 cdrtool cdrtool[3219]: SIP destinations cache size: 0.00 MB
> Nov  9 04:56:22 cdrtool cdrtool[3219]: Cached 12291 total, 12291 default, 0
> gateway, 0 domain, 0 subscriber destinations
> Nov  9 04:56:22 cdrtool cdrtool[3219]: Cached 0 SIP destinations
> 
> 
> the cdrtool is fine with almost component except the connection to opensips
> the global.inc with define opensips server
> class DB_opensips extends DB_Sql {
> var $Host     = "192.168.1.39";
> var $Database = "opensips";
> var $User     = "opensips";
> var $Password = "sips";
> var $Halt_On_Error = "no";
> }
> 
> and issue the command  grant all on opensips.* to opensips@'192.168.1.%'
> identified by 'sips'; in opensips server
> 
> please help
> 
> Ha`
> 
> 
> 
> 
> 
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
Users at lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



      



More information about the Users mailing list