[. . . ] A fourth architecture enables the internal web server to interact with outside web server via HTTP.
As illustrated above, all of the application logic lies within the server side of the architecture. This allows faster applications development and minimal phone side maintenance. Users may develop customized applications using this infrastructure.
XML CUSTOM SCREEN APPLICATION
The GXP Series supports idle screen customization. CUSTOM SCREEN API CONFIGURATION The XML Custom Screen API is configurable in 2 steps: 1. [. . . ] NOTE:
· · ·
The phonebook file name is fixed and cannot be changed based on personal preference. If the "Phonebook Download Interval" is set to a non-zero value x, the phonebook is automatically updated every x hours. If the "Remove manually edited entries on download" option is set to No (by default), the phone will keep ALL previously stored phonebook entries, insert the downloaded phonebook entries, and then save the phonebook. If set to Yes, the downloaded phonebook entries will replace the existing phonebook stored on the phone. At any time, you can immediately download the phonebook by choosing the "Download Phonebook" in the GUI Phone Book Menu (you can use the down arrow key when the phone is onhook).
·
Grandstream Networks
XML Application Note Version 1
Page 6 of 21 Revised: 9/2007
Grandstream XML Application Guide - PART B
XML Syntax, Technical Detail, File Examples
Part B of this application note will guide you through the technical details of our three applications: 1) XML Custom Screen, 2) XML Downloadable Phonebook and 3) Advanced XML Survey Application.
Grandstream Networks
XML Application Note Version 1
Page 7 of 21 Revised: 9/2007
Application One: XML Custom Screen Details
1. XML Custom Screen Syntax
XSD file
<?xml version="1. 0"?> <xsd:schema xmlns:xsd="http://www. w3. org/2001/XMLSchema"> <xsd:element name="Screen"> <xsd:complexType> <xsd:sequence> <xsd:element name="IdleScreen" minOccurs="1" maxOccurs="1"> <xsd:complexType> <xsd:sequence> <xsd:element name="ShowStatusLine" type="xsd:boolean" minOccurs="1" maxOccurs="1" default="true"/> <xsd:element name="DisplayBitmap" minOccurs="0" maxOccurs="unbounded" nillable="true"> <xsd:complexType> <xsd:sequence> <!-- We only accept Windows Monochrome Bitmap, max 130x64 pixels encoded by base64 --> <xsd:element name="Bitmap" type="xsd:base64Binary" minOccurs="1" maxOccurs="1"/> <xsd:element name="X" type="xsd:integer" minOccurs="1" maxOccurs="1" default="0"/> <xsd:element name="Y" type="xsd:integer" minOccurs="1" maxOccurs="1" default="0"/> </xsd:sequence> <xsd:attribute name="a1reg" type="xsd:boolean"/> </xsd:complexType> </xsd:element> <xsd:element name="DisplayString" minOccurs="0" maxOccurs="unbounded" nillable="true"> <xsd:complexType> <xsd:sequence> <xsd:element name="DisplayStr" type="xsd:string" minOccurs="1" maxOccurs="1"/> <xsd:element name="X" type="xsd:integer" minOccurs="1" maxOccurs="1" default="0"/> <xsd:element name="Y" type="xsd:integer" minOccurs="1" maxOccurs="1" default="0"/> </xsd:sequence> <xsd:attribute name="a1reg" type="xsd:boolean"/> <xsd:attribute name="font"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:enumeration value="f8"/> <xsd:enumeration value="f10"/> <xsd:enumeration value="f13h"/> <xsd:enumeration value="f13b"/> <xsd:enumeration value="f16"/> <xsd:enumeration value="f16b"/> <!-- f18c is a 18 point Comic font --> <xsd:enumeration value="f18c"/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> <xsd:attribute name="halign"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:enumeration value="Left"/> <xsd:enumeration value="Center"/> <xsd:enumeration value="Right"/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> <xsd:attribute name="valign"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:enumeration value="Top"/> <xsd:enumeration value="Center"/> <xsd:enumeration value="Bottom"/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema>
Grandstream Networks
XML Application Note Version 1
Page 8 of 21 Revised: 9/2007
2. Example Idle Screen File
<?xml version="1. 0"?> <!-- This file creates identical result to GXP-2000 default behavior --> <Screen> <IdleScreen> <ShowStatusLine>true</ShowStatusLine> <DisplayString font="f8"> <DisplayStr>$W, $M $d</DisplayStr> <X>0</X> <Y>0</Y> </DisplayString> <DisplayString font="f13h" halign="Center" a1reg="false"> <DisplayStr>$N</DisplayStr> <X>65</X> <Y>12</Y> </DisplayString> <DisplayString font="f13b" halign="Center" a1reg="true"> <DisplayStr>$N</DisplayStr> <X>65</X> <Y>12</Y> </DisplayString> <DisplayString font="f13h" halign="Center" a1reg="false"> <DisplayStr>$X</DisplayStr> <X>65</X> <Y>26</Y> </DisplayString> <DisplayString font="f13b" halign="Center" a1reg="true"> <DisplayStr>$X</DisplayStr> <X>65</X> <Y>26</Y> </DisplayString> <DisplayString halign="Center" valign="Bottom"> <DisplayStr>$I</DisplayStr> <X>65</X> <Y>48</Y> </DisplayString> </IdleScreen> </Screen>
3. XML Explanation
ROOT ELEMENT "SCREEN"
The XML document has root element called Screen; it contains exactly 1 sub-element called IdleScreen.
<xsd:element name="Screen"> <xsd:complexType> <xsd:sequence> <xsd:element name="IdleScreen" type="IdleScreenType" minOccurs="1" maxOccurs="1"/> </xsd:sequence> </xsd:complexType> </xsd:element>
ELEMENT "IDLESCREENTYPE"
This element defines three components that are makes up the idle screen. These components are defined as elements.
<xsd:complexType name="IdleScreenType"> <xsd:sequence> <xsd:element name="ShowStatusLine" type="xsd:boolean" minOccurs="1" maxOccurs="1" default="true"/> <xsd:element name="DisplayBitmap" type="DisplayBitmapType" minOccurs="0" nillable="true"/> <xsd:element name="DisplayString" type="DisplayStringType" minOccurs="0" nillable="true"/> </xsd:sequence> </xsd:complexType>
Note: ShowStatusLine must appear exactly once and any number of DisplayBitmap and DisplayString instances.
Grandstream Networks XML Application Note Version 1 Page 9 of 21 Revised: 9/2007
DISPLAY RULES
When both DisplayBitmap and DisplayString elements are present, all bitmaps will be rendered before the strings are displayed. When multiple instances of the same type (bitmap/string) are present, they are displayed in the order they appear in the XML and later objects (bitmap/string) may overwrite/corrupt previous objects.
ELEMENT "SHOWSTATUSLINE"
This Boolean element displays the status bar on the top of the screen. The "Status Line" includes the registration status icon, volume icon, time/date on the right-top corner, and the horizontal separator line. Example XML Phonebook File
<?xml version="1. 0"?> <AddressBook> <Contact> <LastName>Doe</LastName> <FirstName>John</FirstName> <Phone> <phonenumber>8000</phonenumber> <accountindex>0</accountindex> </Phone> </Contact> <Contact> <LastName>Smith</LastName> <FirstName>Alan</FirstName> <Phone> <phonenumber>8001</phonenumber> <accountindex>0</accountindex> </Phone> </Contact> <Contact> <LastName>Lee</LastName> <FirstName>Lily</FirstName> <Phone> <phonenumber>6000</phonenumber> <accountindex>1</accountindex> </Phone> </Contact> </AddressBook>
Grandstream Networks
XML Application Note Version 1
Page 13 of 21 Revised: 9/2007
Application Three: XML Call Center/Survey Details
XML CALL CENTER / SURVEY DETAILS
1. XML Phonebook Syntax
This section gives a brief overview of the screen layout and the XML syntax. Special Characters As followed by the standard XML recommendation, some characters need to be escaped. The following list the characters together with their escape sequence: Characters & " ` < > Name Ampersand Quote Apostrophe Left Angle Bracket Right Angle Bracket Escape Sequence & " &apos < >
GRANDSTREAM XML OBJECT
Line Keys Display Area
GXP2020 XML Display
140 Pixels
20 Pixels Soft Key Area 100 Pixels 220 Pixels
As illustrated above, XML content will be displayed in the 140 X 220 display area. Accordingly, the soft keys will be displayed in their respective area. It will also overwrite the soft keys functionality to give users control over the XML.
Grandstream Networks
XML Application Note Version 1
Page 14 of 21 Revised: 9/2007
Grandstream GS_XML Object Descriptions
Name GS_XML_Application Display SoftKeys Events Location Root Root Body Root Body Root Body Type Mandatory Optional Optional Optional Values Comments Root element Screen display Programmable Softkey Determines what action to be done when a local event is detected
Display Object Description Name Display Screen *Menu Location Root Body Display Body Display Body Type Optional Display Choice Display Choice Values Comments Screen display Unselectable display Selectable display
* indicates future implementation.
Screen Object Descriptions
Name Screen showLineLabels Location Display Body Screen Attribute Type Display Choice Optional Values Boolean Comments Unselectable display Enable or disable line labels display to extend xml application display area Display a string on the screen Display a bitmap on the screen
DisplayString DisplayBitmap
Screen Body Screen Body
Optional Optional
-
DisplayBitmap Object XML Description
Name DisplayBitmap X Location Screen Body DisplayBitmap Body Type Optional Mandatory Values Integer Comments Display a bitmap on the screen Horizontal starting position depending on halign Vertical starting position depending on
Page 15 of 21 Revised: 9/2007
Y
DisplayBitmap Body
Mandatory
Integer
Grandstream Networks
XML Application Note Version 1
Bitmap
DisplayBitmap Body
Mandatory
Strings
valign Content of the bitmap
DisplayString Object XML Description
Name DisplayString Font Halign Valign Wrap X Location Screen Body DisplayString Attribute DisplayString Attribute DisplayString Attribute DisplayString Attribute DisplayString Body Type Optional Optional Optional Optional Optional Mandatory Values Enum string Left, Center, Right Top, Center, Bottom Boolean Integer Comments Descriptions of a line string The font for a line Horizontal Axis Alignment Vertical Axis Alignment Wrap the text to the next line Horizontal starting position depending on halign Vertical starting position depending on valign A String to display
Y
DisplayString Body
Mandatory
Integer
DisplayStr
DisplayString Body
Mandatory
String
Softkeys Object XML Description
Name SoftKey Label Action Location Display Body Softkey body Softkey Body Type Optional Mandatory Mandatory Values String Enum String Comments Programmable Softkey Label for the index Local Action
Action Object XML Description
Name Action UseURL QuitApp Dial Location Softkey Body Action body Action Body Action Body Type Mandatory Choice Choice Choice Values Comments Action to be taken URL to call to Quit the current XML application Dial a number
The remote server may specify actions for the local phone. These actions must be pre-defined locally before they can be executed. Currently, the local action is to quit the current XML application.
Grandstream Networks XML Application Note Version 1 Page 16 of 21 Revised: 9/2007
Dial Object XML Description
Name Dial Account Number Location Action Body Dial body Dial Body Type Choice Mandatory Mandatory Values Integer Integer Comments Dial a number Account to be used Number to dial
Events Object XML Description
Name Event Location Events body Type Optional Values Comments Describe a specific event
Event Object XML Description
Name State Action Location Event Body Event Body Type Mandatory Mandatory Values Enumerated string Comments The possible state of the phone Action to be taken if phone changes to that state
An action is triggered only if the phone transition INTO such state.
2. EXAMPLE OF SURVEY IMPLEMENTATION
An initial URI is configurable using the web interface. This is the location of the server that the phone will attempt to interact with. It can be triggered by, lets say, overloading the phonebook button or the right arrow button or even by providing a menu in which the user can select with from the phone. [. . . ] Please make note that the account 1 page must be configured with a valid SIP account for the application to run. When the phone boots up, the first soft key will be "XML Service". It is also possible to enter the application server path into a web browser. This way you'll be able to see on your screen the exact XML that your phone is receiving also. [. . . ]