summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspag <spag@golwen.net>2013-01-28 10:12:40 +0100
committerspag <spag@golwen.net>2013-01-28 10:12:40 +0100
commit3e66e066c2f19a8b27233dff1abdf3908debae36 (patch)
tree50f1f41c515fac263340942213535749140d78be
parent7f751576ae36f387bafa63e900fa21353a2ce3fb (diff)
use sip_registration in sip_views
-rw-r--r--app/models/sip_account.rb2
-rw-r--r--app/views/sip_accounts/show.html.haml7
2 files changed, 8 insertions, 1 deletions
diff --git a/app/models/sip_account.rb b/app/models/sip_account.rb
index d35f9b4..444eb12 100644
--- a/app/models/sip_account.rb
+++ b/app/models/sip_account.rb
@@ -133,7 +133,7 @@ class SipAccount < ActiveRecord::Base
end
def registration
- return FreeswitchRegistration.where(:reg_user => self.auth_name).first
+ return SipRegistration.where(:sip_user => self.auth_name).first
end
def call( phone_number )
diff --git a/app/views/sip_accounts/show.html.haml b/app/views/sip_accounts/show.html.haml
index c21b3f4..72e10df 100644
--- a/app/views/sip_accounts/show.html.haml
+++ b/app/views/sip_accounts/show.html.haml
@@ -55,6 +55,13 @@
%strong= t('sip_accounts.show.expires') + ":"
%td
= "#{@sip_account.registration.try(:expires) - Time.now.to_i} s"
+ - if @sip_account.registration.try(:user_agent)
+ %tr
+ %td
+ %strong= t('sip_accounts.show.user_agent') + ":"
+ %td
+ = @sip_account.registration.try(:user_agent)
+
= render :partial => 'shared/show_edit_destroy_part', :locals => { :parent => @sip_account.sip_accountable, :child => @sip_account }