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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: ciscoris-0.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 06122114b8f6cff3efa453787a4686393172ec4671efbfd51271f155b04d6f26
MD5 1dd3ea97064c63920f30b2ae1ebd2b28
BLAKE2b-256 6976f3a4ade89fbc32e69d39b53aa0ba5435b6c14cd43ea19a69af76e2d7e67d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ciscoris-0.0.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 566f71c28965cebda72b009a2776002d2e905cbd2dbe1cd61afc3de1cb30e279
MD5 5b16322a3d8a0f7f2eece92e6d1d1578
BLAKE2b-256 6c69c5b81734ac75adecd88ff56b0b6c09e89960fc553aff63255c7b8316f230

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