diff options
author | Peter Kozak <spag@golwen.net> | 2013-06-27 08:56:03 +0200 |
---|---|---|
committer | Peter Kozak <spag@golwen.net> | 2013-06-27 08:56:03 +0200 |
commit | 39c06e5b4fd5a984c4f93fa48567c63848632ced (patch) | |
tree | 393ec0dbe1020d6800c94476f6c331d211ab9c30 /app/controllers/api/v1/calls_controller.rb | |
parent | 677e234c6b3bbec189f2caf2f237f609ab44b274 (diff) | |
parent | 1c6646bc732def369e54ef4ac576d748c6ba9c92 (diff) |
Merge branch 'develop' of github.com:amooma/GS5 into develop
Diffstat (limited to 'app/controllers/api/v1/calls_controller.rb')
-rw-r--r-- | app/controllers/api/v1/calls_controller.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/controllers/api/v1/calls_controller.rb b/app/controllers/api/v1/calls_controller.rb index e6fbed4..329bd94 100644 --- a/app/controllers/api/v1/calls_controller.rb +++ b/app/controllers/api/v1/calls_controller.rb @@ -14,6 +14,23 @@ module Api if params[:transfer_blind] @call.transfer_blind(params[:transfer_blind]) + else + if params[:transfer_attended] && @call.b_sip_account.phones.first.phone_model.manufacturer.name == 'SNOM Technology AG' + phone = @call.b_sip_account.phones.first + ip_address = phone.ip_address + http_user = phone.http_user + http_password = phone.http_password + + # Hold + open("http://#{ip_address}/command.htm?key=F_HOLD", :http_basic_authentication=>[http_user, http_password]) + + # Call the other party + (0..(params[:transfer_attended].length - 1)).each do |i| + digit = params[:transfer_attended][i] + open("http://#{ip_address}/command.htm?key=#{digit}", :http_basic_authentication=>[http_user, http_password]) + end + open("http://#{ip_address}/command.htm?key=ENTER", :http_basic_authentication=>[http_user, http_password]) + end end respond_with @call |