OPAL  Version 3.10.10
SIPEndPoint Class Reference

#include <sipep.h>

Inheritance diagram for SIPEndPoint:
OpalRTPEndPoint OpalEndPoint

Data Structures

struct  ConnectionlessMessageInfo
 
class  InterfaceMonitor
 
struct  RegistrationCompletion
 
struct  RegistrationStatus
 
class  SIP_Work
 
class  WorkThreadPool
 

Public Types

enum  NATBindingRefreshMethod { None, Options, EmptyRequest, NumMethods }
 
typedef SIPSubscribe::SubscriptionStatus SubscriptionStatus
 
typedef PNotifierTemplate< ConnectionlessMessageInfo & > ConnectionlessMessageNotifier
 
- Public Types inherited from OpalEndPoint
enum  Attributes { CanTerminateCall = 1, SupportsE164 = 2 }
 

Public Member Functions

PSafePtr< SIPConnectionGetSIPConnectionWithLock (const PString &token, PSafetyMode mode=PSafeReadWrite, SIP_PDU::StatusCodes *errorCode=NULL)
 
virtual PBoolean IsAcceptedAddress (const SIPURL &toAddr)
 
bool Register (const SIPRegister::Params &params, PString &aor, SIP_PDU::StatusCodes *reason=NULL)
 
bool Register (const SIPRegister::Params &params, PString &aor, bool asynchronous)
 
bool P_DEPRECATED Register (const PString &host, const PString &user=PString::Empty(), const PString &autName=PString::Empty(), const PString &password=PString::Empty(), const PString &authRealm=PString::Empty(), unsigned expire=0, const PTimeInterval &minRetryTime=PMaxTimeInterval, const PTimeInterval &maxRetryTime=PMaxTimeInterval)
 Registration function for backward compatibility. More...
 
PBoolean IsRegistered (const PString &aor, bool includeOffline=false)
 
bool Unregister (const PString &aor)
 
bool UnregisterAll ()
 
unsigned GetRegistrationsCount () const
 
PStringList GetRegistrations (bool includeOffline=false) const
 
virtual void OnRegistrationStatus (const RegistrationStatus &status)
 
virtual void OnRegistrationStatus (const PString &aor, PBoolean wasRegistering, PBoolean reRegistering, SIP_PDU::StatusCodes reason)
 
virtual void OnRegistrationFailed (const PString &aor, SIP_PDU::StatusCodes reason, PBoolean wasRegistering)
 
virtual void OnRegistered (const PString &aor, PBoolean wasRegistering)
 
bool Subscribe (const SIPSubscribe::Params &params, PString &token, bool tokenIsAOR=true)
 
bool Subscribe (SIPSubscribe::PredefinedPackages eventPackage, unsigned expire, const PString &aor)
 
bool IsSubscribed (const PString &aor, bool includeOffline=false)
 
bool IsSubscribed (const PString &eventPackage, const PString &aor, bool includeOffline=false)
 
bool Unsubscribe (const PString &aor, bool invalidateNotifiers=false)
 
bool Unsubscribe (SIPSubscribe::PredefinedPackages eventPackage, const PString &aor, bool invalidateNotifiers=false)
 
bool Unsubscribe (const PString &eventPackage, const PString &aor, bool invalidateNotifiers=false)
 
bool UnsubcribeAll (SIPSubscribe::PredefinedPackages eventPackage)
 
bool UnsubcribeAll (const PString &eventPackage)
 
unsigned GetSubscriptionCount (const SIPSubscribe::EventPackage &eventPackage)
 
PStringList GetSubscriptions (const SIPSubscribe::EventPackage &eventPackage, bool includeOffline=false) const
 
virtual void OnSubscriptionStatus (const SubscriptionStatus &status)
 
virtual void OnSubscriptionStatus (const PString &eventPackage, const SIPURL &uri, bool wasSubscribing, bool reSubscribing, SIP_PDU::StatusCodes reason)
 
virtual void OnSubscriptionStatus (SIPSubscribeHandler &handler, const SIPURL &uri, bool wasSubscribing, bool reSubscribing, SIP_PDU::StatusCodes reason)
 
virtual bool CanNotify (const PString &eventPackage)
 
bool Notify (const SIPURL &targetAddress, const PString &eventPackage, const PObject &body)
 
virtual void OnDialogInfoReceived (const SIPDialogNotification &info)
 
void SendNotifyDialogInfo (const SIPDialogNotification &info)
 
virtual PBoolean Message (OpalIM &message)
 
bool SendMESSAGE (SIPMessage::Params &params)
 
virtual void OnMESSAGECompleted (const SIPMessage::Params &params, SIP_PDU::StatusCodes reason)
 
void SetConnectionlessMessageNotifier (const ConnectionlessMessageNotifier &notifier)
 
virtual bool SendOPTIONS (const SIPOptions::Params &params)
 
virtual void OnOptionsCompleted (const SIPOptions::Params &params, const SIP_PDU &response)
 
bool Publish (const SIPSubscribe::Params &params, const PString &body, PString &aor)
 
bool Publish (const PString &to, const PString &body, unsigned expire=300)
 
PStringList GetPublications (const SIPSubscribe::EventPackage &eventPackage, bool includeOffline=false) const
 
bool PublishPresence (const SIPPresenceInfo &info, unsigned expire=300)
 
virtual void OnPresenceInfoReceived (const SIPPresenceInfo &info)
 
virtual void OnPresenceInfoReceived (const PString &identity, const PString &basic, const PString &note)
 
PBoolean Ping (const PURL &to)
 
SIPConnection::PRACKMode GetDefaultPRACKMode () const
 
void SetDefaultPRACKMode (SIPConnection::PRACKMode mode)
 
void SetMIMEForm (PBoolean v)
 
PBoolean 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 SetProgressTimeout (const PTimeInterval &t)
 
const PTimeInterval & GetProgressTimeout () 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)
 
PSafePtr< SIPTransactionGetTransaction (const PString &transactionID, PSafetyMode mode=PSafeReadWrite)
 
unsigned GetNextCSeq ()
 
void SetRegisteredUserMode (bool v)
 
bool GetRegisteredYserMode () const
 
SIP_PDU::StatusCodes HandleAuthentication (SIPAuthentication *&authentication, unsigned &authenticateErrors, const SIP_PDU &response, const SIPURL &proxyOverride, const PString &username, const PString &password)
 
virtual SIPURL GetRegisteredProxy (const SIPURL &remoteURL)
 
virtual SIPURL GetRegisteredPartyName (const SIPURL &remoteURL, const OpalTransport &transport)
 
virtual SIPURL GetDefaultRegisteredPartyName (const OpalTransport &transport)
 
void AdjustToRegistration (SIP_PDU &pdu, const OpalTransport &transport, const SIPConnection *connection)
 
virtual SIPURL GetLocalURL (const OpalTransport &transport, const PString &userName=PString::Empty())
 
const SIPURLGetProxy () const
 
void SetProxy (const SIPURL &url)
 
