Reference

Overview

The innovaphone SDK has 3 parts a developer needs to know to create apps for the app platform:

Contents

C++ library for App ServicesUsed to develop an app-service in C++ that is running on the app platform.
JavaScript library for App ServicesUsed to develop an app-services in JavaScript that is running on the app platform.
JavaScript library for AppsA library to create the JavaScript UI for an app (if there is any).
APIs There are different kinds of APIs that can be used for communication between different components of the system (app, app service, PBX).
Protocols Different protocols used by Apps, e.g. the Sysclient protocol within the Devices App.
How to use the AppStore The AppStore can be used to publish apps.

C++ library for App Services

The C++ library of the innovaphone SDK is a set of interfaces and classes used to create C++ apps to run on the app platform. The services provide everything an app needs to be registered into the app manager, access the a database, manage configuration, communicate with a PBX, have access to the outside world by using sockets or an HTTP client, be accessed from outside by registering itself as kind of a plugin into the app platforms webserver and more. Even if standard C++ will be used to develop an app, the app must use the interfaces to work proberly within the app platorm.
The following interfaces and classes are provided by the C++ library:

App Service Interfaces

Fundamentals

iomuxRuntime for asynchronous programming model using callbacks and timers, providing the main loop for the app service.
appserviceBase classes for any App Service and App Instance. Handles the connection to the app platform manager that is used to start and stop instances and for logging.

Basic interfaces

taskBase class for encapsulating complex flows into single asynchronous tasks.
callbackA helper interface to hide implementation details about callbacks from the using code.
debugClass for debug output and logging.
valgrindInterface to check if valgrind is active.

App Platform Interfaces

These interfaces provide access to core components of the App Platform, such as webwerver, database, sockets and system inferfaces.

Platform interfaces

webserver_plugin Attach to the webserver to receive incoming websocket connections and HTTP requests.
databaseAccess to the database of the app instance.

System interfaces

socketSockets (Local, UDP, TCP, TLS).
dnsResolve DNS names.
ethernetGet local MAC addresses.
networkGet local IP addresses.
fileFile and directory operations.
command Running commands on the operating system
random Random number generator.
timeGet Date and time
timezoneHelpful to make timezone relevant time calculation.
guuid Create GUIDs.
processCreate child processes.
staskRun tasks in a separate thread with callbacks to the main thread.
worker Run intensive tasks in a separate process.
systemInterface to access system information.
usersSystem user tools.
translationTranslation of Texts with an external service.

App Platform Libraries

The libraries provide complex functionality that is often needed using App Platform interfaces.

Webserver

httpfileBase class for static httpfiles that are part of the app binary.
httpfiles_unzipLibrary for static httpfiles that are provided in a separate ZIP file.
appwebsocket Base class for incoming AppWebsocket sessions (from the app or the PBX).
app_updates Library for sending continous updates to the app sessions over the AppWebsocket connections.
webdavservice.h WebDAV server implementation using the WebserverPlugin and the DbFiles interface of the app instance.

Database

tasks_postgresql Initialization of database tables.
database_switch Share a database connection between many users.
dbfiles Store and read files from the database of the app instance.
config Configuration of app instances.

Network

websocket_client Websocket connections to other servers.
appwebsocket_client Connect to other app services using the AppWebsocket protocol.
appwebsocket_authenticator Connect to other app services using the AppWebsocket protocol.
http_client HTTP requests to other servers.
common/interface/smtp Sending emails
alarm_clientInterface for sending alarms and events (via POST) to an alarm server..

Files

files Read additional files that belong to the app service.
tasks_file Task-based library for reading and writing files.

Libraries for Appwebsocket APIs

json_apiClasses to hook into an appwebsocket connection to provide a JSON api interface.
pbx Implementation of the PbxApi on AppWebsocket connections from the PBX.
pbx_admin Implementation of the PbxAdmin API on AppWebsocket connections from the PBX.
services Implementation of the Services API for communications between App Services.
replication Implementation of the Replication API on AppWebsocket connections from the PBX.
badgecount_signaling Accept subscriptions for badge counts on AppWebsocket connections using the "PbxSignal" API.

Libraries for launcher services (myApps launcher only)

