From d4fbed4b3089da378123a32b8533b02e6f147eb0 Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Tue, 4 Jun 2013 11:11:33 +0200 Subject: cid_number, cid_name added --- app/models/sip_account.rb | 5 +++-- 1 file 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 -- cgit v1.2.3