void SetProxy (const PString &hostname, const PString &username, const PString &password)
 
int GetDefaultAppearanceCode () const
 
void SetDefaultAppearanceCode (int code)
 
virtual PString GetUserAgent () const
 
void SetUserAgent (const PString &str)
 
virtual unsigned GetAllowedMethods () const
 
void SetNATBindingRefreshMethod (const NATBindingRefreshMethod m)
 
virtual SIPRegisterHandlerCreateRegisterHandler (const SIPRegister::Params &params)
 
virtual void OnStartTransaction (SIPConnection &conn, SIPTransaction &transaction)
 
void UpdateHandlerIndexes (SIPHandler *handler)
 
Construction
 SIPEndPoint (OpalManager &manager, unsigned maxConnectionThreads=10, unsigned maxHandlerThreads=5)
 
 ~SIPEndPoint ()
 
Overrides from OpalEndPoint
virtual void ShutDown ()
 
virtual PString GetDefaultTransport () const
 
virtual PBoolean NewIncomingConnection (OpalTransport *transport)
 
virtual PSafePtr< OpalConnectionMakeConnection (OpalCall &call, const PString &party, void *userData, unsigned int options, OpalConnection::StringOptions *stringOptions)
 
virtual void OnReleased (OpalConnection &connection)
 
virtual PBoolean GarbageCollection ()
 
Customisation call backs
virtual SIPConnectionCreateConnection (OpalCall &call, const PString &token, void *userData, const SIPURL &destination, OpalTransport *transport, SIP_PDU *invite, unsigned int options=0, OpalConnection::StringOptions *stringOptions=NULL)
 
virtual PBoolean SetupTransfer (const PString &token, const PString &callIdentity, const PString &remoteParty, void *userData=NULL)
 
virtual PBoolean ForwardConnection (SIPConnection &connection, const PString &forwardParty)
 
bool ClearDialogContext (const PString &descriptor)
 
bool ClearDialogContext (SIPDialogContext &context)
 
Protocol handling routines
OpalTransportCreateTransport (const SIPURL &remoteURL, const PString &localInterface=PString::Empty())
 
virtual void HandlePDU (OpalTransport &transport)
 
virtual PBoolean OnReceivedPDU (OpalTransport &transport, SIP_PDU *pdu)
 
virtual bool OnReceivedConnectionlessPDU (OpalTransport &transport, SIP_PDU *pdu)
 
virtual void OnReceivedResponse (SIPTransaction &transaction, SIP_PDU &response)
 
virtual PBoolean OnReceivedINVITE (OpalTransport &transport, SIP_PDU *pdu)
 
virtual PBoolean OnReceivedNOTIFY (OpalTransport &transport, SIP_PDU &response)
 
virtual PBoolean OnReceivedREGISTER (OpalTransport &transport, SIP_PDU &pdu)
 
virtual PBoolean OnReceivedSUBSCRIBE (OpalTransport &transport, SIP_PDU &pdu)
 
virtual bool OnReceivedMESSAGE (OpalTransport &transport, SIP_PDU &response)
 
virtual bool OnReceivedOPTIONS (OpalTransport &transport, SIP_PDU &response)
 
virtual void OnTransactionFailed (SIPTransaction &transaction)
 
virtual void OnRTPStatistics (const SIPConnection &connection, const RTP_Session &session) const
 
- Public Member Functions inherited from OpalEndPoint
 OpalEndPoint (OpalManager &manager, const PCaselessString &prefix, unsigned attributes)
 
 ~OpalEndPoint ()
 
void PrintOn (ostream &strm) const
 
PBoolean StartListeners (const PStringArray &interfaces)
 
PBoolean StartListener (const OpalTransportAddress &iface)
 
PBoolean StartListener (OpalListener *listener)
 
virtual PStringArray GetDefaultListeners () const
 
OpalListenerFindListener (const OpalTransportAddress &iface)
 
bool FindListenerForProtocol (const char *proto, OpalTransportAddress &addr)
 
PBoolean StopListener (const OpalTransportAddress &iface)
 
PBoolean RemoveListener (OpalListener *listener)
 
OpalTransportAddressArray GetInterfaceAddresses (PBoolean excludeLocalHost=true, const OpalTransport *associatedTransport=NULL)
 
 PDECLARE_NOTIFIER (PThread, OpalEndPoint, ListenerCallback)
 
virtual void OnNewConnection (OpalCall &call, OpalConnection &connection)
 
virtual PBoolean OnSetUpConnection (OpalConnection &connection)
 
virtual PBoolean OnIncomingConnection (OpalConnection &connection, unsigned options, OpalConnection::StringOptions *stringOptions)
 
virtual void OnProceeding (OpalConnection &connection)
 
virtual void OnAlerting (OpalConnection &connection)
 
virtual OpalConnection::AnswerCallResponse OnAnswerCall (OpalConnection &connection, const PString &caller)
 
virtual void OnConnected (OpalConnection &connection)
 
virtual void OnEstablished (OpalConnection &connection)
 
virtual void OnHold (OpalConnection &connection, bool fromRemote, bool onHold)
 
virtual void OnHold (OpalConnection &connection)
 
virtual PBoolean OnForwarded (OpalConnection &connection, const PString &remoteParty)
 
virtual bool OnTransferNotify (OpalConnection &connection, const PStringToString &info)
 
virtual PBoolean ClearCall (const PString &token, OpalConnection::CallEndReason reason=OpalConnection::EndedByLocalUser, PSyncPoint *sync=NULL)
 
virtual PBoolean ClearCallSynchronous (const PString &token, OpalConnection::CallEndReason reason=OpalConnection::EndedByLocalUser, PSyncPoint *sync=NULL)
 
virtual void ClearAllCalls (OpalConnection::CallEndReason reason=OpalConnection::EndedByLocalUser, PBoolean wait=true)
 
PSafePtr< OpalConnectionGetConnectionWithLock (const PString &token, PSafetyMode mode=PSafeReadWrite)
 
template<class ConnClass >
PSafePtr< ConnClass > GetConnectionWithLockAs (const PString &token, PSafetyMode mode=PSafeReadWrite)
 
PStringList GetAllConnections ()
 
PINDEX GetConnectionCount () const
 
virtual PBoolean HasConnection (const PString &token)
 
virtual void DestroyConnection (OpalConnection *connection)
 
virtual void AdjustMediaFormats (bool local, const OpalConnection &connection, OpalMediaFormatList &mediaFormats) const
 
virtual PBoolean OnOpenMediaStream (OpalConnection &connection, OpalMediaStream &stream)
 
virtual PBoolean CreateVideoInputDevice (const OpalConnection &connection, const OpalMediaFormat &mediaFormat, PVideoInputDevice *&device, PBoolean &autoDelete)
 
virtual PBoolean CreateVideoOutputDevice (const OpalConnection &connection, const OpalMediaFormat &mediaFormat, PBoolean preview, PVideoOutputDevice *&device, PBoolean &autoDelete)
 
