1
0
Fork 0
mbuni/mbuni/mmsbox/mmsbox_cdr.h

74 lines
1.8 KiB
C

/*
* Mbuni - Open Source MMS Gateway
*
* Mbuni billing integration interface
*
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
*
* Paul Bagyenda <bagyenda@dsmagic.com>
*
* This program is free software, distributed under the terms of
* the GNU General Public License, with a few exceptions granted (see LICENSE)
*/
#ifndef __MMSBOX_CDR_INCLUDED__
#define __MMSBOX_CDR_INCLUDED__
#include <time.h>
#include "gwlib/gwlib.h"
/* MMSBOX CDR module. This file provides prototypes for all CDR functions.
*
*/
#define CBUFSIZE 256
typedef struct MmsBoxCdrStruct {
time_t sdate;
char from[CBUFSIZE];
char to[CBUFSIZE];
#if 0
char src_ip[CBUFSIZE/4];
char dest_ip[CBUFSIZE/4];
#endif
char msgid[CBUFSIZE];
char mmsc_id[CBUFSIZE];
char src_int[CBUFSIZE/4];
char dst_int[CBUFSIZE/4];
unsigned long msg_size;
char msgtype[CBUFSIZE/8];
char prio[CBUFSIZE/8];
char mclass[CBUFSIZE/8];
char status[CBUFSIZE/8];
unsigned char dlr;
unsigned char rr;
} MmsBoxCdrStruct;
typedef struct MmsBoxCdrFuncStruct {
/* This function is called once to initialise the module. Return 0 on success */
int (*init)(char *settings);
/* This function logs a cdr to wherever it is logging to. */
int (*logcdr)(MmsBoxCdrStruct *cdr);
int (*cleanup)(void);
} MmsBoxCdrFuncStruct;
extern MmsBoxCdrFuncStruct mmsbox_cdrfuncs; /* The module must expose a symbol 'cdr_funcs' */
/* utility function. */
void mmsbox_fill_cdr_struct(MmsBoxCdrStruct *cdr,
time_t sdate, char *from, char *to, char *msgid,
char *mmsc_id, char *src_int, char *dst_int,
#if 0
char *src_ip, char *dst_ip,
#endif
unsigned long msg_size,
char *msgtype, char *prio, char *mclass,
char *status,
int dlr, int rr);
#endif