usage.c File Reference

#include <osp/osp.h>
#include "../rr/api.h"
#include "../../usr_avp.h"
#include "usage.h"
#include "destination.h"
#include "osptoolkit.h"
#include "sipheader.h"

Include dependency graph for usage.c:

Go to the source code of this file.

Defines

#define OSP_COOKIE_AUTHTIME   'a'
#define OSP_COOKIE_AUTHTIMEUP   'A'
#define OSP_COOKIE_DSTCOUNT   'c'
#define OSP_COOKIE_DSTCOUNTUP   'C'
#define OSP_COOKIE_SRCIP   's'
#define OSP_COOKIE_SRCIPUP   'S'
#define OSP_COOKIE_TRANSID   't'
#define OSP_COOKIE_TRANSIDUP   'T'
#define OSP_COOKIEHAS_AUTHTIME   (1 << 2)
#define OSP_COOKIEHAS_DSTCOUNT   (1 << 3)
#define OSP_COOKIEHAS_ORIGALL   (OSP_COOKIEHAS_TRANSID | OSP_COOKIEHAS_SRCIP | OSP_COOKIEHAS_AUTHTIME | OSP_COOKIEHAS_DSTCOUNT)
#define OSP_COOKIEHAS_SRCIP   (1 << 1)
#define OSP_COOKIEHAS_TERMALL   (OSP_COOKIEHAS_TRANSID | OSP_COOKIEHAS_SRCIP | OSP_COOKIEHAS_AUTHTIME)
#define OSP_COOKIEHAS_TRANSID   (1 << 0)
#define OSP_ORIG_COOKIE   "osp-o"
#define OSP_RELEASE_ORIG   0
#define OSP_RELEASE_TERM   1
#define OSP_TERM_COOKIE   "osp-t"

Functions

static int ospBuildUsageFromDestination (OSPTTRANHANDLE transaction, osp_dest *dest, int lastcode)
void ospRecordOrigTransaction (struct sip_msg *msg, unsigned long long transid, char *uac, char *from, char *to, time_t authtime, unsigned destinationCount)
void ospRecordTermTransaction (struct sip_msg *msg, unsigned long long transid, char *uac, char *from, char *to, time_t authtime)
static void ospRecordTransaction (struct sip_msg *msg, unsigned long long transid, char *uac, char *from, char *to, time_t authtime, int isorig, unsigned destinationCount)
void ospReportOrigSetupUsage (void)
void ospReportTermSetupUsage (void)
int ospReportUsage (struct sip_msg *msg, char *whorelease, char *ignore2)
static int ospReportUsageFromCookie (struct sip_msg *msg, char *cooky, OSPTCALLID *callid, int release, OSPE_MSG_ROLETYPES type)
static int ospReportUsageFromDestination (OSPTTRANHANDLE transaction, osp_dest *dest)

Variables

char * _osp_device_ip
OSPTPROVHANDLE _osp_provider
str OSP_ORIGDEST_NAME
struct rr_binds osp_rr


Define Documentation

#define OSP_COOKIE_AUTHTIME   'a'

Definition at line 54 of file usage.c.

Referenced by ospRecordTransaction(), and ospReportUsageFromCookie().

#define OSP_COOKIE_AUTHTIMEUP   'A'

Definition at line 55 of file usage.c.

Referenced by ospReportUsageFromCookie().

#define OSP_COOKIE_DSTCOUNT   'c'

Definition at line 56 of file usage.c.

Referenced by ospRecordTransaction(), and ospReportUsageFromCookie().

#define OSP_COOKIE_DSTCOUNTUP   'C'

Definition at line 57 of file usage.c.

Referenced by ospReportUsageFromCookie().

#define OSP_COOKIE_SRCIP   's'

Definition at line 52 of file usage.c.

Referenced by ospRecordTransaction(), and ospReportUsageFromCookie().

#define OSP_COOKIE_SRCIPUP   'S'

Definition at line 53 of file usage.c.

Referenced by ospReportUsageFromCookie().

#define OSP_COOKIE_TRANSID   't'

