Hi list, I have a couple of questions related to asterisk billing and the generation of cdr logs. I've searched the wiki but have not found my answers, hopefully you guys can help. 1) When are asterisk CDR logs _normally_ generated? When the call arrives, when the call hangs up, or both? I have looked at the records created and it seems to only generate it at the time the call is hung up in order to write the call duration, etc, but I just want to be sure. 2) If in fact it is the case that the CDR entry is written after the call terminates, what would be the best place for me to intercept the handler so that I can write my own CDR log? Because I only need to log certain calls, I was thinking of doing something with FastAGI so that only when certain calls terminate, I would write my custom CDR. 3) Related to the same theme (billing), I have a client who uses the SPA-841. This phone, by default has two lines. When I only configure Line 1, the phone still allows me to make/receive calls on Line 2. For the purposes of billing, I could understand allowing my client for two simultaneous conversations if s/he uses the call waiting feature of Line 1. But by default and without configuring Line 2 on the phone, the customer is able to, potentially, establish 4 simultaneous calls and I'm only billing for one account. Is there a way to restrict the SPA-841 from Asterisk so that I don't depend on Line 2 being disabled on the SPA-841 (which the client could always change)? 4) Because this (item 3) has already happened to me, is there any free tool out there that will allow me to parse the CDR logs in order to determine the maximum number of simultaneous calls that a particular SIP peer has made within a specific timeframe? That way, I could potentially bill the client for 2 accounts instead of 1. Thank you again, Waldo
On 10/10/05 22:30 Waldo Rubinstein said the following:> 1) When are asterisk CDR logs _normally_ generated? When the call > arrives, when the call hangs up, or both? I have looked at the recordswhen the call hangs up.> certain calls, I was thinking of doing something with FastAGI so that > only when certain calls terminate, I would write my custom CDR.you could use the cdr_custom module in CVS head. additionally, asterisk stores cdrs in Master.csv (all calls) as well as separate files based on account code. you could define a specific account code and only parse that file.> customer is able to, potentially, establish 4 simultaneous calls and > I'm only billing for one account. Is there a way to restrict the > SPA-841 from Asterisk so that I don't depend on Line 2 being disabled > on the SPA-841 (which the client could always change)?even if there's one account but 4 calls being made, you'd still see the cdr for all 4 calls. bill according to that.> 4) Because this (item 3) has already happened to me, is there any free > tool out there that will allow me to parse the CDR logs in order to > determine the maximum number of simultaneous calls that a particularyou could limit simultaneous calls using the SetGroup() application. see voip-info.org wiki. -- Regards, /\_/\ "All dogs go to heaven." dinesh@alphaque.com (0 0) http://www.alphaque.com/ +==========================----oOO--(_)--OOo----==========================+ | for a in past present future; do | | for b in clients employers associates relatives neighbours pets; do | | echo "The opinions here in no way reflect the opinions of my $a $b." | | done; done | +=========================================================================+
Dinesh Nair ha scritto:> On 10/10/05 22:30 Waldo Rubinstein said the following: > >> 1) When are asterisk CDR logs _normally_ generated? When the call >> arrives, when the call hangs up, or both? I have looked at the records > > > when the call hangs up.But if you use a "h" extension, at the end of that extension
Have a look at http://astbill.com it is FREE and Open SOURCE. 4) Because this (item 3) has already happened to me, is there any free tool out there that will allow me to parse the CDR logs in order to determine the maximum number of simultaneous calls that a particular SIP peer has made within a specific timeframe? That way, I could potentially bill the client for 2 accounts instead of 1. AstBill is a FREE real time billing engine for Asterisk. By using AstBill to process your Asterisk calls you get real time credit control of your customers. When any SIP or IAX client places a call AstBill will do a credit control. If the account has Sufficient founds to place a call then AstBill will calculate the amount needed for the duration of the call. (By default calls disconnect after max 60 minutes. You can change that.) AstBill will create a record in the MySQL table 'astcreditres' with the uniqueid, user and MAX COST of the call. Next time somebody are using the same account to make a call AstBill will check that there are founds available for the customer and deduct any entry reserved for that customer in the MySQL table 'astcreditres' before AstBill decide the max length of the call the client is allowed to use. The CDR in AstBill have two parts. When the call is initiated the CDR info available is stored in the table 'astcdr'. When the call is terminated the rest of the information about the call is updated in the CDR. The cost of the call is calculated and deducted from the customers balance. The record for reserved founds in 'astcreditres' is deleted There are some advantages to this as it allows us to query the database at any time to know how many calls are currently being processed without using the Asterisk Manager Interface. I hope this is useful information and if you have more questions about AstBill please feel free to use the forums at http://astbill.com/forum/3 Please download AstBill now and have a look. http://astbill.com Are Casilla http://astartelecom.com - Independent VOIP Telecoms Broker. Asterisk and Drupal Consultants http://astbill.com - Billing, Routing and Management software for Asterisk and VOIP AstBill DEMO: http://demo.astbill.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20051011/8471aaf4/attachment.htm