All the Minibrowser main tags can contain the following subtags.


Conditional blocks

The If, Elif, Else tags are used as conditional elements and can depend on dynamic evaluations such as callback expressions of the form $(...). This tags sequence must start with an If tag and it can end with an Else tag, which both can only appear once under the parent element. The Elif tag is optional and can be written zero or more times after If tag end and before Else tag start. This is especially useful for describing alternative child elements.

You can see an usage example here

Valid Attributes

Notes



Repeats

Repeats the containing menu entries while iterating over a list of values and replacing certain parts with the given values.

You can see a Repeats usage example here

Valid Attributes


Title

The title that is displayed at the top of the screen when displaying the XML document. Don't use line break inside this tag.


Fetch

Fetches the specified URL (such as another XML file) after a certain delay.

See an example here

Valid Attributes

Notes


SoftKeyItem

Re-configures the functionality of a key and - in case of a context key - its screen label. The keys can be mapped to an URL that will be fetched or to another (virtual-)key. See example here.

Valid Sub Tags



Led

Allows users to control the LEDs of the Free Function Keys. When set to anything other than "Off", the respective LED setting will override any automated, state or event-based control associated with the intended functionality of the LED. For example, if a Line Key LED is manually overridden with this tag, pressing the Line Key button will not trigger any LED changes. Restoring control is achieved via the Minibrowser by setting the state in the Led tag to "Off".

Basic example:

<LED number="6" color="green">blinkfast</LED>

See a more complex example here

Valid Attributes

Valid values

LED Number Order

Some LEDs are associated with label pages. For example, on a D785, LED5 is the first Line Key LED on page 1. LED11 is the first Line Key LED on page 2. Changing pages will synchronize the LED with its associated state for that page, whether set manually or via the functional rules.

The LED numbering start with:

The LED numbers for the line keys have different fixed starting points, because the phones have a varying number of LEDs:

Notes


Examples

Conditional blocks

The Snom Minibrowser supports also conditional code block that can be executed after a condition evaluation. Conditional blocks are implemented trough the tags If, Elif and Else

Simple use of tags

<?xml version="1.0" encoding="UTF-8"?>
<SnomIPPhoneText>
    <If condition="$(set:phone_type)==snomD375">
        <Title>This is a Snom D375</Title>
    </If>
    <Elif condition="$(set:phone_type)==snomD735">
        <Title>This is a Snom D735</Title>
    </Elif>
    <Else>
        <Title>Unknown Snom phone</Title>
    </Else>
    <Text>Snom phone sample text</Text>
</SnomIPPhoneText>

Result


Test on some operators

<?xml version="1.0" encoding="UTF-8"?>
<SnomIPPhoneMenu>
    <Menu name="Menu1">
<!-- TRUE -->   <If condition="a==a"><MenuItem name="TRUE>>a==a" /></If>
        <Else><MenuItem name="FALSE>>a==a" /></Else>
<!-- FALSE -->  <If condition="a==A"><MenuItem name="TRUE>>a==A" /></If>
        <Else><MenuItem name="FALSE>>a==A" /></Else>
<!-- FALSE -->  <If condition="!a==a"><MenuItem name="TRUE>>!a==a" /></If>
        <Else><MenuItem name="FALSE>>!a==a" /></Else>
<!-- FALSE -->  <If condition=" a==a"><MenuItem name="TRUE>> a==a" /></If>
        <Else><MenuItem name="FALSE>> a==a" /></Else>
<!-- TRUE -->   <If condition=" 10>=10"> <MenuItem name="TRUE>> 10>=10" /></If>
        <Else><MenuItem name="FALSE>> 10>=10" /></Else>
<!-- TRUE -->   <If condition="10>= 10"><MenuItem name="TRUE>>10>= 10" /></If>
        <Else><MenuItem name="FALSE>>10>= 10" /></Else>
    </Menu>
</SnomIPPhoneMenu>


Result

Repeat

Example code using the values attribute

<?xml version="1.0" encoding="UTF-8"?>
<SnomIPPhoneMenu>
    <Repeat token="/__NAME__/__URL__/" values="|foo|http://foo.com|bar|http://bar.com|">
        <MenuItem name="__NAME__">
            <Url>__URL__</Url>
        </MenuItem>
    </Repeat>
</SnomIPPhoneMenu>


Result


Example code using the var_ifc attribute

