1 // Copyright (C) 2006-2014 David Sugar, Tycho Softworks.
2 // Copyright (C) 2015 Cherokees of Idaho.
3 //
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17 #include <sipwitch-config.h>
18 #include <ucommon/ucommon.h>
19 #include <ucommon/export.h>
22 #include <ctype.h>
23 #include <errno.h>
24 #include <stdarg.h>
25 #include <stdio.h>
26 #include <stdlib.h>
27
28 namespace sipwitch {
29
32 {
33 }
34
37 {
38 }
39
41 {
42 return NULL;
43 }
44
46 {
47 }
48
50 {
51 }
52
54 {
55 }
56
58 {
59 return false;
60 }
61
63 {
64 }
65
67 {
68 return false;
69 }
70
72 {
73 return NULL;
74 }
75
77 {
78 return NULL;
79 }
80
82 {
84
85 while(is(cb)) {
86 cb->errlog(level, text);
87 cb.next();
88 }
89 }
90
92 {
94 const char *buf = dt.c_str();
95
97 shell::debug(1, "call %08x:%u %s %s %s %ld %s %s %s %s",
100 }
101
103
104 while(is(cb)) {
105 cb->cdrlog(call);
106 cb.next();
107 }
108
110 return;
111
112 fprintf(fp, "%08x:%u %s %s %s %ld %s %s %s %s\n",
115 }
116
117 } // end namespace
118
Used for definitions of plugin modules.
Some convenience methods for manipulating SIP uri's.
virtual bool announce(MappedRegistry *user, const char *type, const char *event, const char *expires, const char *body)
Announce a SIP publish event from a registered user to plugins.
virtual void expiring(MappedRegistry *user)
Notify plugins a user registration has been expired or released.
static void cdrlog(FILE *file, cdr *call)
Post cdr record to a file.
Representation of a mapped active user record.
unsigned cid
Internal call sequence identifiers.
virtual void registration(voip::reg_t id, regmode_t reg)
Notify plugins about reply messages from external registrations.
enum sipwitch::cdr::@0 type
Start or end of call?
time_t starting
Time the call was received.
virtual char * referLocal(MappedRegistry *user, const char *target, char *buffer, size_t size)
Enables plugin to redirect locally dialed destination to new uri.
static LinkedObject * getModules(void)
generic()
Construct a generic service instance.
char reason[16]
Reason the call was terminated.
sipwitch()
Create a service instance and add to runtime list of services to start and stop.
static void errlog(shell::loglevel_t level, const char *text)
Module access to error logging system.
char joined[MAX_IDENT_SIZE]
Call destination eventually joined to.
char dialed[MAX_IDENT_SIZE]
Destination requested on our switch.
virtual void period(long slice)
Period service request.
char display[MAX_DISPLAY_SIZE]
Display name of calling party.
char ident[MAX_IDENT_SIZE]
Ident of calling parting.
System configuration instance and service functions.
Manage control interface.
virtual srv::address * resolve(const char *uri, struct addrinfo *hints)
New srv resolver plugin.
Interface class for call detail records.
virtual void activating(MappedRegistry *user)
Notify plugins a user registration is being activated.
unsigned long duration
Total duration of the call in seconds.
virtual bool authenticate(voip::reg_t id, const char *realm)
Used to verify authentication of a registered session.
virtual char * referRemote(MappedRegistry *user, const char *target, char *buffer, size_t size)
Enables plugin to remap users dialing remote destinations.
char network[MAX_NETWORK_SIZE *2]
Subnet interface the caller appeared on.