virtual void OnUserInputString (OpalConnection &connection, const PString &value)
 
virtual void OnUserInputTone (OpalConnection &connection, char tone, int duration)
 
virtual PString ReadUserInput (OpalConnection &connection, const char *terminators="#\", unsigned lastDigitTimeout=4, unsigned firstDigitTimeout=30)
 
virtual PBoolean Message (const PString &to, const PString &body)
 
virtual PBoolean Message (const PURL &to, const PString &type, const PString &body, PURL &from, PString &conversationId)
 
virtual void OnMessageReceived (const OpalIM &message)
 
virtual void OnMWIReceived (const PString &party, OpalManager::MessageWaitingType type, const PString &extraInfo)
 
OpalManagerGetManager () const
 
const PString & GetPrefixName () const
 
PBoolean HasAttribute (Attributes opt) const
 
WORD GetDefaultSignalPort () const
 
const OpalProductInfoGetProductInfo () const
 
void SetProductInfo (const OpalProductInfo &info)
 
const PString & GetDefaultLocalPartyName () const
 
virtual void SetDefaultLocalPartyName (const PString &name)
 
const PString & GetDefaultDisplayName () const
 
void SetDefaultDisplayName (const PString &name)
 
unsigned GetInitialBandwidth () const
 
void SetInitialBandwidth (unsigned bandwidth)
 
const OpalListenerList & GetListeners () const
 
const OpalConnection::StringOptionsGetDefaultStringOptions () const
 
void SetDefaultStringOptions (const OpalConnection::StringOptions &opts)
 
void SetDefaultStringOption (const PCaselessString &key, const PString &data)
 
OpalConnection::SendUserInputModes GetSendUserInputMode () const
 
void SetSendUserInputMode (OpalConnection::SendUserInputModes mode)
 

Protected Types

enum  { HighPriority = 80, LowPriority = 30 }
 
- Protected Types inherited from OpalRTPEndPoint
typedef std::map< WORD, LocalRtpInfoLocalRtpInfoMap
 

Protected Member Functions

 PDECLARE_NOTIFIER (PThread, SIPEndPoint, TransportThreadMain)
 
 PDECLARE_NOTIFIER (PTimer, SIPEndPoint, NATBindingRefresh)
 
 P_REMOVE_VIRTUAL_VOID (OnReceivedIntervalTooBrief(SIPTransaction &, SIP_PDU &))
 
 P_REMOVE_VIRTUAL_VOID (OnReceivedAuthenticationRequired(SIPTransaction &, SIP_PDU &))
 
 P_REMOVE_VIRTUAL_VOID (OnReceivedOK(SIPTransaction &, SIP_PDU &))
 
 P_REMOVE_VIRTUAL_VOID (OnMessageFailed(const SIPURL &, SIP_PDU::StatusCodes))
 
- Protected Member Functions inherited from OpalEndPoint
OpalConnectionAddConnection (OpalConnection *connection)
 

Protected Attributes

SIPURL proxy
 
PString userAgentString
 
SIPConnection::PRACKMode m_defaultPrackMode
 
bool mimeForm
 
unsigned maxRetries
 
PTimeInterval retryTimeoutMin
 
PTimeInterval retryTimeoutMax
 
PTimeInterval nonInviteTimeout
 
PTimeInterval pduCleanUpTimeout
 
PTimeInterval inviteTimeout
 
PTimeInterval m_progressTimeout
 
PTimeInterval ackTimeout
 
PTimeInterval registrarTimeToLive
 
PTimeInterval notifierTimeToLive
 
PTimeInterval natBindingTimeout
 
bool m_registeredUserMode
 
bool m_shuttingDown
 
SIPHandlersList activeSIPHandlers
 
PStringToString m_receivedConnectionTokens
 
PSafeDictionary< PString, SIPTransactiontransactions
 
PTimer natBindingTimer
 
NATBindingRefreshMethod natMethod
 
PAtomicInteger lastSentCSeq
 
int m_defaultAppearanceCode
 
std::map< PString, RegistrationCompletionm_registrationComplete
 
ConnectionlessMessageNotifier m_onConnectionlessMessage
 
SIPEndPoint::WorkThreadPool m_connectionThreadPool
 
SIPEndPoint::WorkThreadPool m_handlerThreadPool
 
InterfaceMonitor m_highPriorityMonitor
 
InterfaceMonitor m_lowPriorityMonitor
 
bool m_disableTrying
 
- Protected Attributes inherited from OpalRTPEndPoint
LocalRtpInfoMap m_connectionsByRtpLocalPort
 
- Protected Attributes inherited from OpalEndPoint
OpalManagermanager
 
PCaselessString prefixName
 
unsigned attributeBits
 
WORD defaultSignalPort
 
PINDEX m_maxSizeUDP
 
OpalProductInfo productInfo
 
PString defaultLocalPartyName
 
PString defaultDisplayName
 
unsigned initialBandwidth
 
OpalConnection::StringOptions m_defaultStringOptions
 
OpalConnection::SendUserInputModes defaultSendUserInputMode
 
OpalListenerList listeners
 
OpalEndPoint::ConnectionDict connectionsActive
 
PMutex inUseFlag
 

Friends

void InterfaceMonitor::OnAddInterface (const PIPSocket::InterfaceEntry &entry)
 
void InterfaceMonitor::OnRemoveInterface (const PIPSocket::InterfaceEntry &entry)
 

Detailed Description

Session Initiation Protocol endpoint.

Member Typedef Documentation

◆ ConnectionlessMessageNotifier

◆ SubscriptionStatus

Information provided on the subscription status.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
HighPriority 
LowPriority 

◆ NATBindingRefreshMethod

NAT Binding Refresh Method

Enumerator
None 
Options 
EmptyRequest 
NumMethods 

Constructor & Destructor Documentation

◆ SIPEndPoint()

SIPEndPoint::SIPEndPoint ( OpalManager manager,
unsigned  maxConnectionThreads = 10,
unsigned  maxHandlerThreads = 5 
)

Create a new endpoint.

◆ ~SIPEndPoint()

SIPEndPoint::~SIPEndPoint ( )

Destroy endpoint.

Member Function Documentation

◆ AddTransaction()

void SIPEndPoint::AddTransaction ( SIPTransaction transaction)
inline

◆ AdjustToRegistration()

void SIPEndPoint::AdjustToRegistration ( SIP_PDU pdu,
const OpalTransport transport,
const SIPConnection connection 
)

Adjust the outgoing PDU to registered information. Various header fields of the PDU must be adjusted to agree with values provided to/from the active registration for the domain the call is being made to. For example the "From" field must agree exactly with

If no active registration is available, the result of GetLocalURL() on the given transport is set to the Contact field.

◆ CanNotify()

virtual bool SIPEndPoint::CanNotify ( const PString &  eventPackage)
virtual

Indicate notifications for the specified event package are supported.

Parameters
eventPackageEvent package we support

◆ ClearDialogContext() [1/2]

bool SIPEndPoint::ClearDialogContext ( const PString &  descriptor)

Clear a SIP connection by dialog identifer informataion. This function does not require an OPAL connection to operate, it will attempt to send a BYE to the dialog identified by the information in the SIPDialogContext structure.

This feature can be useful for servers that had an "unexpected exit" and various clients it was talking to at the time do not implement the RFC4028 session timers, so continue to try and send media forever. They need to be told to cease and desist.

Parameters
descriptorDescriptor string for call clearance

◆ ClearDialogContext() [2/2]

bool SIPEndPoint::ClearDialogContext ( SIPDialogContext context)
Parameters
contextContext for call clearance

◆ CreateConnection()

virtual SIPConnection* SIPEndPoint::CreateConnection ( OpalCall call,
const PString &  token,
void *  userData,
const SIPURL destination,
OpalTransport transport,
SIP_PDU invite,
unsigned int  options = 0,
OpalConnection::StringOptions stringOptions = NULL 
)
virtual

Create a connection for the SIP endpoint. The default implementation is to create a OpalSIPConnection.

Parameters
callOwner of connection
tokentoken used to identify connection
userDataUser data for connection
destinationDestination for outgoing call
transportTransport INVITE has been received on
inviteOriginal INVITE pdu
optionsconnection options
stringOptionscomplex string options

◆ CreateRegisterHandler()

virtual SIPRegisterHandler* SIPEndPoint::CreateRegisterHandler ( const SIPRegister::Params params)
virtual

◆ CreateTransport()

OpalTransport* SIPEndPoint::CreateTransport ( const SIPURL remoteURL,
const PString &  localInterface = PString::Empty() 
)

Creates an OpalTransport instance, based on the address is interpreted as the remote address to which the transport should connect

◆ ForwardConnection()

virtual PBoolean SIPEndPoint::ForwardConnection ( SIPConnection connection,
const PString &  forwardParty 
)
virtual

Forward the connection using the same token as the specified connection. Return true if the connection is being redirected.

Parameters
connectionConnection to be forwarded
forwardPartyRemote party to forward to

◆ GarbageCollection()

virtual PBoolean SIPEndPoint::GarbageCollection ( )
virtual

Execute garbage collection for endpoint. Returns true if all garbage has been collected. Default behaviour deletes the objects in the connectionsActive list.

Reimplemented from OpalEndPoint.

◆ GetAckTimeout()

const PTimeInterval& SIPEndPoint::GetAckTimeout ( ) const
inline

◆ GetAllowedMethods()

virtual unsigned SIPEndPoint::GetAllowedMethods ( ) const
virtual

Return a bit mask of the allowed SIP methods.

◆ GetDefaultAppearanceCode()

int SIPEndPoint::GetDefaultAppearanceCode ( ) const
inline

Get the default line appearance code for new connections.

◆ GetDefaultPRACKMode()

SIPConnection::PRACKMode SIPEndPoint::GetDefaultPRACKMode ( ) const
inline

Get default mode for PRACK support.

◆ GetDefaultRegisteredPartyName()

virtual SIPURL SIPEndPoint::GetDefaultRegisteredPartyName ( const OpalTransport transport)
virtual

Return the default registered party name URL.

◆ GetDefaultTransport()

virtual PString SIPEndPoint::GetDefaultTransport ( ) const
virtual

Get the default transports for the endpoint type. Overrides the default behaviour to return udp and tcp.

Reimplemented from OpalEndPoint.

◆ GetInviteTimeout()

const PTimeInterval& SIPEndPoint::GetInviteTimeout ( ) const
inline

◆ GetLocalURL()

virtual SIPURL SIPEndPoint::GetLocalURL ( const OpalTransport transport,
const PString &  userName = PString::Empty() 
)
virtual

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.

Parameters
transportTransport on which we can receive new requests
userNameThe user name part of the contact field

◆ GetMaxRetries()

unsigned SIPEndPoint::GetMaxRetries ( ) const
inline

◆ GetMIMEForm()

PBoolean SIPEndPoint::GetMIMEForm ( ) const
inline

◆ GetNATBindingTimeout()

const PTimeInterval& SIPEndPoint::GetNATBindingTimeout ( ) const
inline

◆ GetNextCSeq()

unsigned SIPEndPoint::GetNextCSeq ( )
inline

Return the next CSEQ for the next transaction.

◆ GetNonInviteTimeout()

const PTimeInterval& SIPEndPoint::GetNonInviteTimeout ( ) const
inline

◆ GetNotifierTimeToLive()

const PTimeInterval& SIPEndPoint::GetNotifierTimeToLive ( ) const
inline

◆ GetPduCleanUpTimeout()

const PTimeInterval& SIPEndPoint::GetPduCleanUpTimeout ( ) const
inline

◆ GetProgressTimeout()

const PTimeInterval& SIPEndPoint::GetProgressTimeout ( ) const
inline

◆ GetProxy()

const SIPURL& SIPEndPoint::GetProxy ( ) const
inline

Return the outbound proxy URL, if any.

◆ GetPublications()

PStringList SIPEndPoint::GetPublications ( const SIPSubscribe::EventPackage eventPackage,
bool  includeOffline = false 
) const
inline

Returns a list of published entities.

Parameters
eventPackageEvent package for publication
includeOfflineInclude offline publications

References SIP_PDU::Method_PUBLISH.

◆ GetRegisteredPartyName()

virtual SIPURL SIPEndPoint::GetRegisteredPartyName ( const SIPURL remoteURL,
const OpalTransport transport 
)
virtual

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.

◆ GetRegisteredProxy()

virtual SIPURL SIPEndPoint::GetRegisteredProxy ( const SIPURL remoteURL)
virtual

Return the registered proxy URL for the given host.

◆ GetRegisteredYserMode()

bool SIPEndPoint::GetRegisteredYserMode ( ) const
inline

◆ GetRegistrarTimeToLive()

const PTimeInterval& SIPEndPoint::GetRegistrarTimeToLive ( ) const
inline

◆ GetRegistrations()

PStringList SIPEndPoint::GetRegistrations ( bool  includeOffline = false) const
inline

Returns a list of registered accounts.

Parameters
includeOfflineInclude offline registrations

References SIP_PDU::Method_REGISTER.

◆ GetRegistrationsCount()

unsigned SIPEndPoint::GetRegistrationsCount ( ) const
inline

Returns the number of registered accounts.

References SIP_PDU::Method_REGISTER.

◆ GetRetryTimeoutMax()

const PTimeInterval& SIPEndPoint::GetRetryTimeoutMax ( ) const
inline

◆ GetRetryTimeoutMin()

const PTimeInterval& SIPEndPoint::GetRetryTimeoutMin ( ) const
inline

◆ GetSIPConnectionWithLock()

PSafePtr<SIPConnection> SIPEndPoint::GetSIPConnectionWithLock ( const PString &  token,
PSafetyMode  mode = PSafeReadWrite,
SIP_PDU::StatusCodes errorCode = NULL 
)

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().

Note the token may be a "replaces" style value of the form: "callid;to-tag=tag;from-tag=tag"

Parameters
tokenToken to identify connection
modeLock mode
errorCodeError code if lock fails

◆ GetSubscriptionCount()

unsigned SIPEndPoint::GetSubscriptionCount ( const SIPSubscribe::EventPackage eventPackage)
inline

Returns the number of registered accounts.

Parameters
eventPackageEvent package of subscription

References SIP_PDU::Method_SUBSCRIBE.

◆ GetSubscriptions()

PStringList SIPEndPoint::GetSubscriptions ( const SIPSubscribe::EventPackage eventPackage,
bool  includeOffline = false 
) const
inline

Returns a list of subscribed accounts for package.

Parameters
eventPackageEvent package of subscription
includeOfflineInclude offline subscriptions

References SIP_PDU::Method_REGISTER.

◆ GetTransaction()

PSafePtr<SIPTransaction> SIPEndPoint::GetTransaction ( const PString &  transactionID,
PSafetyMode  mode = PSafeReadWrite 
)
inline

◆ GetUserAgent()

virtual PString SIPEndPoint::GetUserAgent ( ) const
virtual

Get the User Agent for this endpoint. Default behaviour returns an empty string so the SIPConnection builds a valid string from the productInfo data.

These semantics are for backward compatibility.

◆ HandleAuthentication()

SIP_PDU::StatusCodes SIPEndPoint::HandleAuthentication ( SIPAuthentication *&  authentication,
unsigned &  authenticateErrors,
const SIP_PDU response,
const SIPURL proxyOverride,
const PString &  username,
const PString &  password 
)

Return the SIPAuthentication for a specific realm.

◆ HandlePDU()

virtual void SIPEndPoint::HandlePDU ( OpalTransport transport)
virtual

◆ IsAcceptedAddress()

virtual PBoolean SIPEndPoint::IsAcceptedAddress ( const SIPURL toAddr)
virtual

◆ IsRegistered()

PBoolean SIPEndPoint::IsRegistered ( const PString &  aor,
bool  includeOffline = false 
)

Determine if there is a registration for the entity. The "token" parameter string is typically the string returned by the Register() function which is guaranteed to uniquely identify the specific registration.

For backward compatibility, the AOR can also be used, but as it is possible to have two registrations to the same AOR, this should be avoided.

The includeOffline parameter indicates if the caller is interested in if we are, to the best of our knowledge, currently registered (have had recent confirmation) or we are not sure if we are registered or not, but are continually re-trying.

Parameters
aorAOR returned by Register()
includeOfflineInclude offline registrations

◆ IsSubscribed() [1/2]

bool SIPEndPoint::IsSubscribed ( const PString &  aor,
bool  includeOffline = false 
)

Returns true if the endpoint is subscribed to some event for the given to address. The includeOffline parameter indicates if the caller is interested in if we are, to the best of our knowlegde, currently subscribed (have had recent confirmation) or we are not sure if we are subscribed or not, but are continually re-trying.

Parameters
aorAOR returned by Subscribe()
includeOfflineInclude offline subscription

◆ IsSubscribed() [2/2]

bool SIPEndPoint::IsSubscribed ( const PString &  eventPackage,
const PString &  aor,
bool  includeOffline = false 
)
Parameters
eventPackageEvent package being unsubscribed
aorAddress-of-record for subscription
includeOfflineInclude offline subscription

◆ MakeConnection()

virtual PSafePtr<OpalConnection> SIPEndPoint::MakeConnection ( OpalCall call,
const PString &  party,
void *  userData,
unsigned int  options,
OpalConnection::StringOptions stringOptions 
)
virtual

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.

Parameters
callOwner of connection
partyRemote party to call
userDataArbitrary data to pass to connection
optionsoptions to pass to conneciton
stringOptionscomplex string options

Implements OpalEndPoint.

◆ Message()

virtual PBoolean SIPEndPoint::Message ( OpalIM message)
virtual

Send IM text

Reimplemented from OpalEndPoint.

◆ NewIncomingConnection()

virtual PBoolean SIPEndPoint::NewIncomingConnection ( OpalTransport transport)
virtual

Handle new incoming connection from listener.

The default behaviour does nothing.

Parameters
transportTransport connection came in on

Reimplemented from OpalEndPoint.

◆ Notify()

bool SIPEndPoint::Notify ( const SIPURL targetAddress,
const PString &  eventPackage,
const PObject &  body 
)

Send notification to all remotes that are subcribed to the event package.

Parameters
targetAddressAddress that was subscribed
eventPackageEvent package for notification
bodyBody of notification

◆ OnDialogInfoReceived()

virtual void SIPEndPoint::OnDialogInfoReceived ( const SIPDialogNotification info)
virtual

Callback called when dialog NOTIFY message is received

Parameters
infoInformation on dialog state change

◆ OnMESSAGECompleted()

virtual void SIPEndPoint::OnMESSAGECompleted ( const SIPMessage::Params params,
SIP_PDU::StatusCodes  reason 
)
virtual

Callback called when a message completes in any manner

◆ OnOptionsCompleted()

virtual void SIPEndPoint::OnOptionsCompleted ( const SIPOptions::Params params,
const SIP_PDU response 
)
virtual

Callback called when an OPTIONS command is completed, either successfully or with error.

Parameters
paramsOriginal parameter for SendOPTIONS() call
responseResponse packet, check GetStatusCode() for result

◆ OnPresenceInfoReceived() [1/2]

virtual void SIPEndPoint::OnPresenceInfoReceived ( const SIPPresenceInfo info)
virtual

Callback called when presence is received

Parameters
infoPresence info publicised

◆ OnPresenceInfoReceived() [2/2]

virtual void SIPEndPoint::OnPresenceInfoReceived ( const PString &  identity,
const PString &  basic,
const PString &  note 
)
virtual

◆ OnReceivedConnectionlessPDU()

virtual bool SIPEndPoint::OnReceivedConnectionlessPDU ( OpalTransport transport,
SIP_PDU pdu 
)
virtual

Handle an incoming SIP PDU not assigned to any connection

◆ OnReceivedINVITE()

virtual PBoolean SIPEndPoint::OnReceivedINVITE ( OpalTransport transport,
SIP_PDU pdu 
)
virtual

Handle an incoming INVITE request.

◆ OnReceivedMESSAGE()

virtual bool SIPEndPoint::OnReceivedMESSAGE ( OpalTransport transport,
SIP_PDU response 
)
virtual

Handle an incoming MESSAGE PDU.

◆ OnReceivedNOTIFY()

virtual PBoolean SIPEndPoint::OnReceivedNOTIFY ( OpalTransport transport,
SIP_PDU response 
)
virtual

Handle an incoming NOTIFY PDU.

◆ OnReceivedOPTIONS()

virtual bool SIPEndPoint::OnReceivedOPTIONS ( OpalTransport transport,
SIP_PDU response 
)
virtual

Handle an incoming OPTIONS PDU.

◆ OnReceivedPDU()

virtual PBoolean SIPEndPoint::OnReceivedPDU ( OpalTransport transport,
SIP_PDU pdu 
)
virtual

Handle an incoming SIP PDU that has been full decoded

◆ OnReceivedREGISTER()

virtual PBoolean SIPEndPoint::OnReceivedREGISTER ( OpalTransport transport,
SIP_PDU pdu 
)
virtual

Handle an incoming REGISTER PDU.

◆ OnReceivedResponse()

virtual void SIPEndPoint::OnReceivedResponse ( SIPTransaction transaction,
SIP_PDU response 
)
virtual

Handle an incoming response PDU.

◆ OnReceivedSUBSCRIBE()

virtual PBoolean SIPEndPoint::OnReceivedSUBSCRIBE ( OpalTransport transport,
SIP_PDU pdu 
)
virtual

Handle an incoming SUBSCRIBE PDU.

◆ OnRegistered()

virtual void SIPEndPoint::OnRegistered ( const PString &  aor,
PBoolean  wasRegistering 
)
virtual

Callback called when a registration or an unregistration is successful. Deprecated, maintained for backward compatibility, use OnRegistrationStatus().

◆ OnRegistrationFailed()

virtual void SIPEndPoint::OnRegistrationFailed ( const PString &  aor,
SIP_PDU::StatusCodes  reason,
PBoolean  wasRegistering 
)
virtual

Callback called when a registration to a SIP registrars fails. Deprecated, maintained for backward compatibility, use OnRegistrationStatus().

◆ OnRegistrationStatus() [1/2]

virtual void SIPEndPoint::OnRegistrationStatus ( const RegistrationStatus status)
virtual

Callback called when a registration to a SIP registrar status.

Parameters
statusStatus of registration request

◆ OnRegistrationStatus() [2/2]

virtual void SIPEndPoint::OnRegistrationStatus ( const PString &  aor,
PBoolean  wasRegistering,
PBoolean  reRegistering,
SIP_PDU::StatusCodes  reason 
)
virtual

◆ OnReleased()

virtual void SIPEndPoint::OnReleased ( OpalConnection connection)
virtual

A call back function whenever a connection is broken. This function can do any internal cleaning up and waiting on background threads that may be using the connection object.

Note that there is not a one to one relationship with the OnEstablishedConnection() function. This function may be called without that function being called. For example if MakeConnection() was used but the call never completed.

Classes that override this function should make sure they call the ancestor version for correct operation.

An application will not typically call this function as it is used by the OpalManager during a release of the connection.

The default behaviour removes the connection from the internal database and calls the OpalManager function of the same name.

Parameters
connectionConnection that was established

Reimplemented from OpalEndPoint.

◆ OnRTPStatistics()

virtual void SIPEndPoint::OnRTPStatistics ( const SIPConnection connection,
const RTP_Session session 
) const
virtual

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.

Parameters
connectionConnection for the channel
sessionSession with statistics

◆ OnStartTransaction()

virtual void SIPEndPoint::OnStartTransaction ( SIPConnection conn,
SIPTransaction transaction 
)
virtual

◆ OnSubscriptionStatus() [1/3]

virtual void SIPEndPoint::OnSubscriptionStatus ( const SubscriptionStatus status)
virtual

Callback called when a subscription to a SIP UA status changes.

Parameters
statusStatus of subscription request

◆ OnSubscriptionStatus() [2/3]

virtual void SIPEndPoint::OnSubscriptionStatus ( const PString &  eventPackage,
const SIPURL uri,
bool  wasSubscribing,
bool  reSubscribing,
SIP_PDU::StatusCodes  reason 
)
virtual

Callback called when a subscription to a SIP UA status changes. Now deprecated - called by OnSubscriptionStatus that accepts SIPHandler

Parameters
eventPackageEvent package subscribed to
uriTarget URI for the subscription.
wasSubscribingIndication the subscribing or unsubscribing
reSubscribingIf subscribing then indication was refeshing subscription
reasonStatus of subscription

◆ OnSubscriptionStatus() [3/3]

virtual void SIPEndPoint::OnSubscriptionStatus ( SIPSubscribeHandler handler,
const SIPURL uri,
bool  wasSubscribing,
bool  reSubscribing,
SIP_PDU::StatusCodes  reason 
)
virtual
Parameters
handlerEvent subscription paramaters
uriTarget URI for the subscription.
wasSubscribingIndication the subscribing or unsubscribing
reSubscribingIf subscribing then indication was refeshing subscription
reasonStatus of subscription

◆ OnTransactionFailed()

virtual void SIPEndPoint::OnTransactionFailed ( SIPTransaction transaction)
virtual

Handle a SIP packet transaction failure

◆ P_REMOVE_VIRTUAL_VOID() [1/4]

SIPEndPoint::P_REMOVE_VIRTUAL_VOID ( OnReceivedIntervalTooBrief(SIPTransaction &, SIP_PDU &)  )
protected

◆ P_REMOVE_VIRTUAL_VOID() [2/4]

SIPEndPoint::P_REMOVE_VIRTUAL_VOID ( OnReceivedAuthenticationRequired(SIPTransaction &, SIP_PDU &)  )
protected

◆ P_REMOVE_VIRTUAL_VOID() [3/4]

SIPEndPoint::P_REMOVE_VIRTUAL_VOID ( OnReceivedOK(SIPTransaction &, SIP_PDU &)  )
protected

◆ P_REMOVE_VIRTUAL_VOID() [4/4]

SIPEndPoint::P_REMOVE_VIRTUAL_VOID ( OnMessageFailed(const SIPURL &, SIP_PDU::StatusCodes )
protected

◆ PDECLARE_NOTIFIER() [1/2]

SIPEndPoint::PDECLARE_NOTIFIER ( PThread  ,
SIPEndPoint  ,
TransportThreadMain   
)
protected

◆ PDECLARE_NOTIFIER() [2/2]

SIPEndPoint::PDECLARE_NOTIFIER ( PTimer  ,
SIPEndPoint  ,
NATBindingRefresh   
)
protected

◆ Ping()

PBoolean SIPEndPoint::Ping ( const PURL &  to)

Send a SIP PING to the remote host

◆ Publish() [1/2]

bool SIPEndPoint::Publish ( const SIPSubscribe::Params params,
const PString &  body,
PString &  aor 
)

Publish new state information. A expire time of zero will cease to automatically update the publish.

◆ Publish() [2/2]

bool SIPEndPoint::Publish ( const PString &  to,
const PString &  body,
unsigned  expire = 300 
)
Parameters
toAddress to send PUBLISH
bodyBody of PUBLISH
expireTime between automatic updates in seconds.

◆ PublishPresence()

bool SIPEndPoint::PublishPresence ( const SIPPresenceInfo info,
unsigned  expire = 300 
)

Publish new state information. Only the basic & note fields of the PIDF+xml are supported for now.

Parameters
infoPresence info to publish
expireRefresh time

◆ Register() [1/3]

bool SIPEndPoint::Register ( const SIPRegister::Params params,
PString &  aor,
SIP_PDU::StatusCodes reason = NULL 
)

Register an entity 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 params.m_addressOfRecord field is the only field required, though typically params.m_password is also required. A registration for the user part of params.m_addressOfRecord is made to the a registrar associated with the domain part of the field. The authentication identity is the same as the user field, though this may be set to soemthing different via the params.m_authID field.

The params.m_registrarAddress may indicate the specific hostname to use for the registrar rather than using the domain part of params.m_addressOfRecord field.

To aid in flexbility if the params.m_addressOfRecord does not contain a domain and the params.m_registrarAddress does, the the AOR is constructed from them.

The params.m_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.

The Contact address is normally constructed from the listeners active on the SIPEndPoint. This may be overridden to an explicit value via the params.m_contactAddress field.

The returned "token" is a string that can be used in functions such as Unregister() or IsRegistered(). While it possible to use the AOR for those functions, it is not recommended as a) there may be more than one registration for an AOR and b) the AOR may be constructed from

