#ifndef STATISTCI_DATA_H
#define STATISTCI_DATA_H

struct statistic_item
{
	int Attempt;
	int Successful;
	int Failure;
	float Successful_Rate;
	int Total_Bytes;
};

struct call_statistics
{
	struct statistic_item Email_Incoming;
	struct statistic_item Email_Outgoing;
	struct statistic_item SMS_To_SMSC;
	struct statistic_item SMS_From_SMSC;
	unsigned char timeStamp[4];
};

struct cdr 
{
	int Instance_ID;
	int recordType;     //1 received sms, 2 send sms, 3 received email, 4 send email
	int serviceCentre;  //Service number of the UW Gateway
	unsigned char servedMSISDN[32];   //MSISDN
	unsigned char Sender[64];       //MSISDN or Email 
	unsigned char Recipient[64];      //MSISDN or Email 
	int Total_bytes;    //Length of the message
	int Email_Ref_ID;   //Email identification ID
	int Sequence_ID;   //The UW Gateway uses concatenated SMS for long messages. This ID is the sequence number of the concatenated SMS.
	int Result;         //0 = Fail
	int Cause_of_failure;  //Failure cause code
	char Deliver_Time[30];    //Datetime yyyy-mm-dd hh:mm:ss
};

#define Email_Outgoing_Attempt  1 
#define Email_Outgoing_Successful  2
#define Email_Incoming_Attempt    3
#define Email_Incoming_Successful 4
#define SMS_Outgoing_Attempt  5
#define SMS_Outgoing_Successful  6
#define SMS_Incoming_Attempt      7
#define SMS_Incoming_Successful  8
#define Email_Outgoing_Failure   9
#define Email_Incoming_Failure   10
#define SMS_Outgoing_Failure  11
#define SMS_Incoming_Failure  12

void add_call_statistics(int flag, int data_size);

#endif
