summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/sip_accounts_controller.rb1
-rw-r--r--app/models/sip_account.rb13
-rw-r--r--app/views/config_snom/show.xml.haml1
-rw-r--r--misc/freeswitch/scripts/dialplan/voicemail.lua5
4 files changed, 13 insertions, 7 deletions
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
diff --git a/app/models/sip_account.rb b/app/models/sip_account.rb
index 668fbfe..a2644e9 100644
--- a/app/models/sip_account.rb
+++ b/app/models/sip_account.rb
@@ -154,14 +154,15 @@ 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(
+ origination_uuid = UUID.new.generate
+ if 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}",
- 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)
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'
diff --git a/misc/freeswitch/scripts/dialplan/voicemail.lua b/misc/freeswitch/scripts/dialplan/voicemail.lua
index 3358d2b..f436720 100644
--- a/misc/freeswitch/scripts/dialplan/voicemail.lua
+++ b/misc/freeswitch/scripts/dialplan/voicemail.lua
@@ -349,7 +349,10 @@ function Voicemail.leave(self, caller, greeting, number)
end
os.remove(record_file_name);
caller:send_display('Goodbye');
- caller.session:sayPhrase('voicemail_goodbye');
+
+ if common.str.blank(greeting_file) then
+ caller.session:sayPhrase('voicemail_goodbye');
+ end
end