Parameters
paramsRegistration parameters
aorResultant address-of-record for unregister
reasonIf not null, wait for completion, may take some time

◆ Register() [2/3]

bool SIPEndPoint::Register ( const SIPRegister::Params params,
PString &  aor,
bool  asynchronous 
)
Parameters
paramsRegistration parameters
aorResultant address-of-record for unregister
asynchronousWait for completion, may take some time

◆ Register() [3/3]

bool P_DEPRECATED SIPEndPoint::Register ( const PString &  host,
const PString &  user = PString::Empty(),
const PString &  autName = PString::Empty(),
const PString &  password = PString::Empty(),
const PString &  authRealm = PString::Empty(),
unsigned  expire = 0,
const PTimeInterval &  minRetryTime = PMaxTimeInterval,
const PTimeInterval &  maxRetryTime = PMaxTimeInterval 
)

Registration function for backward compatibility.

◆ SendMESSAGE()

bool SIPEndPoint::SendMESSAGE ( SIPMessage::Params params)

Send SIP message

◆ SendNotifyDialogInfo()

void SIPEndPoint::SendNotifyDialogInfo ( const SIPDialogNotification info)
Parameters
infoInformation on dialog state change

◆ SendOPTIONS()

virtual bool SIPEndPoint::SendOPTIONS ( const SIPOptions::Params params)
virtual

