Skip to content

Latest commit

 

History

History
46 lines (32 loc) · 4.43 KB

sip.js.useragentclient.md

File metadata and controls

46 lines (32 loc) · 4.43 KB

Home > sip.js > UserAgentClient

UserAgentClient class

User Agent Client (UAC).

Signature:

export declare class UserAgentClient implements OutgoingRequest 

Remarks

A user agent client is a logical entity that creates a new request, and then uses the client transaction state machinery to send it. The role of UAC lasts only for the duration of that transaction. In other words, if a piece of software initiates a request, it acts as a UAC for the duration of that transaction. If it receives a request later, it assumes the role of a user agent server for the processing of that transaction. https://tools.ietf.org/html/rfc3261\#section-6

Constructors

Constructor Modifiers Description
(constructor)(transactionConstructor, core, message, delegate) Constructs a new instance of the UserAgentClient class

Properties

Property Modifiers Type Description
core UserAgentCore
delegate OutgoingRequestDelegate | undefined
logger Logger
loggerFactory LoggerFactory
message OutgoingRequestMessage
transaction ClientTransaction The transaction associated with this request.

Methods

Method Modifiers Description
authenticationGuard(message, dialog) If a 401 (Unauthorized) or 407 (Proxy Authentication Required) response is received, the UAC SHOULD follow the authorization procedures of Section 22.2 and Section 22.3 to retry the request with credentials. https://tools.ietf.org/html/rfc3261\#section-8.1.3.5 22 Usage of HTTP Authentication https://tools.ietf.org/html/rfc3261\#section-22 22.1 Framework https://tools.ietf.org/html/rfc3261\#section-22.1 22.2 User-to-User Authentication https://tools.ietf.org/html/rfc3261\#section-22.2 22.3 Proxy-to-User Authentication https://tools.ietf.org/html/rfc3261\#section-22.3FIXME: This "guard for and retry the request with credentials" implementation is not complete and at best minimally passable.
cancel(reason, options) Since requests other than INVITE are responded to immediately, sending a CANCEL for a non-INVITE request would always create a race condition. A CANCEL request SHOULD NOT be sent to cancel a request other than INVITE. https://tools.ietf.org/html/rfc3261\#section-9.1
dispose()
onRequestTimeout() 8.1.3.1 Transaction Layer Errors In some cases, the response returned by the transaction layer will not be a SIP message, but rather a transaction layer error. When a timeout error is received from the transaction layer, it MUST be treated as if a 408 (Request Timeout) status code has been received. If a fatal transport error is reported by the transport layer (generally, due to fatal ICMP errors in UDP or connection failures in TCP), the condition MUST be treated as a 503 (Service Unavailable) status code. https://tools.ietf.org/html/rfc3261\#section-8.1.3.1
onTransportError(error) 8.1.3.1 Transaction Layer Errors In some cases, the response returned by the transaction layer will not be a SIP message, but rather a transaction layer error. When a timeout error is received from the transaction layer, it MUST be treated as if a 408 (Request Timeout) status code has been received. If a fatal transport error is reported by the transport layer (generally, due to fatal ICMP errors in UDP or connection failures in TCP), the condition MUST be treated as a 503 (Service Unavailable) status code. https://tools.ietf.org/html/rfc3261\#section-8.1.3.1
receiveResponse(message) Receive a response from the transaction layer.