summaryrefslogtreecommitdiff
path: root/app/controllers/api/v1/sip_accounts_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/api/v1/sip_accounts_controller.rb')
-rw-r--r--app/controllers/api/v1/sip_accounts_controller.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/app/controllers/api/v1/sip_accounts_controller.rb b/app/controllers/api/v1/sip_accounts_controller.rb
new file mode 100644
index 0000000..6f305a4
--- /dev/null
+++ b/app/controllers/api/v1/sip_accounts_controller.rb
@@ -0,0 +1,23 @@
+module Api
+ module V1
+ class SipAccountsController < ApplicationController
+ respond_to :json
+
+ def index
+ if params[:ids]
+ @sip_accounts = SipAccount.where(:id => params[:ids])
+ else
+ @sip_accounts = SipAccount.all
+ end
+
+ respond_with @sip_accounts
+ end
+
+ def show
+ @sip_account = SipAccount.find(params[:id])
+
+ respond_with @sip_account
+ end
+ end
+ end
+end