Class: Kazoo::Conference

Inherits:
Object
  • Object
show all
Defined in:
lib/kazoo/conference.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(auth) ⇒ Conference

Returns a new instance of Conference.



5
6
7
8
# File 'lib/kazoo/conference.rb', line 5

def initialize(auth)
  instance_variable_set :@auth, auth
  @base_uri = 'http://' + @auth.host + ":" + @auth.port + '/' + @auth.version + '/' + 'accounts/' + @auth.
end

Instance Attribute Details

#authObject (readonly)

Returns the value of attribute auth.



3
4
5
# File 'lib/kazoo/conference.rb', line 3

def auth
  @auth
end

Instance Method Details

#create_callflow(phone_numbers) ⇒ Object



10
11
12
13
14
# File 'lib/kazoo/conference.rb', line 10

def create_callflow(phone_numbers)
  callflow_url = @base_uri  + '/callflows?auth_token=' + @auth.token
  payload = {'data' => {'numbers' => phone_numbers, 'flow' => {'module' => "conference", 'data' => {}, 'children' => {}}}}
  Nestful.json_put(callflow_url, {:params => payload})
end

#create_room(name, conference_numbers) ⇒ Object



16
17
18
19
20
# File 'lib/kazoo/conference.rb', line 16

def create_room(name, conference_numbers)
  room_url = @base_uri + '/conferences?auth_token=' + @auth.token
  payload = {'data' => {'name' => name, 'conference_numbers' => conference_numbers}}
  Nestful.json_put(room_url, {:params => payload})
end