com.innovaphone.phoneinfo

This API is used for communication with phone/softphone apps. This API is closely related to API "com.innovaphone.phone". If an App provides this API it receives messages "CallAdded" and "CallUpdated" and "CallRemoved". An App can provide call-related display information to the phone app (e.g. about remote party).

provideApi

The provideApi function is used to subscribe for API messages:

var phoneinfoApi = start.provideApi("com.innovaphone.phoneinfo");
phoneinfoApi.onmessage.attach(function (sender, obj) {
    switch (obj.msg.mt) {
    case "CallAdded":
        break;
    case "CallUpdated":
        break;
    case "CallRemoved":
        break;
    }
});

Messages

CallAdded, CallUpdated, CallRemoved

CallAdded

Send by Phone-App to all API providers whenever a new call is born.

{
    mt: "CallAdded",
    id: 1,
    guid: "fff79c5bd2115d0109f400903341035b"
}

Parameters

string mtmessage type [mandatory]
number iduniqe call-id [mandatory]
string guidglobally uniqe call-id [optional]

CallUpdated

Send by Phone-App to all API providers whenever call's attributes have changed.

{
    mt: "CallUpdated",
    id: 1,
    guid: "fff79c5bd2115d0109f400903341035b",
    dir: "i",
    num: "200",
    sip: "charlie.chaplin",
    dn: "Sir Charles Spencer Chaplin",
    state: "Connected"
 }

Parameters

string mtmessage type [mandatory]
number iduniqe call-id [mandatory]
string guidglobally uniqe call-id [optional]
string dir"i" for inbound call or "o" for outbound call [mandatory]
string numPhonenumber (e.g. 202 or +49 7031 73009 0) [optional]
string sipSIP-URI (e.g. charlie.chaplin or charlie.chaplin@unitedartists.com) [optional]
string dnDisplayname [optional]
string stateSetup | Dialing | Ringback | Queued | Alerting | Connected | Holding | Held | Disconnected [mandatory]

CallRemoved

Send by Phone-App to all API providers whenever a call has died.

{
    mt: "CallRemoved",
    id: 1,
    guid: "fff79c5bd2115d0109f400903341035b"
}

Parameters

string mtmessage type [mandatory]
number iduniqe call-id [mandatory]
string guidglobally uniqe call-id [optional]

Example

An App can provide call-related display information to the phone app (e.g. about remote party).
See API "com.innovaphone.phone" for details.

var phoneApi = start.consumeApi("com.innovaphone.phone");
var phoneinfoApi = start.provideApi("com.innovaphone.phoneinfo");
phoneinfoApi.onmessage.attach(function (sender, obj) {
    switch (obj.msg.mt) {
    case "CallAdded":
        break;
    case "CallUpdated":
        if (obj.msg.state == "Connected") {
            phoneApi.send({ mt: "CallInfo", id: obj.msg.id, guid: obj.msg.guid, html: "<div>Here's my info</div>" }, obj.consumer);
        }
        break;
    case "CallRemoved":
        break;
    }
});