Grandstream Networks, Inc.
1 GMI V2.0 Overview GMI (Grandstream Manager Interface) is a management API developed by Grandstream Networks. Designed for our IP Multimedia phones, it allows partners to develop customized applications on the phone. GMI supports standard HTML/CSS/Javascript, 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 web pages generated.
submenu. The parameter “icon” specifies the icon displayed and “display-name” specifies the text displayed in the phone menu. The parameter type="gmiapp" specifies that this is a GMI application, and the parameter “link-url” specifies the URL address at which this application is stored. In this example, the phone will point to the link below to get the corresponding application to display on the phone: http://www.ipvideotalk.com/V2/ .
simpleGMI Interface 4.1 simpleGMI.refresh() Function simpleGMI.refresh() Description Refresh the current page. The phone will obtain the current page from the web server and reload the page on the phone. Parameters and Return value Parameter: N/A Return value: N/A Note This interface is mainly for debugging.
www.baidu.com When the user is browsing the webpage www.baidu.com, the function call to: simpleGMI.historypage(-1) will allow the user to return to the last page visited (www.yahoo.com). At this point, the last page visited will be www.google.com. If the function: simpleGMI.historypage(-1) is called again, the user will return to www.google.com and the next page visited is www.baidu.com. If the function: simpleGMI.historypage(1) is called, the user will return to www.yahoo.com.
Parameters and Return value Parameter: acct - the account to be used starting from 0 isVideo - video call or not. 1-Yes, 0-No isDialPlan - check dial plan or not. 1-Yes, 0-No number - number to be dialed headers - add in SIP header. For instance, when “headers” is: myheader1=myvalue1&myheader2=myvalue2 When Call is initiated, the following two headers will be added in INVITE: myheader1: myvalue1 myheader2: myvalue2 Return Value: N/A Note N/A 4.5 simpleGMI.transfer() Function simpleGMI.
destnum - the destination number to be transferred to Return Value: N/A Note Valid only when the current call is in transfer status. If users would like to use one-key-transfer, users could enter the number first then call simpleGMI.transfer() and simpleGMI.simpleGMI(destnum) in the return function to dial out. 4.7 SimpleGMI.hangup() Function SimpleGMI.hangup() Description Hang up the current call. Parameter and Return Value Parameter: N/A Return Value: N/A Note N/A 4.8 simpleGMI.
AlarmColck - “AlarmClock” BunnyHunt - “BunnyHunt” Picture Matching - “Buzzy” Calculator - “Calculator” Calendar - “Calendar” Color Code - “colorcode” Facebook - “Facebook” File Manager - “FileManager” Flickr - “Flickr” Gobang - “Gobang” Google Voice - “GoogleVoice” Tetris - “gottet” Internet Radio - “InternetRadio” IP to Location - “IP2Location” Last.
N/A Note LaunchServer’s program must exist in the menu which has already removed the unused items. Otherwise, it could not be launched. For instance, if Youtube has already been removed from menu.xml, launchService(“Youtube”) could not be launched. 4.9 simpleGMI.play() Function simpleGMI.play(url, mode) Description Play the audio/video as specified in url Parameter and Return Value Parameter: url - specify the url address of the audio/video to be played.
Description Send data to specific port of specific host Parameter and Return Value Parameter: host - destination host or IP address port - destination udp port data - send data contents (format: string) Return Value: N/A Note N/A 4.12 simpleGMI.post() Function simpleGMI.
N/A Return Value: N/A Note N/A 4.14 simpleGMI.fullScreen() Function simpleGMI.fullScreen() Description Display in full screen. The control bar on the right hand side will not be displayed. Parameter and Return Value Parameter: N/A Return Value: N/A Note N/A 4.15 simpleGMI.normalScreen() Function simpleGMI.normalScreen() Description Normal display mode. The control bar on the right hand side will be displayed.
Description Obtain network information Parameter and Return Value Parameter: N/A Return Value: Return strings in JSON format. It has to be transformed to JSON format first. For instance: {“mac”: “00-0b-82-27-ea-ed”, “ip”: “192.168.1.118”, “mask”: “255.255.255.0”, “type”: “DHCP”, “gateway”: “192.168.1.1”, “dns”: “192.168.1.253”, “nat”: “Port Restricted Cone NAT (STUN)”} Strings in red will be displayed as the actual value in the phone. Note N/A 5.2 GMIEngine.
N/A Return Value: Return string in JSON format. It has to be transformed to JSON format first. For instance: {“country”: “CN”} Strings in red will be displayed as the actual value in the phone. Note N/A 5.4 GMIEngine.getAccountInfo() Function GMIEngine. getAccountInfo() Description Obtain the account info Parameter and Return Value Parameter: N/A Return Value: Return string in JSON format. It has to be transformed to JSON format first.
5.5 GMIEngine.put() Function GMIEngine. put(family, valuelist) Description Store the data specified by the parameter Parameter and Return Value Parameter: family – The family where the data belongs to valuelist – The data list to be set. The values should be separated by “&”. Return Value: N/A Example: The variables and function are as below: var ip = “192.168.1.220”; var name = “admin”; var password = “admin”; GMIEngine.
var valueList = GMIEngine.get(“HoneyWell”, “name&ip&password”); If the variables have been set as below: var ip = “192.168.1.220”; var name = “admin”; var password = “admin”; GMIEngine.put(“HoneyWell”, “ip=” + ip + “&name=” + name + “&password=” + password); Then the following expression var valueList = GMIEngine.get(“HoneyWell”, “name&ip&password”) will return {“name”: “admin”, “ip”: ”192.168.1.
Array: GMIEngine.accountActive[0] GMIEngine.accountActive[1] GMIEngine.accountActive[2] are corresponding to the status of the three accounts GMIEngine.accountName Account name. Array: GMIEngine. accountName[0] GMIEngine. accountName[1] GMIEngine. accountName[2] are corresponding to the name of the three accounts GMIEngine.accountServer SIP server of the account. Array: GMIEngine. accountServer[0] GMIEngine. accountServer[1] GMIEngine.
GMIEngine. accountCallerID[2] are corresponding to CallerID of the three accounts Users could use these variables directly in Javascript, for instance: var account1Uri = GMIEngine.accountUserID[0] + "@" + GMIEngine.accountServer[0]; var account2Uri = GMIEngine.accountUserID[1] + "@" + GMIEngine.accountServer[1]; var account3Uri = GMIEngine.accountUserID[2] + "@" + GMIEngine.accountServer[2]; Grandstream Networks, Inc. www.grandstream.