XML/Minibrowser

From Snom User Wiki

< XML
Jump to: navigation, search

Author: Hirosh Dabui, Alexander Feldt

Contents

Overview

snom phones are able to use services on standard web servers like Apache. You can use snom phones to deploy customized client services with which users can interact with the keypad. snom phones use the HTTP/HTTPS protocol. Typical services are: To-do lists, Stock Information, Weather, Provisioning, Daily schedule, Telefon directory For getting started read the Quick Install Guide. You must be running firmware version 6 or above -> see here.

XML Browser Elements

In this section the syntax, behavior, and usage of each XML object is described. Creating interactive services is relatively easy when you understand the XML objects that are supported by firmware V7 on the snom370, snom360, snom320, snom300, and V8 on snom820 and snom870.

XML Browser Objects

XML Browser Object Tags

XML Browser Object attributes

Usage

The XML Browser can be invoked on snom phones using the following methods:

  1. Keypad or Event- Triggered HTTP GET Request to load XML pages from a HTTP Server
  2. Remote HTTP GET Request to load XML pages from a HTTP Server or
  3. SIP (NOTIFY) with XML content.

Note: URLs may contain credentials e.g.

http[s]://username:password@example.com/test.xml

Note: If the response time takes more then 500ms from the HTTP Server there will be an animation and the URL.

Image:loading.gif


Keypad- Triggered

Configure one of the available keys with an Action URL, e.g. the "snom" key on snom3x0

Image:Wui_v7_function_keys_actionurl_xml_en.png

By pressing the key a GET request to the HTTP server will be sent and the appropriate XML page will be returned.

Event- Triggered

Configure one or more Action URL Events on the the WUI page "Action URL Settings":


If the event is true a GET request to the HTTP server will be sent and the appropriate XML page will be returned.

Remote HTTP GET Request

From FW V8.2.7 onwards XML Browser content can be pushed to the phone via HTTP Requests. Take this example and send it from any HTTP Browser:

http://phone_ip/minibrowser.htm?url=www.yourserver.com/xmlcontent/test.xml

Note: You MUST NOT use "http://" within the URL!!!

Starting with version 8.2.6 you can also use the minibrowser.htm URL to set phone settings.

http://phone_ip/minibrowser.htm?url=www.yourserver.com/xmlcontent/test.xml&settings=save&setting1_name=value&setting2_name=value

where setting1_name and setting2_name are the names of the settings you want to set.

Applications

Miscellaneous

External Directory

The "PhoneBook for Snom-Phones" is a phone book browser with an integrated search function and includes an LDAP-, flatfile- and MySQL-backend.

Download at: http://www.bevuta.com/phoneapps/

This is a set of PHP classes that allows rapid XML application development for the XML browsers implemented in both Cisco 79xx and snom phones. A T9-style phonebook application with flat file and MySQL backends is included.

PHP Toolkit for xml minibrowser, including T9 phonebook coded by Siggi Langauf.

Video Streaming


Example

How to push XML Pages to snom's minibrowser

Needed settings
XML NOTIFY Support --> "On"
Filter packets from Registrar --> "Off"
Network identity (Port) --> 5060
Offer GRUU --> "Off"
Reboot the phone (You MUST NOT reset)
Use SIPSAK to send SIP messages
Example scenario
Workstation: 10.0.5.30
snom320: 10.0.0.174
sip Identity: 440
CALL-ID: any@any (check RFC 3261 - SIP)
Content-Length: 317 (bytes of the xml content, use a plain textfile to determine the exact amount of bytes!)
Place the following lines into a plain textfile (ie. xmlnotify.txt) and replace with your applicable values!
NOTIFY sip:10.0.0.174:5060 SIP/2.0
Via: SIP/2.0/UDP 10.0.5.30:1036
From: <sip:sipsak@10.0.5.30>;tag=2502
To: <sip:440@10.0.0.174>;tag=2502
Call-ID: blablub@snom320xxx
CSeq: 1 NOTIFY
Max-Forwards: 70
Event: xml
Subscription-State: active;expires=30000
Content-Type: application/snomxml
Content-Length: 317

<?xml version="1.0" encoding="UTF-8"?>
<SnomIPPhoneDirectory>
<Title>Menutitle</Title>
<Prompt>Prompt</Prompt>
<DirectoryEntry>
<Name>John</Name>
<Telephone>123456789</Telephone>
</DirectoryEntry>
<DirectoryEntry>
<Name>Doe</Name>
<Telephone>987654321</Telephone>
</DirectoryEntry>
</SnomIPPhoneDirectory>
Use the following command line
sipsak -i -O ID -l 1036 -f xmlnotify.txt -s sip:440@10.0.0.174:5060 -H 10.0.5.30 -v
Check the SIP Trace
----------------------------------------------------------------------------------------
Received from udp:10.0.5.30:4683 at 28/10/2009 12:46:48:649 (639 bytes):

NOTIFY sip:10.0.0.174:5060 SIP/2.0
Via: SIP/2.0/UDP 10.0.5.30:1036
From: <sip:sipsak@10.0.5.30>;tag=2502
To: <sip:440@10.0.0.174>;tag=2502
Call-ID: blablub@snom320xxx
CSeq: 1 NOTIFY
Max-Forwards: 70
Event: xml
Subscription-State: active;expires=30000
Content-Type: application/snomxml
Content-Length: 317

<?xml version="1.0" encoding="UTF-8"?>
<SnomIPPhoneDirectory>
<Title>Menutitle</Title>
<Prompt>Prompt</Prompt>
<DirectoryEntry>
<Name>John</Name>
<Telephone>123456789</Telephone>
</DirectoryEntry>
<DirectoryEntry>
<Name>Doe</Name>
<Telephone>987654321</Telephone>
</DirectoryEntry>
</SnomIPPhoneDirectory>

--------------------------------------------------------------------------------

Sent to udp:10.0.5.30:1036 at 28/10/2009 12:46:48:667 (189 bytes):

SIP/2.0 200 Ok
Via: SIP/2.0/UDP 10.0.5.30:1036
From: <sip:sipsak@10.0.5.30>;tag=2502
To: <sip:440@10.0.0.174>;tag=2502
Call-ID: blablub@snom320xxx
CSeq: 1 NOTIFY
Content-Length: 0

--------------------------------------------------------------------------------
Personal tools
Interoperability