Definition at line 50 of file usage.c.

Referenced by ospRecordTransaction(), and ospReportUsageFromCookie().

#define OSP_COOKIE_TRANSIDUP   'T'

Definition at line 51 of file usage.c.

Referenced by ospReportUsageFromCookie().

#define OSP_COOKIEHAS_AUTHTIME   (1 << 2)

Definition at line 62 of file usage.c.

Referenced by ospReportUsageFromCookie().

#define OSP_COOKIEHAS_DSTCOUNT   (1 << 3)

Definition at line 63 of file usage.c.

Referenced by ospReportUsageFromCookie().

#define OSP_COOKIEHAS_ORIGALL   (OSP_COOKIEHAS_TRANSID | OSP_COOKIEHAS_SRCIP | OSP_COOKIEHAS_AUTHTIME | OSP_COOKIEHAS_DSTCOUNT)

Definition at line 64 of file usage.c.

Referenced by ospReportUsageFromCookie().

#define OSP_COOKIEHAS_SRCIP   (1 << 1)

Definition at line 61 of file usage.c.

Referenced by ospReportUsageFromCookie().

#define OSP_COOKIEHAS_TERMALL   (OSP_COOKIEHAS_TRANSID | OSP_COOKIEHAS_SRCIP | OSP_COOKIEHAS_AUTHTIME)

Definition at line 65 of file usage.c.

Referenced by ospReportUsageFromCookie().

#define OSP_COOKIEHAS_TRANSID   (1 << 0)

Definition at line 60 of file usage.c.

Referenced by ospReportUsageFromCookie().

#define OSP_ORIG_COOKIE   "osp-o"

Definition at line 43 of file usage.c.

Referenced by ospRecordTransaction(), and ospReportUsage().

#define OSP_RELEASE_ORIG   0

Definition at line 46 of file usage.c.

Referenced by ospReportUsage(), and ospReportUsageFromCookie().

#define OSP_RELEASE_TERM   1

Definition at line 47 of file usage.c.

Referenced by ospReportUsage(), and ospReportUsageFromCookie().

#define OSP_TERM_COOKIE   "osp-t"

Definition at line 44 of file usage.c.

Referenced by ospRecordTransaction(), and ospReportUsage().


Function Documentation

static int ospBuildUsageFromDestination ( OSPTTRANHANDLE  transaction,
osp_dest dest,
int  lastcode 
) [static]

void ospRecordOrigTransaction ( struct sip_msg msg,
unsigned long long  transid,
char *  uac,
char *  from,
char *  to,
time_t  authtime,
unsigned  destinationCount 
)

Definition at line 155 of file usage.c.

References ospRecordTransaction().

Referenced by ospPrepareDestination().

void ospRecordTermTransaction ( struct sip_msg msg,
unsigned long long  transid,
char *  uac,
char *  from,
char *  to,
time_t  authtime 
)

Definition at line 178 of file usage.c.

References ospRecordTransaction().

Referenced by ospValidateHeader().

static void ospRecordTransaction ( struct sip_msg msg,
unsigned long long  transid,
char *  uac,
char *  from,
char *  to,
time_t  authtime,
int  isorig,
unsigned  destinationCount 
) [static]

void ospReportOrigSetupUsage ( void   ) 

void ospReportTermSetupUsage ( void   ) 

int ospReportUsage ( struct sip_msg msg,
char *  whorelease,
char *  ignore2 
)

static int ospReportUsageFromCookie ( struct sip_msg msg,
char *  cooky,
OSPTCALLID *  callid,
int  release,
OSPE_MSG_ROLETYPES  type 
) [static]

static int ospReportUsageFromDestination ( OSPTTRANHANDLE  transaction,
osp_dest dest 
) [static]


Variable Documentation

OSPTPROVHANDLE _osp_provider

Definition at line 43 of file destination.c.

struct rr_binds osp_rr

Definition at line 74 of file osp_mod.c.

Referenced by ospInitMod(), and ospRecordTransaction().


Generated on Thu May 24 22:00:45 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6