summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-12 13:40:18 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-12 13:40:18 +0100
commit5d3eeec6962010eb0b9cbcb9d3bb87d016bce199 (patch)
tree77181b0a6e09b6706237cb279f4763978932bb69 /app/controllers
parentb08abf797d8e476e07a89e40f43cddef32039dfb (diff)
Added sip_account_update trigger
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/trigger_controller.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/app/controllers/trigger_controller.rb b/app/controllers/trigger_controller.rb
index df6f39f..3445802 100644
--- a/app/controllers/trigger_controller.rb
+++ b/app/controllers/trigger_controller.rb
@@ -89,6 +89,31 @@ class TriggerController < ApplicationController
end
end
+ def sip_account_update
+ sip_account = SipAccount.find(params[:id])
+
+ if sip_account
+ # push the partial to the webbrowser
+ #
+ # new_html = ActionController::Base.helpers.escape_javascript(render_to_string("fax_documents/_fax_document", :layout => false, :locals => {:fax_document => fax_document}))
+ # PrivatePub.publish_to("/fax_documents/#{fax_document.id}", "$('#" + fax_document.id.to_s + ".fax_document').replaceWith('#{new_html}');")
+
+ render(
+ :status => 200,
+ :layout => false,
+ :content_type => 'text/plain',
+ :text => "<!-- OK -->",
+ )
+ else
+ render(
+ :status => 501,
+ :layout => false,
+ :content_type => 'text/plain',
+ :text => "<!-- ERRORS: #{errors.join(', ')} -->",
+ )
+ end
+ end
+
def fax
if !params[:fax_account_id].blank?
fax_account = FaxAccount.where(:id => params[:fax_account_id].to_i).first