diff options
author | Peter Kozak <spag@golwen.net> | 2013-06-04 11:11:33 +0200 |
---|---|---|
committer | Peter Kozak <spag@golwen.net> | 2013-06-04 11:11:33 +0200 |
commit | d4fbed4b3089da378123a32b8533b02e6f147eb0 (patch) | |
tree | 2820ab6556d8562d29ec73146b01ce548f49de31 /app/models/sip_account.rb | |
parent | 340cfdbf47096bf1263eee0803938ea6b8d605ab (diff) |
cid_number, cid_name added
Diffstat (limited to 'app/models/sip_account.rb')
-rw-r--r-- | app/models/sip_account.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/sip_account.rb b/app/models/sip_account.rb index e4ecfc4..668fbfe 100644 --- a/app/models/sip_account.rb +++ b/app/models/sip_account.rb @@ -154,11 +154,12 @@ class SipAccount < ActiveRecord::Base return SipRegistration.where(:sip_user => self.auth_name).first end - def call( phone_number ) + def call( phone_number, origin_cid_number = nil, origin_cid_name = 'Call' ) + origin_cid_number = origin_cid_number || phone_number require 'freeswitch_event' return FreeswitchAPI.execute( 'originate', - "{origination_uuid=#{UUID.new.generate},origination_caller_id_number='#{phone_number}',origination_caller_id_name='Call'}user/#{self.auth_name} #{phone_number}", + "{origination_uuid=#{UUID.new.generate},origination_caller_id_number='#{phone_number}',origination_caller_id_name='#{origin_cid_name}'}user/#{self.auth_name} #{phone_number}", true ); end |