Skip to main content

Cisco CUCM RIS Library. Simple to use.

Project description

published

ciscoris

Uses Realtime Information Service (RIS) to capture registration status of Cisco IP Phones on CUCM https://developer.cisco.com/docs/sxml/#risport70-api-reference

Install with pip or clone repo

pip install ciscoris

import ris, logcollection or other classes

from ciscoris import ris

specify your CUCM details

cucm = os.getenv('cucm', '10.10.10.10')
version = os.getenv('version', '11.5')
risuser = os.getenv('risuser', 'risadmin')
rispass = os.getenv('rispass', 'p@ssw0rd')

instanciate your RIS object

ris = ris(username=risuser,password=rispass,cucm=cucm,cucm_version=version)

input an array of phones

phones = ['SEPF8A5C59E0F1C', 'SEP1CDEA78380DE', 'SEP01CD4EF58980']

input an array of "process nodes" or nodes which run Callmanager service

subs = ['sub1', 'sub2', 'sub3']

you can use the related ciscoaxl library grab process nodes via API.

def getSubs():
    nodes = axl.listProcessNodes()
    if nodes['success']:
        return nodes['response']

subs = getSubs()

group phones into 1000 and check registrations per group

limit = lambda phones, n=1000: [phones[i:i+n] for i in range(0, len(phones), n)]

groups = limit(phones)
for group in groups:
    registered = ris.checkRegistration(group, subs)
    user = registered['LoginUserId']
    regtime = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(registered['TimeStamp']))
    for item in registered['IPAddress']:
        ip = item[1][0]['IP']

    for item in registered['LinesStatus']:
        primeline = item[1][0]['DirectoryNumber']
    name = registered['Name']

    print('name: '+name)
    print('user: '+user)
    print('primary dn: '+primeline)
    print('ip address: '+ip)
    print('registration time: '+regtime)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ciscoris-0.0.3.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

ciscoris-0.0.3-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file ciscoris-0.0.3.tar.gz.

File metadata

  • Download URL: ciscoris-0.0.3.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5

File hashes

Hashes for ciscoris-0.0.3.tar.gz
Algorithm Hash digest
SHA256 479dc869c5bc940e11c55092338d3da0de31a2e344239a1bbf1638a46452300a
MD5 4f7da9f45ccce213387ff3ea4306c0f3
BLAKE2b-256 439d09233b44ba453b91ef8fd20cee8d5bb87fe6fc2e15bbd7fa7c8b5cbb86f4

See more details on using hashes here.

File details

Details for the file ciscoris-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: ciscoris-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5

File hashes

Hashes for ciscoris-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4276a7a209e442be93d5ff4f6e47c108aa06b8e4373585a2d7902176642baf57
MD5 3ecbe52cfd3399edf7fbdd03cc92ff31
BLAKE2b-256 04639329cd89f9cbbf7b64d01ccc4eaf050822695f239804953de915a120ea72

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page