1
0
Fork 0
mbuni/mbuni/mmlib/mms_billing.h

43 lines
1.4 KiB
C

#ifndef __MMS_BILLING_INCLUDED__
#define __MMS_BILLING_INCLUDED__
#include <time.h>
#include "gwlib/gwlib.h"
/* Billing and CDR module. This file provides prototypes for all billing functions.
* The idea is that for each site a DSO will be created that the mmsglobalsender loads and gets
* from functions to do billing. This .h file provides prototypes for these functions.
* It has an attendant function to provide basic biller and CDR functions
*/
#define CBUFSIZE 256
typedef struct MmsCdrStruct {
void *module_data;
time_t sdate;
char from[CBUFSIZE];
char to[CBUFSIZE];
char msgid[CBUFSIZE];
unsigned long msg_size;
} MmsCdrStruct;
typedef struct MmsBillingFuncStruct {
/* This function is called once to initialise the billing module. Return a generic object,
* which is passed with each CDR.
*/
void *(*mms_billingmodule_init)(char *settings);
/* This function logs a cdr to wherever it is logging to. */
int (*mms_logcdr)(MmsCdrStruct *cdr);
/* Bills a message. Returns >= 0 if billed ok, -1 if message should be rejected,
* -2 on internal (temporary) error.
*/
double (*mms_billmsg)(Octstr *from, List *to, unsigned long msg_size, void *module_data);
int (*mms_billingmodule_fini)(void *module_data);
} MmsBillingFuncStruct;
extern MmsBillingFuncStruct mms_billfuncs; /* The module must expose this symbol. */
#endif