17 #include <sipwitch-config.h>
18 #include <ucommon/ucommon.h>
19 #include <ucommon/export.h>
34 {Conditional::lock();};
37 {Conditional::unlock();};
40 {Conditional::signal();};
49 static Mutex private_lock;
50 static memalloc private_heap;
52 static bool running =
false;
53 static bool down =
false;
54 static bool logging =
false;
67 linked_pointer<cdr> cp;
71 shell::log(
DEBUG1,
"starting cdr thread");
76 Conditional::unlock();
77 shell::log(
DEBUG1,
"stopping cdr thread");
84 if(runlist && logging)
88 Conditional::unlock();
92 private_lock.acquire();
93 cp->enlist(&freelist);
94 private_lock.release();
115 rec->enlist(&runlist);
125 private_lock.acquire();
127 rec = (
cdr *)freelist;
128 freelist = rec->getNext();
129 private_lock.release();
142 private_lock.release();
143 return (
cdr *)(private_heap.zalloc(
sizeof(
cdr)));
Used for definitions of plugin modules.
static cdr * get(void)
Get a free cdr node to fill from the cdr memory pool.
static void start(void)
Start cdr subsystem and que dispatch thread.
static void cdrlog(FILE *file, cdr *call)
Post cdr record to a file.
unsigned cid
Internal call sequence identifiers.
enum sipwitch::cdr::@0 type
Start or end of call?
time_t starting
Time the call was received.
static void post(cdr *cdr)
Post cdr record to callbacks through the cdr thread queue.
char reason[16]
Reason the call was terminated.
Basic server call detail record.
Stream events to local clients.
char joined[MAX_IDENT_SIZE]
Call destination eventually joined to.
char dialed[MAX_IDENT_SIZE]
Destination requested on our switch.
static void stop(void)
Stop cdr subsystem.
char display[MAX_DISPLAY_SIZE]
Display name of calling party.
Service configuration and component callbacks.
char ident[MAX_IDENT_SIZE]
Ident of calling parting.
Manage control interface.
Interface class for call detail records.
static void drop(cdr *rec)
Send call disconnected event to clients from cdr stop record.
unsigned long duration
Total duration of the call in seconds.
char uuid[48]
A unique identifier for each and every call.
static const char * env(const char *id)
Return the value of a server environment variable.
static void connect(cdr *rec)
Send call connection to clients from cdr start record.
char network[MAX_NETWORK_SIZE *2]
Subnet interface the caller appeared on.