mediaAccess to audio / video.
appsharingAccess to application sharing.
ringerPlayback and configuration of ringtones.
apiwebsocket_clientA base class for providing and consuming client APIs in local services.

Standalone Libraries

Parsing / encoding

jsonA lightweight class to parse and create JSON.
xmlA lightweight class to parse and create XML data.
asn1Base classes for ASN.1 data structures.
asn1_berEncoder / decoder library for the ASN.1 Basic Encoding Rules
ans1_perEncoder / decoder library for the ASN.1 Packed Encoding Rules
base64Tools to encode / decode base64.
uriAn URI parser.
http_query_argsTools to parse HTTP query arguments.
httplibA set of classes to parse and create HTTP headers.
pdfCreation of PDF documents.
certificatesClass to handle certificates.
zipSimple librarary for creating small, uncompressed ZIP files.

Data types and structures

strA set helper functions for UTF-8 strings.
btreeBass class for binary trees.
ilistA ligthweight, stl::list like template to create lists.

Encryption / hashes / checksums

cipherLibrary for basic encryption which supports AES, DES and RC4.
hashCan be used to compute hash values and HMACs.
crcTools to handle crc32 checksum.

Other

languageLibrary for translated texts in app services.

JavaScript library for App Services

App services can also be created using the JavaScript Runtime. It provides the following libraries and interfaces that you can use in your code:

Global scopeFunctions and variables in the global scope.
AppInstanceInformation about the configuration of the app instance.
AppWebsocketClientLibrary for outgoing AppWebsocket connections.
ConfigLibrary for configuration.
CryptoLibrary for cryptography, including hash, hmac and encryption.
DatabaseLibrary for database access.
DnsLibrary for DNS.
EncodingLibrary for conversion between different data types and encodings.
HttpClientLibrary for outgoing HTTP requests.
SmtpClientLibrary for sending emails.
NetworkLibrary for basic networking and general sockets (TCP, TLS, UDP).
JsonApiLibrary for providing JsonApis on incoming appwebsocket connection. Can be used for communication with the web application.
PbxApiLibrary for communicating with PBXes on incoming appwebsocket connections.
RandomLibrary for creating random numbers or data.
TimersLibrary for timers.
WebServerLibrary for incoming HTTP requests.
WebsocketClientLibrary for outgoing Websocket connections.
FileSystemLibrary for reading files.

JavaScript library for Apps

The UI for the app is written using JavaScript. The benefit is, that the UI runs inside a browser and the myApps client, the desktop or mobile devices. That also means, that the UI must be developed in a way to dynamically fit into the available size. For some of the base functionalities (like communication with the app-service, authenticating, loading of configuration, creating nodes), the JavaScript library provides some tools.

lib1The fundamental library that is needed for all apps. It defines that start object that is the interface to the app runtime inside myApps. It also includes functions for translated texts and events.
appwebsocketLibrary for authentication and communicating with the app service using a websocket connection.
cryptoLibrary for encryption, decryption and hashes.
crypto.ecdhLibrary for ECDH(E) key agreement.
configLibrary for configuration of the app.
countriesList of country names in English and in the local language.
phonenumberLibrary that contains various functions related to phone numbers.

For building user interface using Javascript the SDK provides a slim library for creating and handling HTML elements.

ui1.libDefines the node prototype that is used for all UI classes. Also it defines classes for simple items (div, input, checkbox) and a library for color schemes and dynamic translated UI texts.
ui1.svgSVG image
ui1.autocompleteinputInput field with auto-comletion
ui1.editorEditor for HTML content
ui1.fileFile selection dialog
ui1.listviewSortable list
ui1.playerAudio player
ui1.radiobuttonRadio button
ui1.scrollingContainer with styled scrollbar
ui1.switchOn/off switch
ui1.tableResponsive HTML table
ui1.popupPopup
fontsCollection of fonts used in the innovaphone apps.

APIs

Client APIs

Client APIs are used for communication between (web-)apps running in myApps. HTML5 Window messaging is used for transport between the IFrames. Each API defines an identifier (like com.innovaphone.phone), an API model and messages. Each Provider can has its own model that can be used to publish status information. Each app can provide and consume APIs. Hidden apps can be used for providing APIs in the background, without an UI being shown to the user. There is a bridge between the myApps webclient and the launcher, so that client APIs can also be provided or consumed by components of the launcher. Permission to client APIs is granted per user by allowing access to the corresponding

