[. . . ] Grandstream Networks, Inc.
GXV3140 IP Multimedia Phone GMI HTML SDK and API Guide
1 What is GMI?
GMI (Grandstream Manager Interface) is a management API developed by Grandstream Networks. It is designed for our IP Multimedia phones, and allows partners to develop customized applications on the phone. GMI supports standard HTML/CSS/Javascript code, so that users can use these dynamic web page development languages to develop their customized application. GMI will display the application on the phone based on the pages generated. [. . . ] transfer2num (destnum) Transfer the call to the destination number (when transfer mode is activated) NoteTransfer current line to destnum. If the user wishes to implement a one-button transfer, they can implement a textbox to enter the number and call the two functions GMIEngine. transfer () and GMIEngine. transfer2num (destnum) consecutively when the user presses the button to submit.
Parameter Value:
and
Return Parameter: destnum The number to transfer to Return Value: None
Additional Description:
None
Grandstream Networks, Inc. www. grandstream. com
GMI HTML SDK and API Guide
Page 15 of 43 Last Updated: 09/2010
4. 19 GMIEngine. Return Parameter: id--id value for the display text type, used to display the current input method. cb_input_changed-- Callback function for the change input method function. The function prototype is function cb_input_changed(result), the parameter "result" is the response to the change input method request. For example, {"Response":" Success", ", "InputMethod": "abc" }; "Response" returns the result. There are two possibilities"Success" or "ERROR", "InputMethod" returns the current input method.
Return Value: None Additional Description: None
5 GMI Applet Application
The GMI Applet is closely related to the GMI application, but there are some small differences. The similarities between GMI Appler and GMI include: Both will model the application interface based on the obtained html page. Both supports cross-domain interaction (between the user-defined webserver and the built-in GMI server on the phone) and supports the same GMI API functions. The differences are: GMI Applet is a desktop plugin application while GMI application will need to launch a separate application. Since GMI Appletis a desktop plugin application and the softkeys/navigation buttons are being used by the desktop application; therefore, the Backspace and the Shift keys are used to replace the F3 and F4 keys. When writing the GMI Applet Application source code, the Backspace key event should be mapped to the F4 key event and the Shift key event should be mapped to the F3 event.
Grandstream Networks, Inc. www. grandstream. com GMI HTML SDK and API Guide Page 16 of 43 Last Updated: 09/2010
Alsono modification in the menu. xml file is necessary for the GMI Applet. By default, the user can locate the GMI applet under the phone menu->Personalize->Screen Layout and configure the URL for the phone to obtain the page. For more details and examples, please refer to the two source files in the applet folder (ajax. html and timer. html) Fileapplet/ajax. html function softkey_process(keyCode) { document. title = "Applet-Ajax: in softkey_process, keyCode = " + keyCode; switch (keyCode) { case 8: //Process F3 event in Backspace keyevent //Backspace GMIEngine. refresh(); break; case 16: //Process F4 event in Shift keyevent //Shift var orig = document. location; var dst = orig. href. replace(/ajax/i, "timer"); GMIEngine. gotourl(dst); break; case 112: //F1 process here; break; case 13: //Enter process here break; case 113: //F2 process here; break; case 114: //F3 process here; break; case 115:
Grandstream Networks, Inc. www. grandstream. com GMI HTML SDK and API Guide Page 17 of 43 Last Updated: 09/2010
//F4 process here break; case 37: //Left process here break; case 38: //Up process here case 40: //Down process here break; case 39: //Right process here break; default: break; } }
6 GMI Demo Program
6. 1 Menu Example
Figure 2: Menu Example illustration
Grandstream Networks, Inc. www. grandstream. com GMI HTML SDK and API Guide Page 18 of 43 Last Updated: 09/2010
Refer to the code and the comments below for the implementation of the Menu Example: Fileindex. html /****************************************************************************** * After the page loads, the first item will be highlighted. At the same time, all the keypad events are handled by softkey_process(keyCode). softkey_process has mapped F1/Enter button to "Select" to load the url of the selected item. F2 is mapped to the API function call GMIEngine. refresh() to refresh the current page, F4 is mapped to the API function call GMIEngine. exit() to exit the application. [. . . ] www. grandstream. com GMI HTML SDK and API Guide Page 35 of 43 Last Updated: 09/2010
</tr> </table> </body> </html>
6. 6 Message Example
Figure 6: Message Example illustration
Refer to the code and the comments below for the implementation of Message Example: Filemessage. html //After the page loads, map the up/down button to tab/alt+tab function bind_tab() { GMIEngine. mapupdown2tab(); } //When the page unloads, revoke the mapping between tab/alt+tab function unbind_tab() { GMIEngine. revokemap(); } /****************************************************************************** * After the page loads, map the up/down button to tab button. When the page unloads, revoke this mapping so that it would not influence other pages. * * At the same time, all the key events are handled by the softkey_process function. ******************************************************************************/
Grandstream Networks, Inc. [. . . ]