SIP Witch 1.9.15
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Friends
sipwitch::stack Class Reference

#include <server.h>

Inheritance diagram for sipwitch::stack:
Inheritance graph
[legend]
Collaboration diagram for sipwitch::stack:
Collaboration graph
[legend]

Data Structures

class  background
 
class  call
 
class  segment
 
class  session
 
class  subnet
 

Public Member Functions

 stack ()
 
voip::context_t getContext (const char *uri)
 

Static Public Member Functions

static const char * getScheme (void)
 
static void getInterface (struct sockaddr *iface, const struct sockaddr *dest)
 
static sessioncreate (voip::context_t context, voip::call_t cid, voip::did_t did, voip::tid_t tid)
 
static sessioncreate (voip::context_t context, call *cr, voip::call_t cid)
 
static void destroy (session *s)
 
static void destroy (call *cr)
 
static void disjoin (call *cr)
 
static void detach (session *s)
 
static void clear (session *s)
 
static void close (session *s)
 
static sessionaccess (voip::call_t cid)
 
static char * sipAddress (struct sockaddr_internet *addr, char *buf, const char *user=NULL, size_t size=MAX_URI_SIZE)
 
static char * sipPublish (struct sockaddr_internet *addr, char *buf, const char *user=NULL, size_t size=MAX_URI_SIZE)
 
static char * sipContact (struct sockaddr_internet *addr, char *buf, const char *user=NULL, const char *display=NULL, size_t size=MAX_URI_SIZE)
 
static Socket::address * getAddress (const char *uri, Socket::address *addr=NULL)
 
static void siplog (voip::msg_t msg)
 
static void enableDumping (void)
 
static void clearDumping (void)
 
static void disableDumping (void)
 
static void refer (session *session, voip::event_t sevent)
 
static void infomsg (session *session, voip::event_t sevent)
 
static void setDialog (session *session, voip::did_t did)
 
static int getDialog (session *session)
 
static void release (MappedCall *map)
 
static MappedCallget (void)
 
static bool forward (stack::call *cr)
 
static int inviteRemote (stack::session *session, const char *uri, const char *digest=NULL)
 
static int inviteLocal (stack::session *session, registry::mapped *rr, destination_t dest)
 
static timeout_t ringTimeout (void)
 
static timeout_t cfnaTimeout (void)
 
static timeout_t resetTimeout (void)
 
static unsigned inviteExpires (void)
 
static void bind (unsigned short port)
 
static void bind (const char *addr)
 
static void setPublic (void)
 

Static Public Attributes

static stack sip
 
static voip::context_t out_context = NULL
 
static voip::context_t tcp_context = NULL
 
static voip::context_t udp_context = NULL
 
static voip::context_t tls_context = NULL
 

Protected Member Functions

bool is_active (void) const
 
virtual void cdrlog (cdr *call)
 
virtual void errlog (shell::loglevel_t level, const char *text)
 
virtual void publish (service *cfg)
 

Static Protected Member Functions

static void * alloc (service *cfgp, size_t size)
 
static char * dup (service *cfgp, const char *s)
 
static bool is_configured (void)
 

Protected Attributes

unsigned runlevel
 
bool active_flag
 

Static Protected Attributes

static LinkedObjectrunlevels [4] = {NULL, NULL, NULL, NULL}
 
static unsigned count = 0
 
static unsigned short sip_port = 5060
 
static const char * sip_iface = NULL
 
static volatile char * sip_contact = NULL
 
static volatile char * sip_publish = NULL
 
static int sip_protocol = IPPROTO_UDP
 
static int sip_family = AF_INET
 
static int sip_tlsmode = 0
 
static bool sip_public = false
 
static const char * sip_domain = NULL
 
static const char * sip_realm = "unknown"
 
static const char * sip_tlspwd = ""
 
static const char * sip_tlsdev = "/dev/random"
 
static const char * sip_tlsca = "/etc/ssl/ca.pem"
 
static const char * sip_tlsdh = "/etc/ssl/dh1024.pem"
 
static const char * sip_tlskey = "/etc/ssl/private/sipwitch.key"
 
static const char * sip_tlscert = "/etc/ssl/sipwitch.pem"
 
static unsigned sip_prefix = 0
 
static unsigned sip_range = 0
 
static char session_uuid [40]
 

Private Member Functions

