From af5397e415501d0ce3a052538a4e3ed74bf189cd Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Thu, 27 Jun 2013 14:12:26 +0200 Subject: auto_connect_indication added --- app/views/config_snom/show.xml.haml | 1 + 1 file changed, 1 insertion(+) (limited to 'app') diff --git a/app/views/config_snom/show.xml.haml b/app/views/config_snom/show.xml.haml index 22df8bc..8b501ab 100644 --- a/app/views/config_snom/show.xml.haml +++ b/app/views/config_snom/show.xml.haml @@ -37,6 +37,7 @@ %display_method{:perm => 'RW'}= 'display_name_number' %callpickup_dialoginfo{:perm => 'RW'}= 'on' %pickup_indication{:perm => 'RW'}= 'off' + %auto_connect_indication{:perm => 'RW'}= 'off' %show_local_line{:perm => 'RW'}= 'off' %mwi_notification{:perm => 'RW'}= 'silent' %mwi_dialtone{:perm => 'RW'}= 'normal' -- cgit v1.2.3 From a5916697ce2ab1f74833d19a36dbb0f71c7ed7f5 Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Thu, 27 Jun 2013 14:13:20 +0200 Subject: run possible_voicemail_accounts on error --- app/controllers/sip_accounts_controller.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'app') diff --git a/app/controllers/sip_accounts_controller.rb b/app/controllers/sip_accounts_controller.rb index cd34953..3dc5a54 100644 --- a/app/controllers/sip_accounts_controller.rb +++ b/app/controllers/sip_accounts_controller.rb @@ -85,6 +85,7 @@ class SipAccountsController < ApplicationController m = method( :"#{@parent.class.name.underscore}_sip_account_path" ) redirect_to m.( @parent, @sip_account ), :notice => t('sip_accounts.controller.successfuly_updated') else + possible_voicemail_accounts render :edit end end -- cgit v1.2.3 From 91297fb17094a8c7202322cf90dba3e83f123f9b Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Thu, 27 Jun 2013 14:34:58 +0200 Subject: auto_answer added --- app/models/sip_account.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'app') 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 -- cgit v1.2.3 From 51c51156e22b16fb5c120aed8dfef13a2d10b465 Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Thu, 27 Jun 2013 14:59:00 +0200 Subject: call method returns call_uuid --- app/models/sip_account.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'app') 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) -- cgit v1.2.3