Dial Action Provisioning

Overview

Dial Actions are operations which can be performed on numbers or sip uris. More details can be found in Dial Actions article.

This document describes the format of Programmable Dial Action definition and the web service which may be used to provision them from server.

Programmable Dial Actions are normally set from Initial Provisioning Web Service, by including a <dialActions> node in the response. The web service described in this document can be used to update the dial actions later, the app will be calling it periodically at preconfigured intervals.

Parameters

Parameter templates for Dial Action Provisioning can use any variables from Global parameters scope. There are no service-specific parameters defined.

Configuration

This web service is only configurable from Cloud Softphone Portal or using the Preference Keys in the SDK. The web service follows the convention specified in Web Service Definition.

Prefix

The prefix for this web service is dialActionWs.

Example: dialActionWsUrl, dialActionWsPostData etc.

dialActionWsRefresh

Specifies how often will the app check for dial action updates. The value is in seconds and the default is 86400 (24 hours)

Example:

<dialActionWsRefresh>3600</dialActionWsRefresh>

Response

The response will be considered successful if the HTTP response code is 2xx. Any responses which have other response code, or whose body can’t be parsed, are silently ignored.

Content-type of the response must be application/xml.

The response XML should have a root node, under which there are subnodes named dialAction. Each dialAction subnode is Mergeable XML and will be merged with the dialactions stored in the app.

The dialAction XML node may have the following attributes:

id

Unique identifier of this dial action. When merging, the app will try to find a dialAction with the same id which is already stored in the app. If not found, the incoming dialAction is simply saved, otherwise it’s merged with the existing one.

action

The default action is merge, which merges this dialAction with those already stored in the app. In case you specify action=remove, the app will try to find stored dialAction with the same id and if found, this dialAction will be deleted.

Inside dialAction nodes are Mergeable XML key nodes, which have the usual attributes source and priority. The following key nodes are supported:

displayName

This key node contains the name of dial action, as it will be shown to user. The content of this node is localizable; it is possible to provide multiple translations.

condition

Some dial actions will need network connection, otherwise it doesn’t make sense to offer them to the user. Others will only work on a device with cellular call capability (like call-through based dial actions).

Possible values: <empty>, net, gsm. If left empty, the condition will always show; otherwise it will show only if network or cellular capability is detected.

Example:

<displayName priority="20" source="extProv">
   <value lang="cs">Nahrávaný hovor</value>
   <value lang="jp">記録されたコール</value>
   <value>Recorded Call</value>
</displayName>

rewriting

Contains the rules to be applied to the dialed number when this dial action is used. These rules may modify the number, set some flags and specify the next dial action to be performed with the result. In case the next dial action is one of Basic Dial Actions, it is executed.

The syntax of rewriting rules and actions is described in the article about Number Rewriting.

Examples

GET method, XML

request:

GET /dialactions HTTP/1.1
Host: example.com
Connection: close
Cache-Control: max-age=0
User-Agent: CloudSoftphone/1.5.6

response:

HTTP/1.1 200 OK
Date: Sun, 15 Mar 2015 00:46:17 GMT
Server: Apache/2.4.7 (Ubuntu)
Vary: Accept-Encoding
Content-Length: 1234
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/xml

<response>
  <dialAction id="recordCall">
    <displayName>
      <value lang="cs">Nahrávaný hovor</value>
      <value lang="jp">記録されたコール</value>
      <value>Recorded Call</value>
    </displayName>

    <rewriting>

      <rule>
        <conditions/>
        <actions>
          <action type="overrideDialAction" param="autoCall"/>
          <action type="recordCall"/>
        </actions>
      </rule>

    </rewriting>
  </dialAction>

  <dialAction id="monitorCall">
    <displayName>Monitor</displayName>

    <rewriting>

      <rule>
        <actions>
          <action type="overrideDialAction" param="autoCall"/>
          <action type="continue"/>
        </actions>
      </rule>

      <rule>
        <conditions>
          <condition type="doesntStartWith" param="#"/>
        </conditions>
        <actions>
          <action type="prepend" param="#11#"/>
        </actions>
      </rule>

    </rewriting>
  </dialAction>
</response>