Exception: LiveKit::SipCallError
- Inherits:
-
ServerError
- Object
- StandardError
- ServerError
- LiveKit::SipCallError
- Defined in:
- lib/livekit/errors.rb
Overview
Raised when a SIP dialing call (create_sip_participant / transfer_sip_participant) fails with a SIP response status. The SIP code and reason are exposed directly; any other metadata remains available via LiveKit::ServerError#metadata.
Instance Attribute Summary
Attributes inherited from ServerError
Instance Method Summary collapse
-
#message ⇒ Object
(also: #to_s)
A clear, SIP-specific representation, including any extra metadata.
-
#sip_status ⇒ String?
The SIP reason phrase, e.g.
-
#sip_status_code ⇒ Integer?
The SIP response code, e.g.
Methods inherited from ServerError
Constructor Details
This class inherits a constructor from LiveKit::ServerError
Instance Method Details
#message ⇒ Object Also known as: to_s
A clear, SIP-specific representation, including any extra metadata.
46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/livekit/errors.rb', line 46 def code_str = ["sip_status_code"] return super if code_str.nil? reason = ["sip_status"] result = "SIP call failed: #{code_str}" result += " #{reason}" if reason && !reason.empty? result += " (#{code})" extra = .reject { |k, _| %w[sip_status_code sip_status error_details].include?(k) } result += " [#{extra.map { |k, v| "#{k}=#{v}" }.join(", ")}]" unless extra.empty? result end |
#sip_status ⇒ String?
Returns the SIP reason phrase, e.g. "Busy Here".
41 42 43 |
# File 'lib/livekit/errors.rb', line 41 def sip_status ["sip_status"] end |
#sip_status_code ⇒ Integer?
Returns the SIP response code, e.g. 486 (Busy Here).
35 36 37 38 |
# File 'lib/livekit/errors.rb', line 35 def sip_status_code raw = ["sip_status_code"] raw && raw.to_i end |