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 | Data Fields | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions
sipwitch::forward Class Reference
Inheritance diagram for sipwitch::forward:
Inheritance graph
[legend]
Collaboration diagram for sipwitch::forward:
Collaboration graph
[legend]

Data Structures

class  regmap
 

Public Member Functions

 forward ()
 
void activate (voip::reg_t id)
 
void disable (voip::reg_t id)
 
bool isActive (voip::reg_t id)
 
void remove (voip::reg_t id)
 
void add (MappedRegistry *rr)
 
MappedRegistryfind (voip::reg_t id)
 
void releaseMap (MappedRegistry *rr)
 
virtual void period (long slice)
 Period service request. More...
 
virtual char * referRemote (MappedRegistry *user, const char *target, char *buffer, size_t size)
 Enables plugin to remap users dialing remote destinations. More...
 
voip::context_t getContext (const char *uri)
 

Static Public Member Functions

static void bind (unsigned short port)
 
static void bind (const char *addr)
 
static void setPublic (void)
 

Data Fields

char *volatile proxy
 
char *volatile realm
 
char *volatile digest
 
char *volatile server
 
char *volatile schema
 
char *volatile refer
 
voip::context_t context
 
time_t expires
 
bool enabled
 
condlock_t locking
 
unsigned allocated
 
unsigned active
 
regmapfreelist
 
regmapindex [177]
 
memalloc pager
 

Static Public Attributes

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 bool check (void)
 
virtual void snapshot (FILE *fp)
 
virtual void stop (service *cfg)
 
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 start (service *cfg)
 
void reload (service *cfg)
 
void activating (MappedRegistry *rr)
 Notify plugins a user registration is being activated. More...
 
void expiring (MappedRegistry *rr)
 Notify plugins a user registration has been expired or released. More...
 
void registration (voip::reg_t id, modules::regmode_t mode)
 Notify plugins about reply messages from external registrations. More...
 
bool announce (MappedRegistry *rr, const char *msgtype, const char *event, const char *expires, const char *body)
 Announce a SIP publish event from a registered user to plugins. More...
 
bool authenticate (int id, const char *remote_realm)
 Used to verify authentication of a registered session. More...
 
char * referLocal (MappedRegistry *rr, const char *target, char *buffer, size_t size)
 Enables plugin to redirect locally dialed destination to new uri. More...
 

Detailed Description

Definition at line 24 of file forward.cpp.

Constructor & Destructor Documentation

sipwitch::forward::forward ( )

Definition at line 73 of file forward.cpp.

Member Function Documentation

void sipwitch::forward::activate ( voip::reg_t  id)

Definition at line 146 of file forward.cpp.

void sipwitch::forward::activating ( MappedRegistry user)
privatevirtual

Notify plugins a user registration is being activated.

Parameters
userregistration activated.

Reimplemented from sipwitch::modules::sipwitch.

Definition at line 299 of file forward.cpp.

void sipwitch::forward::add ( MappedRegistry rr)

Definition at line 189 of file forward.cpp.

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

Definition at line 211 of file service.h.

bool sipwitch::forward::announce ( MappedRegistry user,
const char *  type,
const char *  event,
const char *  expires,
const char *  body 
)
privatevirtual

Announce a SIP publish event from a registered user to plugins.

Parameters
userregistration who publushed.
typeof message that is published.
eventtype description, such as "presense" message.
expirestime for this message.
bodyof message published by user agent.
Returns
true if plugin wishes to swallow this message.

Reimplemented from sipwitch::modules::sipwitch.

Definition at line 331 of file forward.cpp.

bool sipwitch::forward::authenticate ( int  id,
const char *  realm 
)
privatevirtual

Used to verify authentication of a registered session.

This is for use by sessions registered by plugins.

Parameters
idof registration (eXosip rid).
realmof this registration.
Returns
true if valid, false if invalid or to ignore in this plugin.

Reimplemented from sipwitch::modules::sipwitch.

Definition at line 382 of file forward.cpp.

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.

bool callback::check ( void  )
protectedvirtualinherited

Reimplemented in sipwitch::messages, sipwitch::stack, and sipwitch::registry.

Definition at line 186 of file service.cpp.

void sipwitch::forward::disable ( voip::reg_t  id)

Definition at line 130 of file forward.cpp.

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

Definition at line 214 of file service.h.

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

Definition at line 191 of file service.cpp.

void sipwitch::forward::expiring ( MappedRegistry user)
privatevirtual

Notify plugins a user registration has been expired or released.

Parameters
userregistration that was expired.

Reimplemented from sipwitch::modules::sipwitch.

Definition at line 352 of file forward.cpp.

MappedRegistry * sipwitch::forward::find ( voip::reg_t  id)

Definition at line 115 of file forward.cpp.

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

