Welcome, Guest. Please login or register.
Did you miss your activation email?
September 03, 2010, 10:20:17 AM
Home Help Search Login Register
News: Noojee Receptionist 3.5 Beta 2 released with Asterisk 1.6 support.
See the full details here.

+  Noojee Telephony Solutions Forums
|-+  Noojee Fax
| |-+  General Discussion
| | |-+  How to seperate data/fax call from speachcalls in CDR?
« previous next »
Pages: [1] Print
Author Topic: How to seperate data/fax call from speachcalls in CDR?  (Read 322 times)
kl
Newbie
*
Offline Offline

Posts: 1


« on: February 03, 2010, 09:08:44 PM »

Hello

In our company we have a request to make billing for Aster/Noojee fax.

If we assume that the fax is attached to an asterisk - how do we determin if a specific callrecord is from a "faxcall" in the CDR?

I have read the topic "Modifying asterisk call-files" but that didn't bring me closer to an answer.


Could Somebody please help us out here?

Regards
Kristian
Logged
Brett Sutton
Asterisk IT Staff
Sr. Member
*****
Offline Offline

Posts: 411



« Reply #1 on: February 03, 2010, 09:47:50 PM »

If you want to bill for faxes sent/received have a look at the 'audit.log' file that Noojee Fax creates.

It exists for precisely this purpose.

We also have a commercial addon that can write the audit information to a database and includes some extra information which is often required when writting a fax billing application.


What follows is some of the doco from the JDBC billing module (commercial plugin for Noojee Fax)

JDBC Billing  (JdbcAuditHandler)

The JDBC Billing module provides improved billing information over and above the standard CDR logs that Noojee Fax outputs. The Billing module is designed to output the billing information directly to a database to improve access to the data.

Each time a fax transmission is attempted the following information is written to the database be calling a pre-defined stored procedure.

For each fax sent the following information is recorded:

    * email address of submitter
    * destination phone number
    * number of pages
    * email subject line
    * success or failure
    * transmission start time
    * transmission duration
    * call start time
    * call duration
    * caller id
    * unique fax id
    * account code (specified in NoojeeFax.xml <Template> or from jdbc routing plugin (license fee applies))

 The transmission duration refers to the time from when the system attempts to initiate the call until the call is terminated. The call duration refers to the time from when the remote station answers until the call is terminated.

For each fax received the following information is recorded:

    * DID number
    * delivery email address (semi colon delimited list)
    * number of pages
    * remote station id
    * caller id
    * unique fax id
    * date and time received

Sample NoojeeFax configuration:

        <TxFax>
            <MaxRetries>1</MaxRetries>
            <Priority>1</Priority>
            <RetryTime>40</RetryTime>
            <WaitTime>60</WaitTime>
            <Timeout>60</Timeout>
            <Debug>true</Debug>

            <Handlers>
                <Handler>
                    <Name>some other handler</Name>
                    <Arguments></Arguments>
                </Handler>
                <Handler>
                    <Name>au.com.noojee.noojeefax.handler.JdbcAuditHandler</Name>
                    <Arguments>com.mysql.jdbc.Driver,jdbc:mysql://database_server/billing_db,user,password,tx,call faxSent</Arguments>
                </Handler>
                <Handler>
                    <Name>some other handler</Name>
                    <Arguments></Arguments>
                </Handler>
            </Handlers>
        </TxFax>

        <RxFax>
            <Handlers>
                <Handler>
                    <Name>some other handler</Name>
                    <Arguments></Arguments>
                </Handler>
                <Handler>
                    <Name>au.com.noojee.noojeefax.handler.JdbcAuditingHandler</Name>
                    <Arguments>com.mysql.jdbc.Driver,jdbc:mysql://database_server/billing_db,user,password,rx,call faxReceived</Arguments>
                </Handler>
            </Handlers>
        </RxFax>

Arguments to the JdbcAudithandler are in the following format:

class,url,user,password,mode,stored_proc_command

where:

    * class - the name of the JDBC driver class
    * url - the JDBC URL
    * user - the database account user name
    * password - the database account password
    * mode - is either tx or rx
    * stored_proc_command - the database command to invoke a stored proc that updates the billing tables
    *  Note that the relevant JDBC drivers for the billing database must be in the NoojeeFax class path and must be added to the NoojeeFax.jar manifest.

IMPORTANT NOTE: The Audit handler must be configured in the list of handlers after any routing handler. It's most likely best to ensure it is the last handler in the list. The reason for this is that the handlers are chained and as each handler processes the fax it provides data for subsequent handlers. The audit handler for inbound faxes requires that the fax is routed via email to the recipients before the audit handler is invoked so that the list of email recipients is available.

Sample script to prepare database for audit entries:

create table FaxTransmitLog (Submitter char(40), FaxNumber char(25), PageCount int, Subject char(120), Success tinyint,
                                              TransmitStartTime datetime, TransmitDuration int, CallStartTime datetime, CallDuration int, CallerID char(25),
                                              FaxId bigint, AccountCode char(140));

delimiter $$
create procedure faxSent(Submitter char(40), FaxNumber char(25), PageCount int, Subject char(120), Success tinyint,
                                        TransmitStartTime datetime, TransmitDuration int, CallStartTime datetime, CallDuration int, CallerID char(25),
                                        FaxId bigint, AccountCode char(140))
BEGIN
  insert into FaxTransmitLog (Submitter, FaxNumber, PageCount, Subject, Success, TransmitStartTime, TransmitDuration, CallStartTime,
                                          CallDuration, CallerID, FaxId, AccountCode) values (Submitter, FaxNumber, PageCount, Subject, Success,
                                          TransmitStartTime, TransmitDuration, CallStartTime, CallDuration, CallerID, FaxId, AccountCode);
END
$$

delimiter ;
create table FaxReceivedLog (DID char(25), Recipients varchar(512), PageCount int, RemoteStationId char(80), CallerId char(25), FaxId bigint, ReceivedTime datetime);

delimiter $$
create procedure faxReceived(DID char(25), Recipients varchar(512), PageCount int, RemoteStationId char(80), CallerId char(25), FaxId bigint, ReceivedTime datetime)
BEGIN
  insert into FaxReceivedLog (DID,  Recipients, PageCount, RemoteStationId, CallerId, FaxId, ReceivedTime) values (DID, Recipients, PageCount, RemoteStationId, CallerId, FaxId, ReceivedTime);
END
$$

Logged
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!