summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-06-27 14:34:58 +0200
committerPeter Kozak <spag@golwen.net>2013-06-27 14:34:58 +0200
commit91297fb17094a8c7202322cf90dba3e83f123f9b (patch)
tree4bc4b9cc0e91f49499bc3b84a2760614af0c7c73 /app/models
parentce6407538090b2f67a5c131f7d12253d1c02f860 (diff)
auto_answer added
Diffstat (limited to 'app/models')
-rw-r--r--app/models/sip_account.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/app/models/sip_account.rb b/app/models/sip_account.rb
index 668fbfe..fea5f3e 100644
--- a/app/models/sip_account.rb
+++ b/app/models/sip_account.rb
@@ -154,12 +154,11 @@ class SipAccount < ActiveRecord::Base
return SipRegistration.where(:sip_user => self.auth_name).first
end
- def call( phone_number, origin_cid_number = nil, origin_cid_name = 'Call' )
- origin_cid_number = origin_cid_number || phone_number
+ def call( phone_number, caller_id_number = nil, caller_id_name = 'Call', auto_answer = false )
require 'freeswitch_event'
return FreeswitchAPI.execute(
'originate',
- "{origination_uuid=#{UUID.new.generate},origination_caller_id_number='#{phone_number}',origination_caller_id_name='#{origin_cid_name}'}user/#{self.auth_name} #{phone_number}",
+ "{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
);
end