beautypg.com

Launchservice(name, arg, callbackfunction), Getgmiversion – Grandstream GXP2200 GMI Web Service Guide User Manual

Page 34

background image

GXP2200 GMI WEB SERVICE GUIDE V1.0

Page 33 of 38

34. launchService(name, arg, callbackFunction)

Description

• Open an application.
• GXP2200 applications:

AlarmClock

Audio

Browser

Message

Video

Parameters

• name: Application name (case insensitive)
• args: Input parameters
• callbackFunction: Call back function

HTTP Request

• url: http://" + ip +"/manager?"
• action: "launchservice"
• name: name
• args: http://192.168.121.29/a.html
• format: "json"
• jsoncallback: "?" (This is the HTTP request for the call back function, usually used in

AJAX and JQuery)

• For example:

http://192.168.121.230/manager?action=launchservice&name=Browser&arg=http://

192.168.121.29/a.html&format=json&jsoncallback=?

Return

1. HTTP request return:
• Launch successful

"{"res": "success"}"

• Server cannot get data. Open failed

"{"res": "error", "msg" : "open application failed"}" //dbus returns null

• "name" is empty

"{"res" : "error", "msg": "name is empty" }"

• Run application failed

"{"res" : "error", "msg": "run application failed" }"

2. callbackFunction(data) will process the data returned from HTTP request

35. getGMIVersion

Description

Get phone's GMI version number

Parameters

N/A