class Ari::Endpoint

Attributes

channel_ids[R]
resource[R]
state[R]
technology[R]

Public Class Methods

get(options = {}) click to toggle source

GET /endpoints/%{tech}/%{resource}

Single endpoint

Parameters:

tech (required) - Technology of the endpoint resource (required) - ID of the endpoint

# File lib/ari/resources/endpoint.rb, line 80
def self.get(options = {})
  raise ArgumentError.new("Parameter tech must be passed in options hash.") unless options[:tech]
  raise ArgumentError.new("Parameter resource must be passed in options hash.") unless options[:resource]
  path = '/endpoints/%{tech}/%{resource}' % options
  response = client(options).get(path, options)
  Endpoint.new(response.merge(client: options[:client]))
end
list(options = {}) click to toggle source

GET /endpoints

Asterisk endpoints

# File lib/ari/resources/endpoint.rb, line 23
def self.list(options = {})
  path = '/endpoints'
  response = client(options).get(path, options)
  response.map { |hash| Endpoint.new(hash.merge(client: options[:client])) }
end
listByTech(options = {})
Alias for: list_by_tech
list_by_tech(options = {}) click to toggle source

GET /endpoints/%{tech}

Asterisk endpoints

Parameters:

tech (required) - Technology of the endpoints (sip,iax2,…)

# File lib/ari/resources/endpoint.rb, line 58
def self.list_by_tech(options = {})
  raise ArgumentError.new("Parameter tech must be passed in options hash.") unless options[:tech]
  path = '/endpoints/%{tech}' % options
  response = client(options).get(path, options)
  response.map { |hash| Endpoint.new(hash.merge(client: options[:client])) }
end
Also aliased as: listByTech
sendMessage(options = {})
Alias for: send_message
sendMessageToEndpoint(options = {})
send_message(options = {}) click to toggle source

PUT /endpoints/sendMessage

Send a message to some technology URI or endpoint.

Parameters:

to (required) - The endpoint resource or technology specific URI to send the message to. Valid resources are sip, pjsip, and xmpp. from (required) - The endpoint resource or technology specific identity to send this message from. Valid resources are sip, pjsip, and xmpp. body - The body of the message variables -

# File lib/ari/resources/endpoint.rb, line 41
def self.send_message(options = {})
  raise ArgumentError.new("Parameter to must be passed in options hash.") unless options[:to]
  raise ArgumentError.new("Parameter from must be passed in options hash.") unless options[:from]
  path = '/endpoints/sendMessage'
  response = client(options).put(path, options)
end
Also aliased as: sendMessage
send_message_to_endpoint(options = {}) click to toggle source

PUT /endpoints/%{tech}/%{resource}/sendMessage

Send a message to some endpoint in a technology.

Parameters:

tech (required) - Technology of the endpoint resource (required) - ID of the endpoint from (required) - The endpoint resource or technology specific identity to send this message from. Valid resources are sip, pjsip, and xmpp. body - The body of the message variables -

# File lib/ari/resources/endpoint.rb, line 105
def self.send_message_to_endpoint(options = {})
  raise ArgumentError.new("Parameter tech must be passed in options hash.") unless options[:tech]
  raise ArgumentError.new("Parameter resource must be passed in options hash.") unless options[:resource]
  raise ArgumentError.new("Parameter from must be passed in options hash.") unless options[:from]
  path = '/endpoints/%{tech}/%{resource}/sendMessage' % options
  response = client(options).put(path, options)
end
Also aliased as: sendMessageToEndpoint

Public Instance Methods

get(options = {}) click to toggle source
# File lib/ari/resources/endpoint.rb, line 88
def get(options = {})
  self.class.get(options.merge(endpointId: self.id, client: @client))
end
list_by_tech(options = {}) click to toggle source
# File lib/ari/resources/endpoint.rb, line 66
def list_by_tech(options = {})
  self.class.list_by_tech(options.merge(endpointId: self.id, client: @client))
end
send_message_to_endpoint(options = {}) click to toggle source
# File lib/ari/resources/endpoint.rb, line 114
def send_message_to_endpoint(options = {})
  self.class.send_message_to_endpoint(options.merge(endpointId: self.id, client: @client))
end