
Cisco IP phones, for example, the popular 7911G (it’s him at anigife) and older models, support the ability to perform http requests to create services, in particular, the organization’s telephone directory.
How it all works. We configure the script on the web server, which, in response to a GET request from the phone, returns strictly defined XML displayed by the phone. For the phone book, the list of departments is first displayed:
<CiscoIPPhoneMenu>
<MenuItem>
<Name> Administration </ Name>
<URL> http: //webserver/phone/telbook.asp? Depid = 10 </ URL>
</ MenuItem>
</ CiscoIPPhoneMenu>
')
When you select a department, the phone makes a second request to the address from the URL and already displays a list of employees and their phones.
Here is a picture and an example of the structure for the list from the
official help :
<CiscoIPPhoneDirectory>
<Title> Title </ Title>
<Prompt> Prompt / Subtitle </ Prompt>
<DirectoryEntry>
<Name> Name </ Name>
<Telephone> Telephone </ Telephone>
</ Directoryentry>
</ CiscoIPPhoneDirectory>

From the administrator of the phones, you need to register a call to our script when you press one of the keys or select a menu item, specifically with 7911G we use Application-> Help.
In the phone settings, the call is set as <InformationURL>
webserver / phone / directory.asp </ InformationURL>. But the model 7965G has a separate key for the telephone directory, and pressing it already calls the address from <DirectoryURL>. Therefore, all of our phones have all possible * URLs simply pointing to the same script.
Minor amenities are available, such as the “Back” button and the choice of department or phone number by index. An important convenience is that the phone itself converts the entry of the type 8 (495) 555-11-22 into the number for dialing 84955551122, this allows you to show people with a conveniently readable number.
Exactly how the script generates the XML we need, everyone can choose for himself. We have the same script used to display the phone book in the browser, via XSL. To do this, we add one line to the generated XML
<? xml-stylesheet type = "text / xsl" href = "http: // <% = servernamepath%> /telbook.xsl"?>
and additionally display the RusName element with the Russian spelling of the full name. Since the RusName phone is perceived as an error in the structure, and the script is one, in a banal way we determine who called the script:
if InStr (1, Request.ServerVariables ("http_user_agent"), "allegro", 1)> 0 then isphone = 1
And also the phone is able to perceive data from the user, we tried to do a search for the phone numbers of counterparties by their internal code, the feature worked, but did not catch on:
<CiscoIPPhoneInput>
<Title> Vuz search </ Title>
<Prompt> Enter vuz kod: </ Prompt>
<URL> http: //webserver/phone/search.asp? Type = vuz </ URL>
<InputItem>
<DisplayName> KOD </ DisplayName>
<QueryStringParam> kod </ QueryStringParam>
<InputFlags> T </ InputFlags>
</ InputItem>
</ CiscoIPPhoneInput>
Calling the CiscoIPPhoneInput itself is another line in the main CiscoIPPhoneMenu, and after the user enters the number, the phone sends the KOD parameter to the script and it displays the found phone list via CiscoIPPhoneDirectory.
In addition, in theory, the phone can make requests to scripts in idle mode, and you can also use the refresh header and periodically automatically request fresh data. This may be the dollar rate, although we wanted to monitor the load on the servers, at least in numerical form - take a look at the phone and immediately see that someone has occupied all the cores.