<?xml version="1.0" encoding="UTF-8"?>
<SnomIPPhoneMenu>
    <Title>var_ifc test</Title>
    <Repeat token="|__state__|__name__|__file_name__|" var_ifc="lang.pui.*">
        <if condition="__state__==active">
            <MenuItem name="$(x_o:$(condition:__state__==active)) __name__(__file_name__)" sel="true"/>
        </if>
        <else>
            <MenuItem name="$(x_o:$(condition:__state__==active)) __name__(__file_name__)" sel="false"/>
        </else>
    </Repeat>
</SnomIPPhoneMenu>


Result

Fetch

Fetch example, first page

Please replace http://link_to_second_page_xml.xml in this code example with a link to the XML file from the next example

<?xml version="1.0" encoding="UTF-8"?>
<SnomIPPhoneText>
    <Title>1st page</Title>
    <Text>This text shown only for 4 seconds</Text>
    <fetch mil="4000">http://link_to_second_page_xml.xml</fetch>
</SnomIPPhoneText>


Fetch example, second page

<?xml version="1.0" encoding="UTF-8"?>
<SnomIPPhoneText>
    <Title>2nd page</Title>
    <Text>Bye bye!</Text>
    <Fetch mil="4000">snom://mb_exit</Fetch>
</SnomIPPhoneText>


Result

Led

The first example in this section will turn some LEDs on and the second example will turn them off.


Led example: led on

Please replace http://link_to_second_page_xml.xml in this code example with a link to the XML file from the next example

<?xml version="1.0" encoding="UTF-8"?>
<SnomIPPhoneText>
    <Title>LED Control Feature</Title>
    <Text>This sample page demonstrates the Minibrowser LED control feature.</Text>
    <Led number="1">On</Led>
    <Led number="2">blink</Led>
    <Led number="3">blinkfast</Led>
    <Led number="4">blinkslow</Led>
    <Led number="5" color="green">on</Led>
    <SoftKeyItem>
        <Name>F1</Name>
        <Label>Off</Label>
        <URL>http://link_to_second_page_xml.xml</URL>
    </SoftKeyItem>
    <SoftKeyItem>
        <Name>F2</Name>
        <Label>Exit</Label>
        <URL>snom://mb_exit</URL>
    </SoftKeyItem> 
</SnomIPPhoneText>


Led example: led off

Please replace http://link_to_first_page_xml.xml in this code example with a link to the XML file from the previous example

<?xml version="1.0" encoding="UTF-8"?>
<SnomIPPhoneText>
    <Title>LED Control Feature</Title>
    <Text>This sample page demonstrates the Minibrowser LED control feature.</Text>
    <Led number="1">Off</Led>
    <Led number="2">Off</Led>
    <Led number="3">Off</Led>
    <Led number="4">Off</Led>
    <Led number="5" color="green">Off</Led>
    <SoftKeyItem>
        <Name>F1</Name>
        <Label>On</Label>
        <URL>http://link_to_first_page_xml.xml</URL>
    </SoftKeyItem>    
    <SoftKeyItem>
        <Name>F2</Name>
        <Label>Exit</Label>
        <URL>snom://mb_exit</URL>
    </SoftKeyItem>    
</SnomIPPhoneText>

SoftKeyItem

<?xml version="1.0" encoding="UTF-8"?>
<SnomIPPhoneMenu name="SoftkeyItem example" state="relevant">
	<SoftKeyItem>
        	<Name>F1</Name>
			<Icon>https://service.snom.com/download/attachments/36831457/room_service.png</Icon>
        	<Label>Example 1</Label>
			<URL>http://something</URL>
	</SoftKeyItem>
	<SoftKeyItem>
        	<Name>F2</Name>
			<Icon>kIconSettingsMaintenance</Icon>
        	<Label>Example 2</Label>
			<SoftKey>F_SETTINGS</SoftKey>
	</SoftKeyItem>
	<Menu name="See softkeys below">
	</Menu>
</SnomIPPhoneMenu>


Result:


SoftKeyItem with consume_key_event

To test the following example:

If you change line 8 and remove consume_key_event="true", pressing the X (Cancel) key in a call will not call  http://10.110.16.61/do_something_else. Instead, it will send the Cancel to the underlying phone state and end the call.

<?xml version="1.0" encoding="utf-8"?>
<SnomIPPhoneMenu title="Test" track="false" speedselect="off" state="others_except_mb">
	<MenuItem id="test" name="Press CANCEL to see if it ends call">
		<Url>http://10.110.16.61/do_something.xml</Url>
	</MenuItem>
	<SoftKeyItem>
		<Name>CANCEL</Name>
		<Url consume_key_event="true">http://10.110.16.61/do_something_else</Url>
	</SoftKeyItem>
</SnomIPPhoneMenu>