Send SIP OPTIONS

◆ SetAckTimeout()

void SIPEndPoint::SetAckTimeout ( const PTimeInterval &  t)
inline

◆ SetConnectionlessMessageNotifier()

void SIPEndPoint::SetConnectionlessMessageNotifier ( const ConnectionlessMessageNotifier notifier)
inline

◆ SetDefaultAppearanceCode()

void SIPEndPoint::SetDefaultAppearanceCode ( int  code)
inline

Set the default line appearance code for new connections.

◆ SetDefaultPRACKMode()

void SIPEndPoint::SetDefaultPRACKMode ( SIPConnection::PRACKMode  mode)
inline

Set default mode for PRACK support.

◆ SetInviteTimeout()

void SIPEndPoint::SetInviteTimeout ( const PTimeInterval &  t)
inline

◆ SetMaxRetries()

void SIPEndPoint::SetMaxRetries ( unsigned  r)
inline

◆ SetMIMEForm()

void SIPEndPoint::SetMIMEForm ( PBoolean  v)
inline

◆ SetNATBindingRefreshMethod()

void SIPEndPoint::SetNATBindingRefreshMethod ( const NATBindingRefreshMethod  m)
inline

Set the NAT Binding Refresh Method

◆ SetNATBindingTimeout()

void SIPEndPoint::SetNATBindingTimeout ( const PTimeInterval &  t)
inline