void reload (service *cfg)
 
void start (service *cfg)
 
void stop (service *cfg)
 
void snapshot (FILE *fp)
 
bool check (void)
 
void release (void)
 

Static Private Member Functions

static void divert (stack::call *cr, voip::msg_t msg)
 

Private Attributes

unsigned threading
 
unsigned priority
 
size_t stacksize
 
volatile int timing
 
const char *volatile localnames
 
const char *volatile restricted
 
const char *volatile trusted
 
const char *volatile published
 
const char *volatile proxy
 
const char * iface
 
String agent
 
String system
 
String anon
 
bool incoming
 
bool outgoing
 
bool dumping
 
int send101
 
timeout_t ring_timer
 
timeout_t cfna_timer
 
timeout_t reset_timer
 
unsigned invite_expires
 

Friends

class proxy
 
class thread
 
class messages
 
class media
 

Detailed Description

Definition at line 218 of file server.h.

Constructor & Destructor Documentation

sipwitch::stack::stack ( )

Definition at line 286 of file stack.cpp.

Member Function Documentation

stack::session * sipwitch::stack::access ( voip::call_t  cid)
static

Definition at line 687 of file stack.cpp.

static void* sipwitch::service::callback::alloc ( service cfgp,
size_t  size 
)
inlinestaticprotectedinherited

Definition at line 211 of file service.h.

static void sipwitch::service::callback::bind ( unsigned short  port)
inlinestaticinherited

Definition at line 238 of file service.h.

void callback::bind ( const char *  addr)
staticinherited

Definition at line 215 of file service.cpp.

void callback::cdrlog ( cdr call)
protectedvirtualinherited

Definition at line 195 of file service.cpp.

static timeout_t sipwitch::stack::cfnaTimeout ( void  )
inlinestatic

Definition at line 467 of file server.h.

bool sipwitch::stack::check ( void  )
privatevirtual

Reimplemented from sipwitch::service::callback.

Definition at line 830 of file stack.cpp.

void sipwitch::stack::clear ( session s)
static

Definition at line 384 of file stack.cpp.

void sipwitch::stack::clearDumping ( void  )
static

Definition at line 319 of file stack.cpp.

void sipwitch::stack::close ( session s)
static

Definition at line 354 of file stack.cpp.

stack::session * sipwitch::stack::create ( voip::context_t  context,
voip::call_t  cid,
voip::did_t  did,
voip::tid_t  tid 
)
static

Definition at line 665 of file stack.cpp.

stack::session * sipwitch::stack::create ( voip::context_t  context,
call cr,
voip::call_t  cid 
)
static

Definition at line 653 of file stack.cpp.

void sipwitch::stack::destroy ( session s)
static

Definition at line 431 of file stack.cpp.

void sipwitch::stack::destroy ( call cr)
static

Definition at line 555 of file stack.cpp.

void sipwitch::stack::detach ( session s)
static

Definition at line 707 of file stack.cpp.

void sipwitch::stack::disableDumping ( void  )
static

Definition at line 314 of file stack.cpp.

void sipwitch::stack::disjoin ( call cr)
static

Definition at line 534 of file stack.cpp.

void sipwitch::stack::divert ( stack::call cr,
voip::msg_t  msg 
)
staticprivate

Definition at line 1216 of file stack.cpp.

static char* sipwitch::service::callback::dup ( service cfgp,
const char *  s 
)
inlinestaticprotectedinherited

Definition at line 214 of file service.h.

void sipwitch::stack::enableDumping ( void  )
static

Definition at line 325 of file stack.cpp.

void callback::errlog ( shell::loglevel_t  level,
const char *  text 
)
protectedvirtualinherited

Definition at line 191 of file service.cpp.

bool sipwitch::stack::forward ( stack::call cr)
static

Definition at line 1411 of file stack.cpp.

MappedCall * sipwitch::stack::get ( void  )
static

Definition at line 611 of file stack.cpp.

Socket::address * sipwitch::stack::getAddress ( const char *  uri,
Socket::address *  addr = NULL 
)
static

Definition at line 1146 of file stack.cpp.

voip::context_t callback::getContext ( const char *  uri)
inherited

Definition at line 162 of file service.cpp.

int sipwitch::stack::getDialog ( session session)
static

Definition at line 449 of file stack.cpp.