com.innovaphone.client User details (display name, sip, phone number, email address, guid) Tiles on the home screen, Available phone apps, Profile app
com.innovaphone.launcher Push token, User activity status (auto apear offline), Support for popup windows (only on computers, not on smartphones) URLs and passwords for launcher services, Touch support, Locking state of smartphones
com.innovaphone.search Search in the contents of other apps (e.g. contact details)
com.innovaphone.phone See registration status and current calls; Start calls; Provide call-related information to phone-app
com.innovaphone.phoneinfo Recv information about current calls in real-time
com.innovaphone.phonelookup Lookup phone numbers in databases (e.g. local Outlook addressbook) to find name formation for incoming calls
com.innovaphone.chat Start chats
com.innovaphone.avatar Base URL for profile picture, domain of the provider Key for authentication
com.innovaphone.calllist Get recent calls
com.innovaphone.devices Find/configure devices
com.innovaphone.devicesui Show device (by MAC address or name)
com.innovaphone.events Send events, alarms and logs
com.innovaphone.manager Find app platforms, configure app platforms
com.innovaphone.files Get shared announcements
com.innovaphone.discussion Create an iframe containing a discussion
com.innovaphone.autostart Autostart without user interaction for hidden apps.

App Service APIs

Service APIs are used for communication between App Services. Websocket is used for transport. Each API defines an identifier (like com.innovaphone.devices) and messages. The PBX API "Services" can be used to find Service PBX APIs and authenticate against them.

com.innovaphone.devices Used to create provisioning codes.
com.innovaphone.channels Used by the PBX to find a channels app service providers.

Launcher services

Launcher services accept websocket connections from apps. Apps can find and authenticate against launcher services using the Client API com.innovaphone.launcher. We used launcher services for call functionality that might be too load-intensive in a Client API (signalling, starting ring tones).

Media Audio, video, appSharing, headset buttons
Ringer Play ringtones

PBX APIs

The following APIs can be used with all AppWebsocket connections with the PBX. A permission for the API needs to be enabled at the app object.

Signal This is the generic JSON signaling signaling protocol, which is mapped by the PBX to any standard Voip Signaling like SIP or H.323
PbxSignal Protocol to register to the PBX and do signaling with the JSON signaling protocol
EpSignal This protocol allows to attach to a device registered to the innovaphone PBX and intercept all signaling to and from this device
RCC Perform remote call control operations with registered endpoints
PbxMessages The protocol to retrieve stored chat messages
PbxApi Presence monitoring and management of favourites
PbxAdminApi Configuration of the PBX and pseudo objects
PbxTableUsers User objects replication from the PBX to your app instance
Replication Replication of tables. Use "api":"PbxTableUsers" to replicate the PBX user objects to your app instance.
Services Finding and authenticating against other app services
Impersonation API to use other APIs on behalf of a given user

Separate from that the PBX supports the following websocket protocols that are not related to AppWebsocket connections.

myApps The protocol of the myApps client.

PBX REST and SOAP APIs

There are some REST and SOAP APIs that are supported by the PBX.

SOAP The PBX provides an Api for call-control and administration features with the standard SOAP protocol. With a wsdl file this SOAP API can be integrated in many development environment. Please note that the functionality of that legacy API is available using the Websocket APIs RCC and PbxAdminApi. Implementations based in the current SOAP interface will remain working.
CDR The PBX creates Call Details records, which may be delivered using several methods. These CDRs are XML documents created for individual users/objects of the PBX describing a call as seen by this user.
Recording In phones as in gateway media-relay interfaces a recording URL can be configured, which is used to write media data of any calls to a HTTP server.

PBX Interface

There are PBX-Interfaces, which can be used by an app.

Textmedia The PBX provides an interface for the transcription of Speech to Text.

Protocols

There are some protocols used by innovaphone Apps.

Sysclient The sysclient protocol is used by devices to register in the Devices App.
Push Protocol used between the PBX and the innovaphone Push service.

How to use the AppStore

After an app has been built, it can be published on the AppStore. Here you can find how to use the AppStore for this.