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.2.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: ciscoris-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 4d96bc5abfdefe10afb7f3e539a3c5f000872bd30a3a79e9005ae6a30ca2b65b
MD5 d9157825b644854993370656994c7692
BLAKE2b-256 2430709cb6d12aeb549fd6f060fd6cdd68110a6c1aa5bb080924b601a91183ec

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ciscoris-0.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 61215df3d005c24fa2a04ee92c2076aa99489366f9417ed9539cee5b552cb488
MD5 9e8b1a29c1018ee9c39c53e693e22c1e
BLAKE2b-256 22f6d4a530fdc85fe903b8af2125c01e129eb9ea8f55c45370dd6a811bc07595

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