void sipwitch::stack::getInterface ( struct sockaddr *  iface,
const struct sockaddr *  dest 
)
static

Definition at line 636 of file stack.cpp.

const char * sipwitch::stack::getScheme ( void  )
static

Definition at line 1032 of file stack.cpp.

void sipwitch::stack::infomsg ( session session,
voip::event_t  sevent 
)
static

Definition at line 497 of file stack.cpp.

static unsigned sipwitch::stack::inviteExpires ( void  )
inlinestatic

Definition at line 473 of file server.h.

int sipwitch::stack::inviteLocal ( stack::session session,
registry::mapped rr,
destination_t  dest 
)
static

Definition at line 1492 of file stack.cpp.

int sipwitch::stack::inviteRemote ( stack::session session,
const char *  uri,
const char *  digest = NULL 
)
static

Definition at line 1248 of file stack.cpp.

bool sipwitch::service::callback::is_active ( void  ) const
inlineprotectedinherited

Definition at line 220 of file service.h.

static bool sipwitch::service::callback::is_configured ( void  )
inlinestaticprotectedinherited

Definition at line 217 of file service.h.

void callback::publish ( service cfg)
protectedvirtualinherited

Definition at line 203 of file service.cpp.

void sipwitch::stack::refer ( session session,
voip::event_t  sevent 
)
static

Definition at line 461 of file stack.cpp.

void sipwitch::stack::release ( void  )
private

Definition at line 309 of file stack.cpp.

void sipwitch::stack::release ( MappedCall map)
static

Definition at line 600 of file stack.cpp.

void sipwitch::stack::reload ( service cfg)
privatevirtual

Reimplemented from sipwitch::service::callback.

Definition at line 869 of file stack.cpp.

static timeout_t sipwitch::stack::resetTimeout ( void  )
inlinestatic

Definition at line 470 of file server.h.

static timeout_t sipwitch::stack::ringTimeout ( void  )
inlinestatic

Definition at line 464 of file server.h.

void sipwitch::stack::setDialog ( session session,
voip::did_t  did 
)
static

Definition at line 441 of file stack.cpp.

static void sipwitch::service::callback::setPublic ( void  )
inlinestaticinherited

Definition at line 241 of file service.h.

char * sipwitch::stack::sipAddress ( struct sockaddr_internet *  addr,
char *  buf,
const char *  user = NULL,
size_t  size = MAX_URI_SIZE 
)
static

Definition at line 1079 of file stack.cpp.

static char* sipwitch::stack::sipContact ( struct sockaddr_internet *  addr,
char *  buf,
const char *  user = NULL,
const char *  display = NULL,
size_t  size = MAX_URI_SIZE 
)
static
void sipwitch::stack::siplog ( voip::msg_t  msg)
static

Definition at line 331 of file stack.cpp.

char * sipwitch::stack::sipPublish ( struct sockaddr_internet *  addr,
char *  buf,
const char *  user = NULL,
size_t  size = MAX_URI_SIZE 
)
static

Definition at line 1039 of file stack.cpp.

void sipwitch::stack::snapshot ( FILE *  fp)
privatevirtual

Reimplemented from sipwitch::service::callback.

Definition at line 850 of file stack.cpp.

void sipwitch::stack::start ( service cfg)
privatevirtual

Reimplemented from sipwitch::service::callback.

Definition at line 713 of file stack.cpp.

void sipwitch::stack::stop ( service cfg)
privatevirtual

Reimplemented from sipwitch::service::callback.

Definition at line 818 of file stack.cpp.

Friends And Related Function Documentation

friend class media
friend

Definition at line 224 of file server.h.

friend class messages
friend

Definition at line 223 of file server.h.

friend class proxy
friend

Definition at line 221 of file server.h.

friend class thread
friend

Definition at line 222 of file server.h.

Field Documentation

bool sipwitch::service::callback::active_flag
protectedinherited

Definition at line 184 of file service.h.

String sipwitch::stack::agent
private

Definition at line 387 of file server.h.

String sipwitch::stack::anon
private

Definition at line 389 of file server.h.

timeout_t sipwitch::stack::cfna_timer
private

Definition at line 392 of file server.h.

unsigned callback::count = 0
staticprotectedinherited

Definition at line 187 of file service.h.

bool sipwitch::stack::dumping
private

Definition at line 390 of file server.h.

const char* sipwitch::stack::iface
private

