summaryrefslogtreecommitdiff
path: root/app/models/call.rb
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-25 10:27:27 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-25 10:27:27 +0100
commitdf6e17e48995f25e72509986f30700d778b179b6 (patch)
treef432c24b8e4ad81009188650dabfd99194883265 /app/models/call.rb
parent11f186a118285fbc87a536af26730780a9ad01f5 (diff)
parentcce94a74aa5c9691f9b37cd9be5a6831f8063812 (diff)
Merge branch 'develop'5.1.2
Diffstat (limited to 'app/models/call.rb')
-rw-r--r--app/models/call.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/app/models/call.rb b/app/models/call.rb
index 8f657fa..a8a0d7f 100644
--- a/app/models/call.rb
+++ b/app/models/call.rb
@@ -39,6 +39,30 @@ class Call < ActiveRecord::Base
return FreeswitchAPI.execute('uuid_kill', self.uuid, true);
end
+ def transfer_blind(destination, call_leg=:aleg, auth_account=nil)
+ if destination.blank?
+ return nil
+ end
+
+ if call_leg == :bleg
+ channel_uuid = self.b_uuid
+ else
+ channel_uuid = self.uuid
+ end
+
+ if channel_uuid.blank?
+ return nil
+ end
+
+ require 'freeswitch_event'
+ if auth_account
+ FreeswitchAPI.api('uuid_setvar', channel_uuid, 'gs_auth_account_type', auth_account.class.name)
+ FreeswitchAPI.api('uuid_setvar', channel_uuid, 'gs_auth_account_uuid', auth_account.uuid)
+ end
+
+ return FreeswitchAPI.api_result(FreeswitchAPI.api('uuid_transfer', channel_uuid, destination))
+ end
+
def get_variable_from_uuid(channel_uuid, variable_name)
if channel_uuid.blank?
return nil