addCLIMapping

This application is used to associate a CLI with some calling card.

Parameters:

  • i_account - i_account of the calling card. Integer. Required.
  • cli - CLI to associate the card with. String. Required.
  • lang - what IVR language should be used for this CLI. String. Required.

Returns:

  • result - OK means that CLI mapping successfully added. String.
  • XMLRPC fault in case of any error.

updateCLIMapping

This application is used to update an already existing trusted number.

Parameters:

  • i_account - i_account of the calling card. Integer. Required.
  • old_cli - String. Required.
  • new_cli - String. Required.

Returns:

  • result - OK means that CLI mapping successfully updated. String.
  • XMLRPC fault in case of any error.

delCLIMapping

This application is used to remove an association of a CLI with a calling card.

Parameters:

  • i_account - i_account of the calling card. Integer. Required.
  • cli - CLI to associate the card with. String. Required.

Returns:

  • result - OK means that CLI mapping successfully removed. String.
  • XMLRPC fault in case of any error.

listCLIMappings

This application is used to retrieve the list of CLIs associated with given calling card.

Parameters:

  • i_account - i_account of the calling card. Integer. Required.

Returns:

  • result - OK means that operation successful. String.
  • list - array containing a set of (CLI, lang) tuples
  • XMLRPC fault in case of any error.

findCLIMapping

This application is used to retrieve info about mapping by CLI number. Available since 2.0.

Parameters:

  • cli - CLI number. String. Required.

Returns:

  • result - OK means that operation was successful. String.
  • i_account - i_account of the calling card. Integer.
  • cli - CLI associated with the card. String.
  • lang - what IVR language should be used for this CLI. String.
  • authname - authname of associated account. String.
  • username - username of associated account. String.
  • XMLRPC fault in case of any error.

Example

Python example:

# this script requires httplib2 to be installed from http://code.google.com/p/httplib2/
import httplib2
import urllib
from xmlrpclib import ServerProxy, getparser, ProtocolError

class HTTPSDigestAuthTransport:
    def request(self, host, handler, request_body, verbose=0):
        auth, host = urllib.splituser(host)
        username, password = urllib.splitpasswd(auth)

        h = httplib2.Http()
        if verbose:
            h.debuglevel = 1
        h.add_credentials(username, password)

        resp, content = h.request("https://" + host + handler, "POST", body=request_body,
                                  headers={'content-type':'text/xml'})

        if resp.status != 200:
            raise ProtocolError("https://" + host + handler,
                                resp.status, resp.reason, None)

        p, u = getparser(0)
        p.feed(content)

        return u.close()

transport = HTTPSDigestAuthTransport()
client = ServerProxy("https://username:password@1.2.3.4/xmlapi/xmlapi", transport)

# add a mapping
res = client.addCLIMapping({ 'i_account' : 1234, 'cli' : '123456', 'lang' : 'en' })
print res['result']

# retrieve list of trusted numbers
res = client.listCLIMappings({ 'i_account' : 1234 })
if res['result'] == 'OK':
    for cli, lang in res['list']:
        print cli, lang