SIP Witch 1.9.15
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
modules.h
Go to the documentation of this file.
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 
22 #ifndef _SIPWITCH_MODULES_H_
23 #define _SIPWITCH_MODULES_H_
24 
25 #ifndef _UCOMMON_STRING_H_
26 #include <ucommon/string.h>
27 #endif
28 
29 #ifndef __SIPWITCH_VOIP_H_
30 #include <sipwitch/voip.h>
31 #endif
32 
33 #ifndef __SIPWITCH_SERVICE_H_
34 #include <sipwitch/service.h>
35 #endif
36 
37 #ifndef __SIPWITCH_CDR_H_
38 #include <sipwitch/cdr.h>
39 #endif
40 
41 #ifndef _SIPWITCH_CONTROL_H_
42 #include <sipwitch/control.h>
43 #endif
44 
45 #ifndef _SIPWITCH_URI_H_
46 #include <sipwitch/uri.h>
47 #endif
48 
49 namespace sipwitch {
50 
55 class __EXPORT modules
56 {
57 public:
58  typedef enum {REG_FAILED, REG_SUCCESS} regmode_t;
59 
66  class __EXPORT sipwitch : public service::callback
67  {
68  protected:
73  sipwitch();
74 
75  public:
83  virtual void period(long slice);
84 
94  virtual bool announce(MappedRegistry *user, const char *type, const char *event, const char *expires, const char *body);
95 
100  virtual void activating(MappedRegistry *user);
101 
106  virtual void expiring(MappedRegistry *user);
107 
116  virtual void registration(voip::reg_t id, regmode_t reg);
117 
125  virtual bool authenticate(voip::reg_t id, const char *realm);
126 
137  virtual char *referLocal(MappedRegistry *user, const char *target, char *buffer, size_t size);
138 
149  virtual char *referRemote(MappedRegistry *user, const char *target, char *buffer, size_t size);
150  };
151 
159  class __EXPORT generic : public service::callback
160  {
161  protected:
165  generic();
166 
167  public:
174  virtual srv::address *resolve(const char *uri, struct addrinfo *hints);
175  };
176 
183  static void cdrlog(FILE *file, cdr *call);
184 
191  static void errlog(shell::loglevel_t level, const char *text);
192 };
193 
194 } // namespace sipwitch
195 
196 #endif
Some convenience methods for manipulating SIP uri's.
Definition: uri.h:55
Representation of a mapped active user record.
Definition: mapped.h:95
Manipulate address strings.
Basic server call detail record.
A more generic service class for use by plugins.
Definition: modules.h:159
Callback methods for objects managed under the service thread.
Definition: service.h:175
Service configuration and component callbacks.
int reg_t
Definition: voip.h:59
Manage control interface.
Interface class for call detail records.
Definition: cdr.h:56
Common interfaces and clases for plugins.
Definition: modules.h:55
Common base class for sipwitch plugin services.
Definition: modules.h:66