Definition at line 162 of file service.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.

bool sipwitch::forward::isActive ( voip::reg_t  id)

Definition at line 96 of file forward.cpp.

void sipwitch::modules::sipwitch::period ( long  slice)
virtualinherited

Period service request.

A period is an interval during which stats are flushed and refreshed. This notifies the plugin that a period has occured, and what the interval for the period was in seconds.

Parameters
sliceof period in seconds.

Definition at line 53 of file modules.cpp.

void callback::publish ( service cfg)
protectedvirtualinherited

Definition at line 203 of file service.cpp.

char * sipwitch::forward::referLocal ( MappedRegistry user,
const char *  target,
char *  buffer,
size_t  size 
)
privatevirtual

Enables plugin to redirect locally dialed destination to new uri.

Might be used by a plugin that does per-user speed-dialing database, for example.

Parameters
userthat is dialing.
targetuser dialed.
bufferto store replacement uri in.
sizeof replacement buffer.
Returns
pointer to buffer or NULL if ignored.

Reimplemented from sipwitch::modules::sipwitch.

Definition at line 367 of file forward.cpp.

char * sipwitch::modules::sipwitch::referRemote ( MappedRegistry user,
const char *  target,
char *  buffer,
size_t  size 
)
virtualinherited

Enables plugin to remap users dialing remote destinations.

This might be used as a hook for a plugin that maintains gfc peer tables, for example.

Parameters
userthat is dialing.
targetof remote uri.
bufferto store replacement uri in.
sizeof replacement buffer.
Returns
pointer to buffer of new uri or NULL ignored.

Definition at line 76 of file modules.cpp.

void sipwitch::forward::registration ( voip::reg_t  id,
modules::regmode_t  reg 
)
privatevirtual

Notify plugins about reply messages from external registrations.

This is used to get result of eXosip SIP registration requests. This might be used to get the result of a plugin registering itself with a gateway or SIP service provider, for example.

Parameters
idof registration (eXosip rid).
resultof registration

Reimplemented from sipwitch::modules::sipwitch.

Definition at line 417 of file forward.cpp.

void sipwitch::forward::releaseMap ( MappedRegistry rr)

Definition at line 90 of file forward.cpp.

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

Reimplemented from sipwitch::service::callback.

Definition at line 209 of file forward.cpp.

void sipwitch::forward::remove ( voip::reg_t  id)

Definition at line 162 of file forward.cpp.

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

Definition at line 241 of file service.h.

void callback::snapshot ( FILE *  fp)
protectedvirtualinherited

Reimplemented in sipwitch::messages, sipwitch::stack, and sipwitch::registry.

Definition at line 182 of file service.cpp.

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

Reimplemented from sipwitch::service::callback.

Definition at line 294 of file forward.cpp.

void callback::stop ( service cfg)
protectedvirtualinherited

Reimplemented in sipwitch::media, sipwitch::stack, and sipwitch::registry.

Definition at line 211 of file service.cpp.

Field Documentation

unsigned sipwitch::forward::active

Definition at line 45 of file forward.cpp.

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

Definition at line 184 of file service.h.

unsigned sipwitch::forward::allocated

Definition at line 45 of file forward.cpp.

voip::context_t sipwitch::forward::context

Definition at line 41 of file forward.cpp.

unsigned callback::count = 0
staticprotectedinherited

Definition at line 187 of file service.h.

char* volatile sipwitch::forward::digest

Definition at line 37 of file forward.cpp.

bool sipwitch::forward::enabled

Definition at line 43 of file forward.cpp.

time_t sipwitch::forward::expires

Definition at line 42 of file forward.cpp.

regmap* sipwitch::forward::freelist

Definition at line 46 of file forward.cpp.

regmap* sipwitch::forward::index[177]

Definition at line 47 of file forward.cpp.

condlock_t sipwitch::forward::locking

Definition at line 44 of file forward.cpp.

voip::context_t callback::out_context = NULL
staticinherited

Definition at line 233 of file service.h.

memalloc sipwitch::forward::pager

Definition at line 48 of file forward.cpp.

char* volatile sipwitch::forward::proxy

Definition at line 35 of file forward.cpp.

char* volatile sipwitch::forward::realm

Definition at line 36 of file forward.cpp.

char* volatile sipwitch::forward::refer

Definition at line 40 of file forward.cpp.

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.

char* volatile sipwitch::forward::schema

Definition at line 39 of file forward.cpp.

char* volatile sipwitch::forward::server

Definition at line 38 of file forward.cpp.

char callback::session_uuid
staticprotectedinherited

Definition at line 206 of file service.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.

voip::context_t callback::tcp_context = NULL
staticinherited

Definition at line 234 of file service.h.

voip::context_t callback::tls_context = NULL
staticinherited

Definition at line 236 of file service.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 file: