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
24 #ifndef _SIPWITCH_MAPPED_H_
25 #define _SIPWITCH_MAPPED_H_
26
27 #ifndef _SIPWITCH_NAMESPACE_H_
29 #endif
30
31 #ifndef _SIPWITCH_VOIP_H_
33 #endif
34
35 #ifndef _SIPWITCH_STATS_H_
37 #endif
38
47 // user and device properties...
48
49 #define USER_PROFILE_DIALABLE 0x0001 // user may be dialed
50 #define USER_PROFILE_REACHABLE 0x0002 // user may be reached by gateway
51 #define USER_PROFILE_INTERNAL 0x0008 // user may use dialing/routing
52 #define USER_PROFILE_SUBSCRIPTIONS 0x0010 // user can subscribe to others
53 #define USER_PROFILE_SUBSCRIBERS 0x0020 // user can be subscribed
54 #define USER_PROFILE_INCOMING 0x1000 // user "name" id may be accessed
55 #define USER_PROFILE_OUTGOING 0x2000 // may use generic uri
56 #define USER_PROFILE_SUPERUSER 0x8000 // has admin flag
57
58 #define USER_PROFILE_ADMIN 0xffff
59 #define USER_PROFILE_LOCAL 0x0fff
60 #define USER_PROFILE_DEVICE 0x0f0f
61 #define USER_PROFILE_SERVICE 0x7f0f
62 #define USER_PROFILE_SYSTEM 0x2f08
63 #define USER_PROFILE_DEFAULT 0x7fff
64 #define USER_PROFILE_RESTRICTED (0)
65
66 #define MAX_NETWORK_SIZE 16 // based on cidr name size...
67 #define MAX_PATTERN_SIZE 16
68 #define MAX_DISPLAY_SIZE 64
69 #define MAX_USERID_SIZE 48
70 #define MAX_IDENT_SIZE (MAX_USERID_SIZE + 50)
71 #define MAX_URI_SIZE 256
72 #define MAX_SDP_BUFFER 1024
73
74 namespace sipwitch {
75
76 #define CALL_MAP "sipwitch.calls"
77 #define REGISTRY_MAP "sipwitch.regs"
78
88
96 {
97 public:
99
108 unsigned ext;
// 0 or extnum
109 unsigned count;
// active regs count
110 volatile unsigned inuse;
// in use for call count
111 sockaddr_internet
contact;
// last/newest created contact registration
113 volatile time_t
expires;
// when registry expires as a whole
115 union {
116 struct { // external registry properties...
117 const char *
identity;
// forced identity string when calling
118 const char *
connect;
// invite uri host identity
121 struct { // internal registry properties
125 } internal;
127
130
133
136
139 };
140
148 {
149 public:
158 };
159
160 } // namespace sipwitch
161
162 #endif
A stat element of call traffic.
#define USER_PROFILE_SUPERUSER
User profiles are used to map features and toll restriction level together under a common identifier...
Representation of a mapped active user record.
sockaddr_internet contact
bool is_profiled(void) const
union sipwitch::MappedRegistry::@6 source
Basic server call statistics.
bool has_feature(unsigned short X) const
GNU SIP Witch library namespace.
Representation of an active call record.
bool is_admin(void) const
struct sipwitch::MappedRegistry::@6::@7 external
enum sipwitch::MappedRegistry::@5 type