Child pages
  • How to display custom text on the phone screen via built-in Minibrowser



Introduction 

The Snom phones have a built-in minibrowser template that can be used for simple minibrowser tasks such as displaying a custom text on the phone screen (templates.xml). There is a URL that can be used to call the template file in order to trigger the display of custom text on the phone screen.

URL

file:///xml/gui/templates.xml#sub=*[@id="text_template"]&<parameters>

Another option would be to use an HTTP request, however this is usually not needed: http(s)://<PHONE_IP>/xml/gui/templates.xml#sub=*[@id="text_template"]&<parameters>

Parameters

For basic usage, the required parameters are: text_content (the page content) and text_title (the page title). See the example below on how to use them.



Examples

Disable a phone button and show instead "This action is not allowed"

We can use this for example for disabling the Transfer button. The goal would be: instead of transferring the call, display "This action is not allowed" when the user presses the Transfer button. To do this, we will re-program the button dkey_transfer to call templates.xml with parameters:

  • text_title=Not Allowed
  • text_content=This action is not allowed


Here are the steps:

  1. Encode the parameters
    Because the parameters contain empty spaces, it is required to URL-encode them:
    1. text_content=This%20action%20is%20not%20allowed
    2. text_title=Not%20Allowed

  2. Create the <parameters> string
    In our case the <parameters> string would be:
    var:text_content=This%20action%20is%20not%20allowed&var:text_title=Not%20Allowed

  3. Provision the dkey_transfer to call: file:///xml/gui/templates.xml#sub=*[@id="text_template"]&var:text_content=This%20action%20is%20not%20allowed&var:text_title=Not%20Allowed

    You can do this:

    1.  by adding the following line to your provisioning file:

      <dkey_transfer perm="RW">url file:///xml/gui/templates.xml#sub=*[@id="text_template"]&var:text_content=This%20action%20is%20not%20allowed&var:text_title=Not%20Allowed>
    2. Or alternatively you can also change this setting by using HTTP request

      http(s)://<Phone_IP>/settings.htm?settings=save&dkey_transfer=url%20file:///xml/gui/templates.xml%23sub=*[@id=%22text_template%22]%26var:text_title=Not%2520Allowed%26var:text_content=This%2520action%2520is%2520not%2520allowed

      Note that in the above HTTP request we had to do some extra encoding: replaced empty space with %20, replaced # with %23, replaced " with %22, replaced & with %26, rplaced % with %25 . Since this HTTP request is quite complex and error prone, option a. is recommended.

  4. When a user tries to press the Transfer button they will see:

Trigger the display of a text when a specific event occurs

Goal: when SIP registration fails, display message "Please contact the IT Department, Room 123 Second Floor"

  1. Encode the parameters
    Because the parameters contain empty spaces, it is required to URL-encode them:
    1. text_content=Please%20contact%20the%20IT%20Department,%20Room%20123%20Second%20Floor
    2. text_title=Registration%20failed

  2. Create the <parameters> string
    In our case the <parameters> string would be:
    var:text_content=Please%20contact%20the%20IT%20Department,%20Room%20123%20Second%20Floor&var:text_title=Registration%20failed

  3. In the phone's web interface, set Action URL Settings → Registration failed to:

    file:///xml/gui/templates.xml#sub=*[@id="text_template"]&var:text_content=Please%20contact%20the%20IT%20Department,%20Room%20123%20Second%20Floor&var:text_title=Registration%20failed



  4. When the extension fails to register the user will see:

This page has no comments.