4

I've a Cisco IP-Phone 7945 and I want to control it from my CLI. For example I want to start a command like

call start 12345 #12345 is the number I want to call

or

call cancel

Anybody knows a tool or something similiar?

I'm writing a rails app and I want to start a call from within the app after a certain action.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Daniel
  • 4,082
  • 3
  • 27
  • 46

2 Answers2

6

The 7945 has a web interface that permits execution of commands, including a "Dial" command, by authenticated users.

Your rails app would connect to the phone at http://phone-ip-address/CGI/Execute and POST some XML that looks like this:

<CiscoIPPhoneExecute>
  <ExecuteItem URL="Dial:12345" />
</CiscoIPPhoneExecute>

The authentication is done with HTTP Basic Auth and the back-end authenticator is determined by what phone system your 7945 is connected to. If Cisco Call Manager, it uses the assigned Call Manager user information.

Look for the IP Phone Services guides on cisco.com for details. Quick links:

Short answer: it's not a CLI but it is straightforward to program a dialer by interacting with the phone over HTTP.

Nik Reiman
  • 39,067
  • 29
  • 104
  • 160
Bill
  • 76
  • 1
  • 2
4

I know this is an old thread, but thought I'd post this working code example in Ruby. Tested on the CP-8941 phone. Username & password schemes will vary. Our system is set up to interface to Active Directory, so the username and password are those of our Windows login.

require "net/http"
require "uri"

phone = "ip-of-your-phone"
user = "your-username-goes-here"
secret = "your-password-goes-here"
prefix = "91"
todial = "number-to-dial-goes-here"



uri = URI.parse("http://#{phone}/CGI/Execute")

http = Net::HTTP.new(uri.host, uri.port)

request = Net::HTTP::Post.new(uri.request_uri)

http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri)
request.basic_auth(user, secret)

request.set_form_data({"XML" => %(<CiscoIPPhoneExecute><ExecuteItem URL="Dial:#{prefix}#{todial}" /></CiscoIPPhoneExecute>) })

response = http.request(request)
  • Thank you David for the answer and the code example. I'm don't work on the project anymore so I can't test it. But hopefully someone else will find this helpful. – Daniel Aug 23 '14 at 13:23