Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The Sangoma Phone's development tools are available via a CGI that can be accessed from any desktop computer after you enable the phone's App Development mode. This guide describes how to access the app development CGI and use the tools via a commandline interface.

CGI Access

The Phone App web service is available from http:// phone-ip-address /cgi-bin/app_dev.cgi. The web service expects a mode parameter with additional parameters as appropriate to the mode.

Phone App Web Service Modes

mode=install

  • Action: Installs an application on the phone.

  • Required parameters: An uploaded zip file containing the application.

  • Optional parametersname: The name of the app contained in the uploaded file. If the name does not match the name in the app.json file, the upload will be rejected.

  • Example

    Code Block
    curl --anyauth --form mode=install --form file=@/tmp/myapp.zip http://PHONE_IP/cgi-bin/app_dev.cgi --user admin:789

...

  • Action: Streams logging output from the app. This includes print() and println() output from the app iteself and certain error messages generated by the app engine related to the specified app.

  • Required parametersappname: The name of the app.

  • Optional parametersprebuffer: Some web browsers will wait until a certain amount of data is buffered up before attempting to display anything. Specifying prebuffer=1024 will cause 1024 spaces, followed by a newline, to be printed out before sending log data. This is normally not needed when using curl or an HTTP library, but can be useful when pointing a browser at this mode.

  • Example

    Code Block
    curl --anyauth --user admin:789 http://PHONE_IP/cgi-bin/app_dev.cgi --form mode=log --form appname=myapp --form prebuffer=1024 

XML responses

In addition, all modes return a short XML document describing the results of the request.

...

-100  error with upload
-101  problem with app.json
-102  invalid app name
-103  app.json requests privileges that aren't allowed
-104, -105, -108  internal errors
-106  missing or invalid cgi parameter 
-108  internal error 
-109  unauthorized (app development mode not turned on) 
-110  insufficient space for install 
-111  uninstall error 

See Also: