addCLIMapping

This application is used to associate a CLI with an Account in order to use calling card (add trusted number record)

Parameters:

  • i_account - i_account of the calling card. Integer. Required.
  • cli - CLI to associate the card with. String. Required.
  • lang - Two character language code to be used for this CLI ('en' for English, 'ru' for Russian, etc. Refer to Languages List). 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.
  • lang - Two character language code to be used for this CLI ('en' for English, 'ru' for Russian, etc. Refer to Languages List). String. Optional. From Sippy 2020.

Returns:

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

delCLIMapping

This application is used to remove the 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 a 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 information about mapping by CLI number. Available from 2.0.

Parameters:

  • cli - CLI number. String. Required.
  • i_customer. Int. Required.

Returns:

  • result - OK means that the operation was successful. String.
  • i_account - i_account of the calling card. Integer.
  • cli - CLI associated with the card. String.
  • lang - Two character language code to be used for this CLI ('en' for English, 'ru' for Russian, etc. Refer to Languages List). 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.request, urllib.parse, urllib.error

from xmlrpc.client import ServerProxy, getparser, ProtocolError


class HTTPSDigestAuthTransport:

    def request(self, host, handler, request_body, verbose=0):

        auth, host = urllib.parse.splituser(host)

        username, password = urllib.parse.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)