#include <sipep.h>
Inheritance diagram for SIPEndPoint:
Public Types | |
enum | NATBindingRefreshMethod { None, Options, EmptyRequest, NumMethods } |
Public Member Functions | |
PSafePtr< SIPConnection > | GetSIPConnectionWithLock (const PString &token, PSafetyMode mode=PSafeReadWrite) |
virtual BOOL | IsAcceptedAddress (const SIPURL &toAddr) |
virtual void | OnMessageReceived (const SIPURL &from, const PString &body) |
BOOL | Register (const PString &host, const PString &username=PString::Empty(), const PString &autName=PString::Empty(), const PString &password=PString::Empty(), const PString &authRealm=PString::Empty(), int timeout=0) |
virtual void | OnMWIReceived (const PString &host, const PString &user, SIPMWISubscribe::MWIType type, const PString &msgs) |
BOOL | MWISubscribe (const PString &host, const PString &username, int timeout=0) |
virtual void | OnRegistrationFailed (const PString &host, const PString &userName, SIP_PDU::StatusCodes reason, BOOL wasRegistering) |
virtual void | OnRegistered (const PString &host, const PString &userName, BOOL wasRegistering) |
BOOL | IsRegistered (const PString &host) |
unsigned | GetRegistrationsCount () |
BOOL | IsSubscribed (const PString &host, const PString &user) |
BOOL | Unregister (const PString &host, const PString &user) |
BOOL | MWIUnsubscribe (const PString &host, const PString &user) |
virtual void | OnMessageFailed (const SIPURL &messageUrl, SIP_PDU::StatusCodes reason) |
void | SetMIMEForm (BOOL v) |
BOOL | GetMIMEForm () const |
void | SetMaxRetries (unsigned r) |
unsigned | GetMaxRetries () const |
void | SetRetryTimeouts (const PTimeInterval &t1, const PTimeInterval &t2) |
const PTimeInterval & | GetRetryTimeoutMin () const |
const PTimeInterval & | GetRetryTimeoutMax () const |
void | SetNonInviteTimeout (const PTimeInterval &t) |
const PTimeInterval & | GetNonInviteTimeout () const |
void | SetPduCleanUpTimeout (const PTimeInterval &t) |
const PTimeInterval & | GetPduCleanUpTimeout () const |
void | SetInviteTimeout (const PTimeInterval &t) |
const PTimeInterval & | GetInviteTimeout () const |
void | SetAckTimeout (const PTimeInterval &t) |
const PTimeInterval & | GetAckTimeout () const |
void | SetRegistrarTimeToLive (const PTimeInterval &t) |
const PTimeInterval & | GetRegistrarTimeToLive () const |
void | SetNotifierTimeToLive (const PTimeInterval &t) |
const PTimeInterval & | GetNotifierTimeToLive () const |
void | SetNATBindingTimeout (const PTimeInterval &t) |
const PTimeInterval & | GetNATBindingTimeout () const |
void | AddTransaction (SIPTransaction *transaction) |
void | RemoveTransaction (SIPTransaction *transaction) |
unsigned | GetNextCSeq () |
BOOL | GetAuthentication (const PString &authRealm, SIPAuthentication &) |
const SIPURL | GetRegisteredPartyName (const PString &) |
const SIPURL | GetLocalURL (const OpalTransport &transport, const PString &userName=PString::Empty()) |
const SIPURL & | GetProxy () const |
void | SetProxy (const SIPURL &url) |
void | SetProxy (const PString &hostname, const PString &username, const PString &password) |
virtual PString | GetUserAgent () const |
void | SetUserAgent (const PString &str) |
BOOL | SendMessage (const SIPURL &url, const PString &body) |
void | SetNATBindingRefreshMethod (const NATBindingRefreshMethod m) |
Construction | |
SIPEndPoint (OpalManager &manager) | |
~SIPEndPoint () | |
Overrides from OpalEndPoint | |
virtual PStringArray | GetDefaultListeners () const |
virtual BOOL | NewIncomingConnection (OpalTransport *transport) |
virtual BOOL | MakeConnection (OpalCall &call, const PString &party, void *userData=NULL) |
virtual OpalMediaFormatList | GetMediaFormats () const |
Customisation call backs | |
virtual SIPConnection * | CreateConnection (OpalCall &call, const PString &token, void *userData, const SIPURL &destination, OpalTransport *transport, SIP_PDU *invite) |
virtual BOOL | SetupTransfer (const PString &token, const PString &callIdentity, const PString &remoteParty, void *userData=NULL) |
virtual BOOL | ForwardConnection (SIPConnection &connection, const PString &forwardParty) |
Protocol handling routines | |
OpalTransport * | CreateTransport (const OpalTransportAddress &address) |
virtual void | HandlePDU (OpalTransport &transport) |
virtual BOOL | OnReceivedPDU (OpalTransport &transport, SIP_PDU *pdu) |
virtual void | OnReceivedResponse (SIPTransaction &transaction, SIP_PDU &response) |
virtual BOOL | OnReceivedINVITE (OpalTransport &transport, SIP_PDU *pdu) |
virtual void | OnReceivedAuthenticationRequired (SIPTransaction &transaction, SIP_PDU &response) |
virtual void | OnReceivedOK (SIPTransaction &transaction, SIP_PDU &response) |
virtual BOOL | OnReceivedNOTIFY (OpalTransport &transport, SIP_PDU &response) |
virtual void | OnReceivedMESSAGE (OpalTransport &transport, SIP_PDU &response) |
virtual void | OnRTPStatistics (const SIPConnection &connection, const RTP_Session &session) const |
Protected Member Functions | |
PDECLARE_NOTIFIER (PThread, SIPEndPoint, TransportThreadMain) | |
PDECLARE_NOTIFIER (PTimer, SIPEndPoint, NATBindingRefresh) | |
PDECLARE_NOTIFIER (PTimer, SIPEndPoint, RegistrationRefresh) | |
BOOL | TransmitSIPInfo (SIP_PDU::Methods method, const PString &host, const PString &username, const PString &authName=PString::Empty(), const PString &password=PString::Empty(), const PString &authRealm=PString::Empty(), const PString &body=PString::Empty(), int timeout=0) |
BOOL | TransmitSIPUnregistrationInfo (const PString &host, const PString &username, SIP_PDU::Methods method) |
void | ParsePartyName (const PString &remoteParty, PString &party) |
Parsed party name, after e164 lookup. | |
Static Protected Member Functions | |
static BOOL | WriteSIPInfo (OpalTransport &transport, void *info) |
Protected Attributes | |
SIPURL | proxy |
PString | userAgentString |
BOOL | mimeForm |
unsigned | maxRetries |
PTimeInterval | retryTimeoutMin |
PTimeInterval | retryTimeoutMax |
PTimeInterval | nonInviteTimeout |
PTimeInterval | pduCleanUpTimeout |
PTimeInterval | inviteTimeout |
PTimeInterval | ackTimeout |
PTimeInterval | registrarTimeToLive |
PTimeInterval | notifierTimeToLive |
PTimeInterval | natBindingTimeout |
RegistrationList | activeSIPInfo |
PTimer | registrationTimer |
SIPTransactionList | messages |
SIPTransactionDict | transactions |
PMutex | natTransportMutex |
PTimer | natBindingTimer |
NATBindingRefreshMethod | natMethod |
PList< OpalTransport > | natTransports |
PMutex | transactionsMutex |
unsigned | lastSentCSeq |
Classes | |
class | RegistrationList |
|
NAT Binding Refresh Method |
|
Create a new endpoint. |
|
Destroy endpoint. |
|
|
|
Create a connection for the SIP endpoint. The default implementation is to create a OpalSIPConnection.
|
|
|
|
Forward the connection using the same token as the specified connection. Return TRUE if the connection is being redirected.
|
|
|
|
Return the SIPAuthentication for a specific realm. |
|
Get the default listeners for the endpoint type. Overrides the default behaviour to return udp and tcp listeners. Reimplemented from OpalEndPoint. |
|
|
|
Return the local URL for the given transport and user name. That URL can be used as via address, and as contact field in outgoing requests. The URL is translated if required. If the transport is not running, the first listener transport will be used, if any.
|
|
|
|
Get the data formats this endpoint is capable of operating. This provides a list of media data format names that may be used by an OpalMediaStream may be created by a connection from this endpoint. Note that a specific connection may not actually support all of the media formats returned here, but should return no more. The default behaviour is pure. Implements OpalEndPoint. |
|
|
|
|
|
Return the next CSEQ for the next transaction. |
|
|
|
|
|
|
|
Return the outbound proxy URL, if any. |
|
Return the registered party name URL for the given host. That URL can be used in the FORM field of the PDU's. The host part can be different from the registration domain. |
|
|
|
Returns the number of registered accounts. |
|
|
|
|
|
Find a connection that uses the specified token. This searches the endpoint for the connection that contains the token as provided by functions such as MakeConnection().
|
|
Get the User Agent for this endpoint. |
|
|
|
|
|
Returns TRUE if the given URL has been registered (e.g.: 6001@seconix.com). |
|
Returns TRUE if subscribed to the given host for MWI. |
|
Set up a connection to a remote party. This is called from the OpalManager::MakeConnection() function once it has determined that this is the endpoint for the protocol. The general form for this party parameter is: [proto:][alias@][transport$]address[:port] where the various fields will have meanings specific to the endpoint type. For example, with H.323 it could be "h323:Fred@site.com" which indicates a user Fred at gatekeeper size.com. Whereas for the PSTN endpoint it could be "pstn:5551234" which is to call 5551234 on the first available PSTN line. The proto field is optional when passed to a specific endpoint. If it is present, however, it must agree with the endpoints protocol name or FALSE is returned. This function usually returns almost immediately with the connection continuing to occur in a new background thread. If FALSE is returned then the connection could not be established. For example if a PSTN endpoint is used and the assiciated line is engaged then it may return immediately. Returning a non-NULL value does not mean that the connection will succeed, only that an attempt is being made. The default behaviour is pure.
Implements OpalEndPoint. |
|
Subscribe to a notifier. This function is asynchronous to permit several subscripttions to occur at the same time. |
|
Unsubscribe from a notifier. This function is synchronous. |
|
Handle new incoming connection from listener. The default behaviour does nothing.
Reimplemented from OpalEndPoint. |
|
Callback called when a message sent by the endpoint didn't reach its destination or when the proxy or remote endpoint returns an error code. |
|
Callback called when MWI is received |
|
Callback called when MWI is received |
|
Handle an incoming Proxy Authentication Required response PDU |
|
Handle an incoming INVITE request. |
|
Handle an incoming MESSAGE PDU. |
|
Handle an incoming NOTIFY PDU. |
|
Handle an incoming OK response PDU. This actually gets any PDU of the class 2xx not just 200. |
|
Handle an incoming SIP PDU that has been full decoded |
|
Handle an incoming response PDU. |
|
Callback called when a registration or an unregistration is successful. The BOOL indicates if the operation that failed was a registration or not. |
|
Callback called when a registration to a SIP registrars fails. The BOOL indicates if the operation that failed was a REGISTER or an (UN)REGISTER. |
|
Callback from the RTP session for statistics monitoring. This is called every so many packets on the transmitter and receiver threads of the RTP session indicating that the statistics have been updated. The default behaviour does nothing.
|
|
Parsed party name, after e164 lookup.
|
|
|
|
|
|
|
|
Register to a registrar. This function is asynchronous to permit several registrations to occur at the same time. It can be called several times for different hosts and users. The username can be of the form user. In that case, the From field will be set to that value. The realm can be specified when registering, this will allow to find the correct authentication information when being requested. If no realm is specified, authentication will occur with the "best guess" of authentication parameters. |
|
|
|
Send a message to the given URL. |
|
|
|
|
|
|
|
|
|
Set the NAT Binding Refresh Method |
|
|
|
|
|
|
|
|
|
Set the outbound proxy URL. |
|
Set the outbound proxy URL. |
|
|
|
|
|
Setup a connection transfer a connection for the SIP endpoint.
|
|
Set the User Agent for the endpoint. |
|
|
|
|
|
Unregister from a registrar. This function is synchronous. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|