◆ SetNonInviteTimeout()

void SIPEndPoint::SetNonInviteTimeout ( const PTimeInterval &  t)
inline

◆ SetNotifierTimeToLive()

void SIPEndPoint::SetNotifierTimeToLive ( const PTimeInterval &  t)
inline

◆ SetPduCleanUpTimeout()

void SIPEndPoint::SetPduCleanUpTimeout ( const PTimeInterval &  t)
inline

◆ SetProgressTimeout()

void SIPEndPoint::SetProgressTimeout ( const PTimeInterval &  t)
inline

◆ SetProxy() [1/2]

void SIPEndPoint::SetProxy ( const SIPURL url)

Set the outbound proxy URL.

◆ SetProxy() [2/2]

void SIPEndPoint::SetProxy ( const PString &  hostname,
const PString &  username,
const PString &  password 
)

Set the outbound proxy URL.

◆ SetRegisteredUserMode()

void SIPEndPoint::SetRegisteredUserMode ( bool  v)
inline

Set registration search mode. If true then only the user indicated as "local" address (e.g. from OPAL_OPT_CALLING_PARTY_NAME etc) by the will be used in searches of the registrations. No default to first user of the same domain will be performed.

◆ SetRegistrarTimeToLive()

void SIPEndPoint::SetRegistrarTimeToLive ( const PTimeInterval &  t)
inline

