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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: ciscoris-0.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 2425b21074f2e92235f064aeddbe3b2f05ef4638144963a9a34ec664a6b5c6b0
MD5 2edf64052d1bbc3d227cd078d77c043a
BLAKE2b-256 65c7e6fd2b605e277e8d7bf1d8e43a4c22d950b03b70eb8c633dbc22ef057fb9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ciscoris-0.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 60c6a20c3b45972cae87cbc264ee83ad93174a69f83e0e48e8fbf672f7ffa6c5
MD5 eeaf04611da4d3f695f58762a25fa2ae
BLAKE2b-256 172b83f2880f3ed21989ab4c5967219bab2b133a05e54141c573c7f63f39f1c8

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