Content

Page tree

An XML application can be triggered in various ways.

Index:



Via Key pressure

The simplest way of triggering a Minibrowser page on the phone is to assign the page to a function key using the Action URL key type.

Follow the next steps to assign the page to a function key:

  1. Open the web user interface of the phone in your browser
  2. Navigate to Function keys
  3. For the key you want to change:

    1. Select Type = Action URL
    2. Insert the application URL into the Number textbox
    3. Provide a descriptive title in the Label field

Pressing the selected key now launches the Minibrowser. In case your application is not triggered as expected check the troubleshooting section.



Via Action URLs triggers

Using the Action URL feature the phone can trigger an HTTP request when a specific event occurs on the phone:

The Action URL page

You can enter the Minibrowser URL to be launched for each specific event and click "Apply". In this case the page is launched whenever the event occurs. E.g. if you provide http://someurl/somepage.xml in the DND on field, each time you enable the DND feature on the phone this URL will be called.

Action URLs do not necessarily need to show up on the phone. If you point to a URL which does not return an XML body in its 200 Ok response then the phone will not display anything.

Adding information to an Action URL

Sometimes it is required to provide additional information in the URL (for example, the Caller ID for an incoming call, the MAC address of the phone or the value of a specific setting).

Runtime variables

Runtime variables are filled in at the time when the event was triggered. See Action URLs for a list of the available variables.

Examples:

  • To insert the local and remote URIs in an URL as variables that can then be used directly in the Minibrowser XML code, the request in the action URL would look similar to the following: http://my.server.com/minibrowser.xml#var:local=$local&var:remote=$remote
  • If the Minibrowser code is generated automatically for example using a php script, the request in the action URL would look more similar to the following: http://my.server.com/minibrowse r.php?local= $local&remote=$remote

Inserting setting values

In some cases you would like to access current setting values in the scripts generating your content. In these cases you can just use the setting name prepended by a $-sign.

In the Minibrowser XMLs this is probably not needed because you can use the set callback to access setting values without passing them in the URL.

Examples:

Due to security constraints, passwords and password-like settings cannot be referenced using this method.



Using a HTTP GET request to the phone (minibrowser.htm)

Another commonly used way to trigger the minibrowser is to use HTTP GET requests to the phone page called minibrowser.htm.


Example:
http://10.110.15.51/minibrowser.htm?url=http://10.110.15.117/launch.xml

When using URL parameters, the following details are important:

  • the URL you provide in the URL parameter must be properly encoded. For example this URL:

http://phone_ip/minibrowser.htm?url=http://IPADDRESS/menu.xml?mac=MAC&check=1234&type=4

needs to be encoded like this:

http://phone_ip/minibrowser.htm?url=http://IPADDRESS%2Fmenu.xml%3Fmac%3DMAC%26check%3D1234%26type%3D

Here you can find more information about the "percent encoding". This website provides a free encoder / decoder

  • A fragment which is added to an URL that is added to a minibrowser.htm call will only be handled if the IP address of the URL is added to the setting mb_trusted_hosts or if the URL is already trusted (local XML)


Via SIP NOTIFY request

An XML application can be also sent to the phone via a SIP request.

This requires some setup on the phone. Please configure the following settings:

Setting NameValueDescription
xml_notify onThis setting is required to enable this feature
filter_registrar offThis setting should be off in case you are sending the request from an IP different that your PBX
network_id_port 5060This setting is needed if you don't know the ephemeral port used for SIP by the phone
offer_gruu offThis setting can stay on if you are sending the request from the PBX and the PBX supports GRUU
user_sipusername_as_line offThis setting can stay on if you are sending the request from the PBX and the PBX sends the request to the full SIP URI from the Contact header sent by the phone (including the line=parameter)

In order to send the SIP request you can use various tools such as sipsack, SIPPing or sipp.

The Content-Length header of the NOTIFY must have the correct value and the headers:

  • Event: xml
  • Content-Type: application/snomxml

are mandatory for this feature


Example:

Assuming we use the workstation at IP address 10.0.5.30 to send XML content to a snom375 phone at 10.0.5.174 which has identity 440 registered:

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: fakeCall-ID@me
CSeq: 1 NOTIFY
Max-Forwards: 70
Event: xml
Subscription-State: active;expires=30000
Content-Type: application/snomxml
Content-Length: 317

<SnomIPPhoneDirectory>
<Title>Menutitle</Title>
<Prompt>Prompt</Prompt>
<DirectoryEntry>
<Name>John</Name>
<Telephone>123456789</Telephone>
</DirectoryEntry>
<DirectoryEntry>
<Name>Doe</Name>
<Telephone>987654321</Telephone>
</DirectoryEntry>
</SnomIPPhoneDirectory>



Replacing the existing XML Minibrowser menus on the phone

Many of the phone menus in software version 10.x are generated on Minibrowser XML files. It is possible to edit/replace these XML files by your own application and then open them using the phone user interface. For more information on achieving this, see Phone menu customization .