SIP Witch 1.9.15
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
server.h
Go to the documentation of this file.
1 // Copyright (C) 2006-2010 David Sugar, Tycho Softworks.
2 //
3 // This program is free software; you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation; either version 3 of the License, or
6 // (at your option) any later version.
7 //
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with this program. If not, see <http://www.gnu.org/licenses/>.
15 
16 #undef HAVE_CONFIG_H
17 
18 #include <sipwitch-config.h>
19 #include <sipwitch/sipwitch.h>
20 #include <ucommon/secure.h>
21 
22 #ifdef HAVE_SYSTEMD
23 #include <systemd/sd-daemon.h>
24 #endif
25 
26 #ifdef WIN32
27 #undef alloca
28 #endif
29 
30 #include <cctype>
31 #include <new>
32 
33 #define SECOND_TIMEOUT (1000l)
34 #define MINUTE_TIMEOUT (SECOND_TIMEOUT * 60l)
35 #define HOUR_TIMEOUT (MINUTE_TIMEOUT * 60l)
36 #define DAY_TIMEOUT (HOUR_TIMEOUT * 24l)
37 
38 namespace sipwitch {
39 
40 #define PAGING_SIZE (2048l * sizeof(void *))
41 
42 #define ALLOWS_INVITE 0x0001
43 #define ALLOWS_MESSAGE 0x0002
44 #define ALLOWS_DEFAULT 0x0003
45 
46 class thread;
47 
49 
50 class __LOCAL digests
51 {
52 public:
53  static void reload(void);
54 
55  static const char *get(const char *id);
56 
57  static bool set(const char *id, const char *hash);
58 
59  static void release(const char *hash);
60 
61  static void load(void);
62 };
63 
64 class __LOCAL registry : private service::callback, private mapped_array<MappedRegistry>
65 {
66 public:
67  class __LOCAL mapped : public MappedRegistry
68  {
69  public:
70  void update(Socket::address& addr, int changed);
71  void update(void);
72  bool expire(Socket::address& addr);
73  bool refresh(Socket::address& addr, time_t expires, const char *target_contact);
74  unsigned setTargets(Socket::address& addr, voip::context_t context);
75  unsigned addTarget(Socket::address& via, time_t expires, const char *contact, const char *policy, struct sockaddr *peer, voip::context_t context);
76  unsigned setTarget(Socket::address& via, time_t expires, const char *contact, const char *policy, struct sockaddr *peer, voip::context_t context);
77  void addContact(const char *id);
78  void addPublished(const char *id);
79  void addRoute(const char *pat, unsigned pri, const char *prefix, const char *suffix);
80  };
81 
82  class __LOCAL pointer
83  {
84  private:
86 
87  public:
88  pointer();
89  pointer(const char *id);
90  pointer(pointer const &copy);
91  ~pointer();
92 
93  void operator=(mapped *ptr);
94 
95  inline operator bool() const
96  {return entry != NULL;}
97 
98  inline bool operator!() const
99  {return entry == NULL;}
100 
101  inline mapped *operator->() const
102  {return entry;}
103 
104  inline mapped *operator*() const
105  {return entry;}
106  };
107 
108  class __LOCAL target : public LinkedObject
109  {
110  public:
111  typedef enum {READY, BUSY, AWAY, DND, OFFLINE, UNKNOWN} status_t;
112  // internal hidden address indexing object
113  class indexing : public LinkedObject
114  {
115  public:
116  struct sockaddr *address;
118  target *getTarget(void);
119  } index;
120  struct sockaddr_internet address;
121  struct sockaddr_storage peering;
123 
124  time_t created;
126  volatile time_t expires;
127  unsigned long allows;
128  char contact[MAX_URI_SIZE];
129  char network[MAX_NETWORK_SIZE];
130 
131  static void *operator new(size_t size);
132  static void operator delete(void *ptr);
133  };
134 
135  class __LOCAL pattern : public LinkedObject
136  {
137  public:
139  unsigned priority;
140  char text[MAX_USERID_SIZE];
141  char prefix[MAX_USERID_SIZE];
142  char suffix[MAX_USERID_SIZE];
143  };
144 
145 private:
146  class __LOCAL route : public LinkedObject
147  {
148  public:
150 
151  static void *operator new(size_t size);
152  static void operator delete(void *ptr);
153  };
154 
155  bool check(void);
156  void reload(service *cfg);
157  void start(service *cfg);
158  void stop(service *cfg);
159  void snapshot(FILE *fp);
160 
161  static void clear(mapped *rr);
162  static void expire(mapped *rr);
163  static mapped *find(const char *id);
164 
165  static registry reg;
166 
167  volatile time_t expires;
168 
169  char * volatile digest;
170  char * volatile realm;
171  unsigned prefix;
172  unsigned range;
173  unsigned routes;
174 
175 public:
176  registry();
177 
178  inline static const char *getRealm(void)
179  {return (const char *)reg.realm;}
180 
181  inline static const char *getDigest(void)
182  {return (const char *)reg.digest;}
183 
184  inline static time_t getExpires(void)
185  {return reg.expires;}
186 
187  inline static unsigned getPrefix(void)
188  {return reg.prefix;}
189 
190  inline static unsigned getRange(void)
191  {return reg.range;}
192 
193  inline static unsigned getRoutes(void)
194  {return reg.routes;}
195 
196  static const char *getDomain(void);
197  static void incUse(mapped *rr, stats::stat_t stat);
198  static void decUse(mapped *rr, stats::stat_t stat);
199  static unsigned getEntries(void);
200  static unsigned getIndex(mapped *rr);
201  static bool isExtension(const char *id);
202  static bool isUserid(const char *id);
203  static mapped *address(const struct sockaddr *addr);
204  static mapped *contact(const char *uri);
205  static mapped *contact(const struct sockaddr *addr, const char *uid);
206  static mapped *getExtension(const char *id);
207  static mapped *allocate(const char *id);
208  static mapped *access(const char *id);
209  static mapped *invite(const char *id, stats::stat_t stat);
210  static mapped *dialing(const char *id);
211  static bool exists(const char *id);
212  static pattern *getRouting(unsigned trs, const char *id);
213  static void detach(mapped *m);
214  static bool remove(const char *id);
215  static unsigned cleanup(time_t period);
216 };
217 
218 class __LOCAL stack : public service::callback, private mapped_array<MappedCall>, public OrderedIndex
219 {
220 private:
221  friend class proxy;
222  friend class thread;
223  friend class messages;
224  friend class media;
225 
226  class call;
227 
228  class __LOCAL background : public DetachedThread, public Conditional
229  {
230  public:
231  static void create(timeout_t interval);
232  static void cancel(void);
233 
235 
236  static void notify(void);
237 
238  private:
239  bool cancelled;
240  bool signalled;
241  timeout_t interval;
242  Timer expires;
243 
244  background(timeout_t sync);
245  void run(void);
246  };
247 
248  class __LOCAL session : public LinkedObject
249  {
250  public:
256  time_t activates;
257  uint32_t sequence;
259  time_t expires; // session/invite expires...
260  time_t ringing; // ring no-answer timer...
261  bool closed;
262 
263  enum {OPEN, CLOSED, RING, BUSY, REORDER, REFER, REINVITE} state;
264 
265  char sdp[MAX_SDP_BUFFER]; // sdp body to use in exchange
266  char identity[MAX_URI_SIZE]; // our effective contact/to point...
267  char sysident[MAX_IDENT_SIZE]; // ident of this session
268  char display[MAX_DISPLAY_SIZE]; // callerid reference field
269  char network[MAX_NETWORK_SIZE]; // network policy affinity for nat
270  char from[MAX_URI_SIZE + MAX_DISPLAY_SIZE]; // formatted from line for endpoint
271  char uuid[48];
272 
273  LinkedObject *nat; // media nat chain...
274  struct sockaddr_storage peering;
275 
276  char authid[MAX_USERID_SIZE]; // for authentication...
277  char secret[MAX_USERID_SIZE];
278  enum {NONE, DIGEST} authtype;
279 
280  inline bool isSource(void) const
281  {return (this == parent->source);}
282 
283  inline bool isTarget(void) const
284  {return (this == parent->target);}
285  };
286 
287  class __LOCAL segment : public OrderedObject
288  {
289  public:
290  segment(voip::context_t context, call *cr, voip::call_t cid, voip::did_t did = -1, voip::tid_t tid = 0);
291 
292  static void *operator new(size_t size);
293  static void operator delete(void *obj);
294 
296 
297  inline session *get(void)
298  {return &sid;}
299  };
300 
301  class __LOCAL call : public LinkedList
302  {
303  public:
304  typedef enum {INITIAL, TRYING, RINGING, RINGBACK, REORDER, HOLDING, ANSWERED, JOINED, TRANSFER, REDIRECT, BUSY, TERMINATE, FAILED, FINAL} state_t;
305 
306  enum {DIRECTED, CIRCULAR, TERMINAL, REDIRECTED, DISTRIBUTED} mode;
307 
309 
310  call();
311 
312  Timer timer;
314  char forward[MAX_USERID_SIZE]; // ref id for forwarding...
315  char divert[MAX_USERID_SIZE]; // used in forward management
316  char dialed[MAX_IDENT_SIZE]; // user or ip address...
317  char subject[MAX_URI_SIZE]; // call subject
318  char request[MAX_URI_SIZE]; // requesting identity for refer flip
319 
320  void disarm(void);
321  void arm(timeout_t timeout);
322  void reply_source(int error);
323  void ring(thread *thread, session *s = NULL);
324  void busy(thread *thread, session *s = NULL);
325  void failed(thread *thread, session *s);
326  void answer(thread *thread, session *s);
327  void relay(thread *thread, session *s);
328  void message_reply(thread *thread, session *s);
329  void reinvite(thread *thread, session *s);
330  void trying(thread *thread);
331  void confirm(thread *thread, session *s);
332  timeout_t getTimeout(void);
333  void closingLocked(session *s);
334  void terminateLocked(void);
335  void disconnectLocked(void);
336  void joinLocked(session *s);
337  void cancelLocked(void);
338  cdr *log(void);
339  void bye(thread *thread, session *s);
340  void set(state_t state, char id, const char *text);
341 
342  OrderedIndex segments;
343  const char *reason;
344  const char *joined;
349  const char *forwarding;
350  const char *diverting;
351  unsigned answering; // answer ring supervision...
352  unsigned count; // total open segments
353  unsigned invited; // pending segments with invites
354  unsigned ringing; // number of ringing segments
355  unsigned ringbusy; // number of busy segments
356  unsigned unreachable; // number of unreachable segments
357  time_t expires, starting, ending;
358  int experror; // error at expiration...
359  bool phone;
360 
361  static void *operator new(size_t size);
362  static void operator delete(void *obj);
363 
364  private:
365  void expired(void);
366  };
367 
368  void reload(service *cfg);
369  void start(service *cfg);
370  void stop(service *cfg);
371  void snapshot(FILE *fp);
372  bool check(void);
373 
374  static void divert(stack::call *cr, voip::msg_t msg);
375 
376  unsigned threading, priority;
377  size_t stacksize;
378 
379  volatile int timing;
380 
381  const char *volatile localnames;
382  const char *volatile restricted;
383  const char *volatile trusted;
384  const char *volatile published;
385  const char *volatile proxy;
386  const char *iface;
387  String agent;
388  String system;
389  String anon;
390  bool incoming, outgoing, dumping;
391  int send101;
392  timeout_t ring_timer, cfna_timer, reset_timer;
393  unsigned invite_expires;
394 
395  void release(void);
396 
397 public:
398  static stack sip;
399 
400  class __LOCAL subnet : public cidr
401  {
402  private:
403  char netname[MAX_NETWORK_SIZE];
404  bool active;
405 
406  public:
407  subnet(cidr::policy **acl, const char *rule, const char *name);
408 
409  struct sockaddr_storage iface;
410 
411  const char *getId(void)
412  {return netname;}
413 
414  inline struct sockaddr *getInterface(void)
415  {return (struct sockaddr *)&iface;}
416 
417  inline operator bool()
418  {return active;}
419 
420  inline bool operator!()
421  {return !active;}
422 
423  inline void up(void)
424  {active = true;}
425 
426  inline void down(void)
427  {active = false;}
428 
429  inline bool offline(void)
430  {return active == false;}
431  };
432 
433  stack();
434 
435  static const char *getScheme(void);
436  static void getInterface(struct sockaddr *iface, const struct sockaddr *dest);
437  static session *create(voip::context_t context, voip::call_t cid, voip::did_t did, voip::tid_t tid);
438  static session *create(voip::context_t context, call *cr, voip::call_t cid);
439  static void destroy(session *s);
440  static void destroy(call *cr);
441  static void disjoin(call *cr);
442  static void detach(session *s);
443  static void clear(session *s);
444  static void close(session *s);
445  static session *access(voip::call_t cid);
446  static char *sipAddress(struct sockaddr_internet *addr, char *buf, const char *user = NULL, size_t size = MAX_URI_SIZE);
447  static char *sipPublish(struct sockaddr_internet *addr, char *buf, const char *user = NULL, size_t size = MAX_URI_SIZE);
448  static char *sipContact(struct sockaddr_internet *addr, char *buf, const char *user = NULL, const char *display = NULL, size_t size = MAX_URI_SIZE);
449  static Socket::address *getAddress(const char *uri, Socket::address *addr = NULL);
450  static void siplog(voip::msg_t msg);
451  static void enableDumping(void);
452  static void clearDumping(void);
453  static void disableDumping(void);
454  static void refer(session *session, voip::event_t sevent);
455  static void infomsg(session *session, voip::event_t sevent);
456  static void setDialog(session *session, voip::did_t did);
457  static int getDialog(session *session);
458  static void release(MappedCall *map);
459  static MappedCall *get(void);
460  static bool forward(stack::call *cr);
461  static int inviteRemote(stack::session *session, const char *uri, const char *digest = NULL);
462  static int inviteLocal(stack::session *session, registry::mapped *rr, destination_t dest);
463 
464  inline static timeout_t ringTimeout(void)
465  {return stack::sip.ring_timer;}
466 
467  inline static timeout_t cfnaTimeout(void)
468  {return stack::sip.cfna_timer;}
469 
470  inline static timeout_t resetTimeout(void)
471  {return stack::sip.reset_timer;}
472 
473  inline static unsigned inviteExpires(void)
474  {return stack::sip.invite_expires;}
475 };
476 
477 class __LOCAL server : public service
478 {
479 private:
480  typedef linked_value<profile_t, LinkedObject> profile;
481 
482  cidr::policy *acl;
483  keynode **extmap;
484  keynode *provision;
486 
487  bool create(const char *id, keynode *node);
488  keynode *find(const char *id);
489 
490  void confirm(void);
491  void dump(FILE *fp);
492 
493 public:
494  static shell::logmode_t logmode;
495  static unsigned uid;
496  static const char *sipusers;
497  static const char *sipadmin;
498  static int exit_code;
499 
500  server(const char *id);
501 
502  static bool check(void);
503  static profile_t *getProfile(const char *id);
504  static keynode *getRouting(const char *id);
505  static void getProvision(const char *id, usernode& user);
506  static void getDialing(const char *id, usernode& user);
507  static keynode *getConfig(void);
508  static void listPolicy(FILE *fp);
509  static stack::subnet *getPolicy(const struct sockaddr *addr);
510  static stack::subnet *getSubnet(const char *id);
511  static bool isLocal(const struct sockaddr *addr);
512  static void release(stack::subnet *access);
513  static void release(keynode *node);
514  static void release(usernode& user);
515  static void reload(void);
516  static Socket::address *getContact(const char *id);
517  static void plugins(const char *argv0, const char *names);
518  static void run(void);
519  static void stop(void);
520  static void *allocate(size_t size, LinkedObject **list, volatile unsigned *count = NULL);
521  static unsigned allocate(void);
522 
523  static bool announce(MappedRegistry *rr, const char *msgtype, const char *event, const char *expires, const char *body);
524  static void activate(MappedRegistry *rr);
525  static void expire(MappedRegistry *rr);
526  static void logging(MappedRegistry *rr, const char *reason);
527  static void registration(voip::reg_t id, modules::regmode_t mode);
528  static bool authenticate(voip::reg_t id, const char *realm);
529  static const char *referLocal(MappedRegistry *rr, const char *target, char *buffer, size_t size);
530  static const char *referRemote(MappedRegistry *rr, const char *target, char *buffer, size_t size);
531  static bool checkId(const char *id);
532  static void printlog(const char *fmt, ...) __PRINTF(1, 2);
533 };
534 
535 class __LOCAL messages : public service::callback
536 {
537 private:
538  class __LOCAL message : public LinkedObject
539  {
540  public:
541  time_t expires;
542  char user[MAX_USERID_SIZE];
543  char type[64];
544  char from[MAX_URI_SIZE];
545  char body[1024];
546  char reply[MAX_USERID_SIZE];
547  int msglen;
548  void create();
549  };
550 
552 
553  bool check(void);
554  void reload(service *cfg);
555  void cleanup(void);
556  void snapshot(FILE *fp);
557 
558  static int deliver(message *msg);
559  static int remote(const char *to, message *msg, const char *digest = NULL);
560 
561 public:
562  messages();
563 
564  static void automatic(void);
565  static void update(const char *userid);
566  static int deliver(const char *to, const char *reply, const char *from, caddr_t body, size_t size, const char *msgtype, const char *digest = NULL);
567  static int system(const char *to, const char *message);
568 };
569 
570 
571 class __LOCAL thread : private DetachedThread
572 {
573 private:
574  friend class stack;
575  friend class stack::call;
576 
577  const char *instance;
578  unsigned extension;
580  char network[MAX_NETWORK_SIZE];
581  struct sockaddr_storage peering;
588  bool activated;
589  char binding[MAX_URI_SIZE];
590  char buffer[MAX_URI_SIZE];
591  char buftemp[MAX_URI_SIZE];
592  char identbuf[MAX_USERID_SIZE + 12];
593  char identity[MAX_USERID_SIZE];
594  char dialing[MAX_USERID_SIZE];
595  char display[MAX_DISPLAY_SIZE];
596  char requesting[MAX_URI_SIZE];
597  Socket::address via_address, request_address, contact_address;
605  const char *via_host, *contact_host;
606  unsigned via_hops;
607  unsigned via_port, from_port, contact_port;
610 
611  char *sip_realm;
614 
615  enum {CALL, MESSAGE, REGISTRAR, NONE} authorizing;
616 
617  thread(voip::context_t ctx, const char *tag);
618 
619  static void wait(unsigned count);
620  static const char *eid(eXosip_event_type ev);
621 
622  void send_reply(int error);
623  void expiration(void);
624  void invite(void);
625  void identify(void);
626  bool getsource(void);
627  bool unauthenticated(void);
628  bool authenticate(void);
629  bool authenticate(stack::session *session);
630  bool authorize(void);
631  void registration(void);
632  void validate(void);
633  void message(void);
634  void publish(void);
635  void reregister(const char *contact, time_t interval);
636  void deregister(void);
637  void challenge(void);
638  void options(void);
639  void run(void);
640  void getDevice(registry::mapped *rr);
641  const char *getIdent(void);
642 
643 public:
644  static void shutdown(void);
645 };
646 
647 // media proxy support for NAT transversal is being moved to here...
648 class __LOCAL media : public service::callback
649 {
650 public:
651  // support thread
652  class __LOCAL thread : public DetachedThread
653  {
654  public:
655  static void startup(void);
656 
657  static void notify(void);
658 
659  static void shutdown(void);
660 
661  private:
662  thread();
663 
664  void run(void);
665  };
666 
667  // a support class to help in sdp parsing
668  class __LOCAL sdp
669  {
670  public:
671  const char *bufdata;
672  char *outdata, *result;
673  size_t buflen, outpos;
674  struct sockaddr *peering;
675  struct sockaddr_storage local, top;
677  unsigned mediacount;
678  unsigned short mediaport;
679 
680  sdp();
681  sdp(const char *source, char *target, size_t len = MAX_SDP_BUFFER);
682 
683  inline struct sockaddr *get(void)
684  {return (struct sockaddr *)&local;}
685 
686  void set(const char *source, char *target, size_t len = MAX_SDP_BUFFER);
687  char *get(char *buffer, size_t len);
688  size_t put(char *buffer);
689 
690  // check connect in sdp output
691  void check_connect(char *buffer, size_t len);
692  void check_media(char *buffer, size_t len);
693 
694  // can do backfill of NAT if connect in media record
695  void reconnect(void);
696  };
697 
698  // proxy socket class
699  class __LOCAL proxy : public LinkedObject
700  {
701  private:
702  void release(void);
703 
704  public:
705  socket_t so;
706  time_t expires;
707  uint16_t port;
708  struct sockaddr_storage local, remote, peering;
709  bool fw; // to be used when we add ipfw rules support
710 
711  proxy();
712  ~proxy();
713 
714  bool activate(media::sdp *parser);
715  void release(time_t expire = 0l);
716  void reconnect(struct sockaddr *address);
717  void copy(void);
718  };
719 
720  media();
721 
722  void start(service *cfg);
723  void stop(service *cfg);
724  void reload(service *cfg);
725 
726  // get and activate nat instance if any are free...
727  static proxy *get(media::sdp *parser);
728 
729  // set ipv6 flag, removes need to proxy any external addresses...
730  static void enableIPV6(void);
731 
732  // release any existing media proxy for the call session, proxy can be kept active for re-invite transition
733  static void release(LinkedObject **nat, unsigned expires = 0);
734 
735  // rewrite an invite for a call target if different, otherwise uses original source sdp...
736  static char *invite(stack::session *session, const char *target, LinkedObject **nat, char *sdp, size_t size = MAX_SDP_BUFFER);
737 
738  // rewrite or copy sdp of session on answer for connection
739  static char *answer(stack::session *session, const char *sdp);
740 
741  // re-assign or copy sdp on re-invite; clears and rebuilds media proxy if needed...
742  static char *reinvite(stack::session *session, const char *sdp);
743 
744 private:
745  // low level rewrite & proxy assignment
746  static char *rewrite(media::sdp *parser);
747 
748  // see if connected directly or if requires proxy
749  static bool isProxied(const char *source, const char *target, struct sockaddr_storage *peering);
750 
751  void release(void);
752 };
753 
754 class __LOCAL history : public OrderedObject, public control
755 {
756 public:
757  char text[128];
758 
759  history(shell::loglevel_t lid, const char *msg);
760 
761  void set(shell::loglevel_t lid, const char *msg);
762 
763  static void add(shell::loglevel_t lid, const char *msg);
764  static void set(unsigned size);
765  static void out(void);
766 };
767 
768 #ifdef HAVE_SIGWAIT
769 
770 class __LOCAL psignals : private JoinableThread
771 {
772 private:
773  bool shutdown;
774  bool started;
775 
776  sigset_t sigs;
777 
778  void run(void);
779  void cancel(void);
780 
781  psignals();
782  ~psignals();
783 
784  static psignals thread;
785 
786 public:
787  static void service(const char *name);
788  static void setup(void);
789  static void start(void);
790  static void stop(void);
791 };
792 
793 #else
794 class __LOCAL psignals
795 {
796 public:
797  static void service(const char *name);
798  static void setup(void);
799  static void start(void);
800  static void stop(void);
801 };
802 #endif
803 
804 #ifdef HAVE_SYS_INOTIFY_H
805 
806 class __LOCAL notify : private JoinableThread
807 {
808 private:
809  notify();
810 
811  ~notify();
812 
813  void run(void);
814 
815  static notify thread;
816 
817 public:
818  static void start(void);
819  static void stop(void);
820 };
821 
822 #else
823 
824 class __LOCAL notify
825 {
826 public:
827  static void start(void);
828  static void stop(void);
829 };
830 
831 #endif
832 
833 } // namespace sipwitch
834 
linked_value< profile_t, LinkedObject > profile
Definition: server.h:480
Structure for SIP Message (REQUEST and RESPONSE).
Definition: osip_message.h:55
static const char * sipusers
Definition: server.h:496
Some convenience methods for manipulating SIP uri's.
Definition: uri.h:55
voip::proxyauth_t proxy_auth
Definition: server.h:612
unsigned count
Definition: cgiserver.cpp:92
unsigned long allows
Definition: server.h:127
static unsigned getRoutes(void)
Definition: server.h:193
static timeout_t ringTimeout(void)
Definition: server.h:464
registry::mapped * reginfo
Definition: server.h:585
volatile time_t expires
Definition: server.h:126
const char *volatile trusted
Definition: server.h:383
Pointer to a provisioned user xml subtree.
Definition: service.h:119
bool operator!() const
Definition: server.h:98
User profiles are used to map features and toll restriction level together under a common identifier...
Definition: mapped.h:83
cidr::policy * acl
Definition: server.h:482
unsigned extension
Definition: server.h:578
unsigned mediacount
Definition: server.h:677
segment * select
Definition: server.h:347
String anon
Definition: server.h:389
mapped * operator->() const
Definition: server.h:101
const char *volatile proxy
Definition: server.h:385
Structure for event description.
Definition: eXosip.h:359
voip::via_t via_header
Definition: server.h:601
const char *volatile published
Definition: server.h:384
timeout_t reset_timer
Definition: server.h:392
Representation of a mapped active user record.
Definition: mapped.h:95
unsigned range
Definition: server.h:172
service::keynode * routed
Definition: server.h:584
enum _state_t state_t
Enumeration for transaction state.
String agent
Definition: server.h:387
struct sockaddr * peering
Definition: server.h:674
LinkedObject * nat
Definition: server.h:273
const char * iface
Definition: server.h:386
unsigned via_hops
Definition: server.h:606
static unsigned inviteExpires(void)
Definition: server.h:473
static unsigned getRange(void)
Definition: server.h:190
timeout_t cfna_timer
Definition: server.h:392
voip::hdr_t header
Definition: server.h:599
char *volatile digest
Definition: server.h:169
service::usernode authorized
Definition: server.h:582
unsigned ringbusy
Definition: server.h:355
LinkedObject ** nat
Definition: server.h:676
static messages manager
Definition: server.h:551
voip::context_t context
Definition: server.h:255
voip::from_t from
Definition: server.h:602
MappedCall * map
Definition: server.h:348
bool activated
Definition: server.h:588
destination_t
Definition: server.h:48
stack::subnet * access
Definition: server.h:579
const char * instance
Definition: server.h:577
char * sip_realm
Definition: server.h:611
static registry reg
Definition: server.h:165
const char * reason
Definition: server.h:343
int call_t
Definition: voip.h:62
volatile int timing
Definition: server.h:379
Server control interfaces and functions.
Definition: control.h:58
int tid_t
Definition: voip.h:60
timeout_t ring_timer
Definition: server.h:392
voip::to_t to
Definition: server.h:603
session * source
Definition: server.h:345
MappedRegistry * accepted
Definition: server.h:586
const char * diverting
Definition: server.h:350
const char *volatile restricted
Definition: server.h:382
Top level include directory for GNU Telephony SIP Witch Server.
static background * thread
Definition: server.h:234
volatile time_t expires
Definition: server.h:167
const char * forwarding
Definition: server.h:349
struct sockaddr * getInterface(void)
Definition: server.h:414
static const char * getRealm(void)
Definition: server.h:178
stack::session * session
Definition: server.h:598
destination_t type
Definition: server.h:308
String system
Definition: server.h:388
unsigned threading
Definition: server.h:376
static stack sip
Definition: server.h:398
#define MAX_IDENT_SIZE
Definition: mapped.h:70
unsigned short mediaport
Definition: server.h:678
Representation of an active call record.
Definition: mapped.h:147
Callback methods for objects managed under the service thread.
Definition: service.h:175
session * target
Definition: server.h:346
#define MAX_USERID_SIZE
Definition: mapped.h:69
static int exit_code
Definition: server.h:498
service::usernode dialed
Definition: server.h:583
Definition of the From header.
Definition: osip_from.h:48
static timeout_t resetTimeout(void)
Definition: server.h:470
bool isSource(void) const
Definition: server.h:280
const char * via_host
Definition: server.h:605
const char * joined
Definition: server.h:344
static unsigned uid
Definition: server.h:495
unsigned invited
Definition: server.h:353
voip::context_t context
Definition: server.h:609
bool offline(void)
Definition: server.h:429
LinkedObject * profiles
Definition: server.h:485
unsigned answering
Definition: server.h:351
const char * bufdata
Definition: server.h:671
static const char * sipadmin
Definition: server.h:497
static shell::logmode_t logmode
Definition: server.h:494
destination_t destination
Definition: server.h:608
bool isTarget(void) const
Definition: server.h:283
voip::context_t context
Definition: server.h:122
unsigned invite_expires
Definition: server.h:393
char * name[96]
Definition: cgiserver.cpp:88
static time_t getExpires(void)
Definition: server.h:184
const char * getId(void)
Definition: server.h:411
unsigned routes
Definition: server.h:173
Socket::address via_address
Definition: server.h:597
Definition of a generic sip header.
Definition: osip_header.h:52
static const char * getDigest(void)
Definition: server.h:181
Definition of the Via header.
Definition: osip_via.h:47
void * context_t
Definition: voip.h:53
eXosip_event_type
Structure for event type description.
Definition: eXosip.h:288
voip::event_t sevent
Definition: server.h:587
int did_t
Definition: voip.h:61
#define MAX_SDP_BUFFER
Definition: mapped.h:72
long header_expires
Definition: server.h:600
OrderedIndex segments
Definition: server.h:342
int reg_t
Definition: voip.h:59
const char *volatile localnames
Definition: server.h:381
unsigned via_port
Definition: server.h:607
registry::mapped * reg
Definition: server.h:251
unsigned prefix
Definition: server.h:171
voip::call_t cid
Definition: server.h:252
keynode ** extmap
Definition: server.h:483
static timeout_t cfnaTimeout(void)
Definition: server.h:467
System configuration instance and service functions.
Definition: service.h:78
keynode * provision
Definition: server.h:484
mapped * operator*() const
Definition: server.h:104
static unsigned getPrefix(void)
Definition: server.h:187
Interface class for call detail records.
Definition: cdr.h:56
voip::uri_t uri
Definition: server.h:604
unsigned unreachable
Definition: server.h:356
unsigned ringing
Definition: server.h:354
char * map[96]
Definition: cgiserver.cpp:89
Structure for referencing SIP urls.
Definition: osip_uri.h:167
voip::proxyauth_t www_auth
Definition: server.h:613
Definition of the WWW-Authenticate header.
#define MAX_DISPLAY_SIZE
Definition: mapped.h:68
char *volatile realm
Definition: server.h:170
bool outgoing
Definition: server.h:390
treemap< char * > keynode
Definition of a xml node.
Definition: service.h:84
#define MAX_NETWORK_SIZE
Definition: mapped.h:66
#define MAX_URI_SIZE
Definition: mapped.h:71
size_t stacksize
Definition: server.h:377