◆ SetRetryTimeouts()

void SIPEndPoint::SetRetryTimeouts ( const PTimeInterval &  t1,
const PTimeInterval &  t2 
)
inline

◆ SetupTransfer()

virtual PBoolean SIPEndPoint::SetupTransfer ( const PString &  token,
const PString &  callIdentity,
const PString &  remoteParty,
void *  userData = NULL 
)
virtual

Setup a connection transfer a connection for the SIP endpoint.

Parameters
tokenExisting connection to be transferred
callIdentityCall identity of the secondary call (if it exists)
remotePartyRemote party to transfer the existing call to
userDatauser data to pass to CreateConnection

◆ SetUserAgent()

void SIPEndPoint::SetUserAgent ( const PString &  str)
inline

Set the User Agent for the endpoint.

◆ ShutDown()

virtual void SIPEndPoint::ShutDown ( )
virtual

Shut down the endpoint, this is called by the OpalManager just before destroying the object and can be handy to make sure some things are stopped before the vtable gets clobbered.

Reimplemented from OpalEndPoint.

◆ Subscribe() [1/2]

bool SIPEndPoint::Subscribe ( const SIPSubscribe::Params params,
PString &  token,
bool  tokenIsAOR = true 
)

Subscribe to an agent to get event notifications. This function is asynchronous to permit several subscriptions to occur at the same time. It can be called several times for different hosts and users.

The params.m_eventPackage and params.m_addressOfRecord field are the only field required, though typically params.m_password is also required. A subscription for the user part of params.m_addressOfRecord is made to the an agent associated with the domain part of the field. The authentication identity is the same as the user field, though this may be set to soemthing different via the params.m_authID field.

The params.m_agentAddress may indicate the specific hostname to use for the registrar rather than using the domain part of params.m_addressOfRecord field.

To aid in flexbility if the params.m_addressOfRecord does not contain a domain and the params.m_agentAddress does, the the AOR is constructed from them.

The params.m_realm can be specified when subcribing, 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.