Definition at line 386 of file server.h.

bool sipwitch::stack::incoming
private

Definition at line 390 of file server.h.

unsigned sipwitch::stack::invite_expires
private

Definition at line 393 of file server.h.

const char* volatile sipwitch::stack::localnames
private

Definition at line 381 of file server.h.

voip::context_t callback::out_context = NULL
staticinherited

Definition at line 233 of file service.h.

bool sipwitch::stack::outgoing
private

Definition at line 390 of file server.h.

unsigned sipwitch::stack::priority
private

Definition at line 376 of file server.h.

const char* volatile sipwitch::stack::proxy
private

Definition at line 385 of file server.h.

const char* volatile sipwitch::stack::published
private

Definition at line 384 of file server.h.

timeout_t sipwitch::stack::reset_timer
private

Definition at line 392 of file server.h.

const char* volatile sipwitch::stack::restricted
private

Definition at line 382 of file server.h.

timeout_t sipwitch::stack::ring_timer
private

Definition at line 392 of file server.h.

unsigned sipwitch::service::callback::runlevel
protectedinherited

Definition at line 183 of file service.h.

LinkedObject * callback::runlevels = {NULL, NULL, NULL, NULL}
staticprotectedinherited

Definition at line 186 of file service.h.

int sipwitch::stack::send101
private

Definition at line 391 of file server.h.

char callback::session_uuid
staticprotectedinherited

Definition at line 206 of file service.h.

stack sipwitch::stack::sip
static

Definition at line 398 of file server.h.

volatile char * callback::sip_contact = NULL
staticprotectedinherited

Definition at line 190 of file service.h.

const char * callback::sip_domain = NULL
staticprotectedinherited

Definition at line 196 of file service.h.

int callback::sip_family = AF_INET
staticprotectedinherited

Definition at line 193 of file service.h.

const char * callback::sip_iface = NULL
staticprotectedinherited

Definition at line 189 of file service.h.

unsigned short callback::sip_port = 5060
staticprotectedinherited

Definition at line 188 of file service.h.

unsigned callback::sip_prefix = 0
staticprotectedinherited

Definition at line 204 of file service.h.

int callback::sip_protocol = IPPROTO_UDP
staticprotectedinherited

Definition at line 192 of file service.h.

bool callback::sip_public = false
staticprotectedinherited

Definition at line 195 of file service.h.

volatile char * callback::sip_publish = NULL
staticprotectedinherited

Definition at line 191 of file service.h.

unsigned callback::sip_range = 0
staticprotectedinherited

Definition at line 205 of file service.h.

const char * callback::sip_realm = "unknown"
staticprotectedinherited

Definition at line 197 of file service.h.

const char * callback::sip_tlsca = "/etc/ssl/ca.pem"
staticprotectedinherited

Definition at line 200 of file service.h.

const char * callback::sip_tlscert = "/etc/ssl/sipwitch.pem"
staticprotectedinherited

Definition at line 203 of file service.h.

const char * callback::sip_tlsdev = "/dev/random"
staticprotectedinherited

Definition at line 199 of file service.h.

const char * callback::sip_tlsdh = "/etc/ssl/dh1024.pem"
staticprotectedinherited

Definition at line 201 of file service.h.

const char * callback::sip_tlskey = "/etc/ssl/private/sipwitch.key"
staticprotectedinherited

Definition at line 202 of file service.h.

int callback::sip_tlsmode = 0
staticprotectedinherited

Definition at line 194 of file service.h.

const char * callback::sip_tlspwd = ""
staticprotectedinherited

Definition at line 198 of file service.h.

size_t sipwitch::stack::stacksize
private

Definition at line 377 of file server.h.

String sipwitch::stack::system
private

Definition at line 388 of file server.h.

voip::context_t callback::tcp_context = NULL
staticinherited

Definition at line 234 of file service.h.

unsigned sipwitch::stack::threading
private

Definition at line 376 of file server.h.

volatile int sipwitch::stack::timing
private

Definition at line 379 of file server.h.

voip::context_t callback::tls_context = NULL
staticinherited

Definition at line 236 of file service.h.

const char* volatile sipwitch::stack::trusted
private

Definition at line 383 of file server.h.

voip::context_t callback::udp_context = NULL
staticinherited

Definition at line 235 of file service.h.


The documentation for this class was generated from the following files: