summaryrefslogtreecommitdiff
path: root/app/models/sip_account.rb
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-06-27 14:59:00 +0200
committerPeter Kozak <spag@golwen.net>2013-06-27 14:59:00 +0200
commit51c51156e22b16fb5c120aed8dfef13a2d10b465 (patch)
treebdcaede140f3651fa17b7177c61d0820a737011c /app/models/sip_account.rb
parent91297fb17094a8c7202322cf90dba3e83f123f9b (diff)
call method returns call_uuid
Diffstat (limited to 'app/models/sip_account.rb')
-rw-r--r--app/models/sip_account.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/app/models/sip_account.rb b/app/models/sip_account.rb
index fea5f3e..a2644e9 100644
--- a/app/models/sip_account.rb
+++ b/app/models/sip_account.rb
@@ -156,11 +156,13 @@ class SipAccount < ActiveRecord::Base
def call( phone_number, caller_id_number = nil, caller_id_name = 'Call', auto_answer = false )
require 'freeswitch_event'
- return FreeswitchAPI.execute(
+ origination_uuid = UUID.new.generate
+ if FreeswitchAPI.execute(
'originate',
- "{origination_uuid=#{UUID.new.generate},origination_caller_id_number='#{caller_id_number||phone_number}',origination_caller_id_name='#{caller_id_name}',sip_auto_answer='#{auto_answer}'}user/#{self.auth_name} #{phone_number}",
- true
- );
+ "{origination_uuid=#{origination_uuid},origination_caller_id_number='#{caller_id_number||phone_number}',origination_caller_id_name='#{caller_id_name}',sip_auto_answer='#{auto_answer}'}user/#{self.auth_name} #{phone_number}",
+ true)
+ return origination_uuid
+ end
end
def target_group_ids_by_permission(permission)