Class: RubyAsterisk::ARI::Resources::Channel

Inherits:
Base
  • Object
show all
Defined in:
lib/ruby-asterisk/ari/resources/channel.rb

Overview

Represents an ARI Channel resource with call-control action methods.

Instance Attribute Summary

Attributes inherited from Base

#client, #data

Instance Method Summary collapse

Methods inherited from Base

#id, #initialize

Constructor Details

This class inherits a constructor from RubyAsterisk::ARI::Resources::Base

Instance Method Details

#answerObject



12
13
14
# File 'lib/ruby-asterisk/ari/resources/channel.rb', line 12

def answer
  client.post("/ari/channels/#{id}/answer")
end

#hangupObject



16
17
18
# File 'lib/ruby-asterisk/ari/resources/channel.rb', line 16

def hangup
  client.delete("/ari/channels/#{id}")
end

#play(media, params = {}) ⇒ Object



20
21
22
# File 'lib/ruby-asterisk/ari/resources/channel.rb', line 20

def play(media, params = {})
  client.post("/ari/channels/#{id}/play", { media: media }.merge(params))
end

#ringObject



8
9
10
# File 'lib/ruby-asterisk/ari/resources/channel.rb', line 8

def ring
  client.post("/ari/channels/#{id}/ring")
end