The Contact address is normally constructed from the SIPEndPoint local identity.

The returned "token" is a string that can be used in functions such as Unregister() or IsRegistered(). While it possible to use the user supplied AOR for those functions, it is not recommended as a) there may be more than one registration for an AOR and b) the AOR may be constructed from fields in the params argument and not be what the user expects.

The tokenIsAOR can also be used, if false, to return the globally unique ID used for the handler. This is the preferred method, even though the default is to not use it, that is for backward compatibility reasons.

Parameters
paramsSubscription parameters
tokenResultant token for unsubscribe
tokenIsAORToken is the address-of-record

◆ Subscribe() [2/2]

bool SIPEndPoint::Subscribe ( SIPSubscribe::PredefinedPackages  eventPackage,
unsigned  expire,
const PString &  aor 
)
Parameters
eventPackageEvent package being unsubscribed
expireExpiry time in seconds
aorAddress-of-record for subscription

◆ Unregister()

bool SIPEndPoint::Unregister ( const PString &  aor)

Unregister the address-of-record from a registrar. The "token" parameter string is typically the string returned by the Register() function which is guaranteed to uniquely identify the specific registration.

For backward compatibility, the AOR can also be used, but as it is possible to have two registrations to the same AOR, this should be avoided.

Parameters
aorAOR returned by Register()

◆ UnregisterAll()

bool SIPEndPoint::UnregisterAll ( )

Unregister all current registrations. Returns true if at least one registrar is unregistered.

◆ UnsubcribeAll() [1/2]

bool SIPEndPoint::UnsubcribeAll ( SIPSubscribe::PredefinedPackages  eventPackage)

Unsubscribe all current subscriptions. Returns true if at least one subscription is unsubscribed.

Parameters
eventPackageEvent package being unsubscribed

◆ UnsubcribeAll() [2/2]

bool SIPEndPoint::UnsubcribeAll ( const PString &  eventPackage)
Parameters
eventPackageEvent package being unsubscribed

◆ Unsubscribe() [1/3]

bool SIPEndPoint::Unsubscribe ( const PString &  aor,
bool  invalidateNotifiers = false 
)

Unsubscribe a current subscriptions. The "token" parameter string is typically the string returned by the Subscribe() function which is guaranteed to uniquely identify the specific registration.

For backward compatibility, the AOR can also be used, but as it is possible to have two susbcriptions to the same AOR, this should be avoided.

Parameters
aorUnique token for registration
invalidateNotifiersNotifiers in SIPSubscribe::Params are to be reset

◆ Unsubscribe() [2/3]

bool SIPEndPoint::Unsubscribe ( SIPSubscribe::PredefinedPackages  eventPackage,
const PString &  aor,
bool  invalidateNotifiers = false 
)
Parameters
eventPackageEvent package being unsubscribed
aorAddress-of-record for subscription
invalidateNotifiersNotifiers in SIPSubscribe::Params are to be reset

◆ Unsubscribe() [3/3]

bool SIPEndPoint::Unsubscribe ( const PString &  eventPackage,
const PString &  aor,
bool  invalidateNotifiers = false 
)
Parameters
eventPackageEvent package being unsubscribed
aorAddress-of-record for subscription
invalidateNotifiersNotifiers in SIPSubscribe::Params are to be reset

◆ UpdateHandlerIndexes()

void SIPEndPoint::UpdateHandlerIndexes ( SIPHandler handler)
inline

Friends And Related Function Documentation

◆ InterfaceMonitor::OnAddInterface

void InterfaceMonitor::OnAddInterface ( const PIPSocket::InterfaceEntry &  entry)
friend

◆ InterfaceMonitor::OnRemoveInterface

void InterfaceMonitor::OnRemoveInterface ( const PIPSocket::InterfaceEntry &  entry)
friend

Field Documentation

◆ ackTimeout

PTimeInterval SIPEndPoint::ackTimeout
protected

◆ activeSIPHandlers

SIPHandlersList SIPEndPoint::activeSIPHandlers
protected

◆ inviteTimeout

PTimeInterval SIPEndPoint::inviteTimeout
protected

◆ lastSentCSeq

PAtomicInteger SIPEndPoint::lastSentCSeq
protected

◆ m_connectionThreadPool

SIPEndPoint::WorkThreadPool SIPEndPoint::m_connectionThreadPool
protected

◆ m_defaultAppearanceCode

int SIPEndPoint::m_defaultAppearanceCode
protected

◆ m_defaultPrackMode

SIPConnection::PRACKMode SIPEndPoint::m_defaultPrackMode
protected

◆ m_disableTrying

bool SIPEndPoint::m_disableTrying
protected

◆ m_handlerThreadPool

SIPEndPoint::WorkThreadPool SIPEndPoint::m_handlerThreadPool
protected

◆ m_highPriorityMonitor

InterfaceMonitor SIPEndPoint::m_highPriorityMonitor
protected

◆ m_lowPriorityMonitor

InterfaceMonitor SIPEndPoint::m_lowPriorityMonitor
protected

◆ m_onConnectionlessMessage

ConnectionlessMessageNotifier SIPEndPoint::m_onConnectionlessMessage
protected

◆ m_progressTimeout

PTimeInterval SIPEndPoint::m_progressTimeout
protected

◆ m_receivedConnectionTokens

PStringToString SIPEndPoint::m_receivedConnectionTokens
protected

◆ m_registeredUserMode

bool SIPEndPoint::m_registeredUserMode
protected

◆ m_registrationComplete

std::map<PString, RegistrationCompletion> SIPEndPoint::m_registrationComplete
protected

◆ m_shuttingDown

bool SIPEndPoint::m_shuttingDown
protected

◆ maxRetries

unsigned SIPEndPoint::maxRetries
protected

◆ mimeForm

bool SIPEndPoint::mimeForm
protected

◆ natBindingTimeout

PTimeInterval SIPEndPoint::natBindingTimeout
protected

◆ natBindingTimer

PTimer SIPEndPoint::natBindingTimer
protected

◆ natMethod

NATBindingRefreshMethod SIPEndPoint::natMethod
protected

◆ nonInviteTimeout

PTimeInterval SIPEndPoint::nonInviteTimeout
protected

◆ notifierTimeToLive

PTimeInterval SIPEndPoint::notifierTimeToLive
protected

◆ pduCleanUpTimeout

PTimeInterval SIPEndPoint::pduCleanUpTimeout
protected

◆ proxy

SIPURL SIPEndPoint::proxy
protected

◆ registrarTimeToLive

PTimeInterval SIPEndPoint::registrarTimeToLive
protected

◆ retryTimeoutMax

PTimeInterval SIPEndPoint::retryTimeoutMax
protected

◆ retryTimeoutMin

PTimeInterval SIPEndPoint::retryTimeoutMin
protected

◆ transactions

PSafeDictionary<PString, SIPTransaction> SIPEndPoint::transactions
protected

◆ userAgentString

PString SIPEndPoint::userAgentString
protected

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