diff options
author | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2013-06-20 19:06:19 +0200 |
---|---|---|
committer | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2013-06-20 19:06:19 +0200 |
commit | eb0e1cc5c26275ff3e5c341404e8bc558f8312b8 (patch) | |
tree | 71f449ccd6f15422717de3ac24f87d5e888ddd79 /app/models/call.rb | |
parent | df6e17e48995f25e72509986f30700d778b179b6 (diff) | |
parent | 3b27a5d45b12f6bac65da2a8e17387bfda42a2f1 (diff) |
Merge branch 'develop'
Diffstat (limited to 'app/models/call.rb')
-rw-r--r-- | app/models/call.rb | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/app/models/call.rb b/app/models/call.rb index a8a0d7f..2bbd08b 100644 --- a/app/models/call.rb +++ b/app/models/call.rb @@ -36,7 +36,7 @@ class Call < ActiveRecord::Base def delete require 'freeswitch_event' - return FreeswitchAPI.execute('uuid_kill', self.uuid, true); + return FreeswitchAPI.execute('uuid_kill', self.uuid, true) end def transfer_blind(destination, call_leg=:aleg, auth_account=nil) @@ -63,6 +63,25 @@ class Call < ActiveRecord::Base return FreeswitchAPI.api_result(FreeswitchAPI.api('uuid_transfer', channel_uuid, destination)) end + + def self.bridge(call_uuid1, call_uuid2, hangup_uuids=[]) + if call_uuid1.blank? || call_uuid2.blank? + return nil + end + + require 'freeswitch_event' + result = FreeswitchAPI.api_result(FreeswitchAPI.api('uuid_bridge', call_uuid1, call_uuid2)) + + if result + hangup_uuids.each do |kill_uuid| + FreeswitchAPI.execute('uuid_kill', kill_uuid, true) + end + end + + return result + end + + def get_variable_from_uuid(channel_uuid, variable_name) if channel_uuid.blank? return nil |