[75fce0]: sipwitch / driver.h Maximize Restore History

Download this file

driver.h    126 lines (95 with data), 2.7 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// Copyright (C) 2008-2009 David Sugar, Tycho Softworks.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <../server/server.h>
#include <ucommon/secure.h>
#pragma GCC diagnostic ignored "-Wvariadic-macros"
#undef HAVE_CONFIG_H
#ifdef WIN32
#undef alloca
#endif
#include <eXosip2/eXosip.h>
#if defined(EXOSIP_OPT_BASE_OPTION) && !defined(EXOSIP_OPT_DONT_SEND_101)
#define EXOSIP_API4
#endif
#ifdef EXOSIP_API4
#define EXOSIP_CONTEXT driver::context
#define OPTION_CONTEXT driver::context,
#define EXOSIP_LOCK eXosip_lock(driver::context);
#define EXOSIP_UNLOCK eXosip_unlock(driver::context);
#else
#define EXOSIP_CONTEXT
#define OPTION_CONTEXT
#define EXOSIP_LOCK eXosip_lock();
#define EXOSIP_UNLOCK eXosip_unlock();
#endif
#ifndef SESSION_EXPIRES
#define SESSION_EXPIRES "session-expires"
#endif
#ifndef ALLOW_EVENTS
#define ALLOW_EVENTS "allow-events"
#endif
NAMESPACE_BAYONNE
using namespace UCOMMON_NAMESPACE;
class __LOCAL registry : public Registry
{
public:
int rid;
unsigned expires;
const char *contact;
const char *userid;
const char *secret;
const char *digest;
const char *server;
const char *domain;
const char *method;
const char *realm;
const char *uri;
char uuid[38];
bool active;
registry(keydata *keyset, unsigned port = 5060, unsigned expiration = 120);
void authenticate(const char *realm);
void activate(void);
void release(void);
void shutdown(void);
};
class driver : public Driver
{
public:
driver();
int start(void);
void stop(void);
void automatic(void);
#ifdef EXOSIP_API4
static eXosip_t *context;
#endif
static registry *locate(int rid);
};
class __LOCAL thread : public DetachedThread
{
private:
unsigned instance;
eXosip_event_t *sevent;
registry *reg;
void run(void);
public:
thread(size_t size);
static void shutdown();
};
class __LOCAL timeslot : public Timeslot
{
public:
timeslot(const char *addr, unsigned short port, int family);
};
END_NAMESPACE