Skip to main content

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)

Metadata

Release files for ciscoris 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ciscoris 0.0.5
File Size Uploaded
ciscoris-0.0.5.tar.gz 3.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ciscoris 0.0.5
File Interpreter ABI Platform
ciscoris-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 7.4 kB

Release files / ciscoris-0.0.5.tar.gz

Download URL ciscoris-0.0.5.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
027590bca0fcf1dbdc82d879009eae480c91109b7f543b59b6a27ccdc9059271
BLAKE2b-256 checksum
How to use checksums
75144c606c129788fca53dfed3da5d26b62631f0e9090def07344bf1352ad3f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.0.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4

Release files / ciscoris-0.0.5-py3-none-any.whl

Download URL ciscoris-0.0.5-py3-none-any.whl
Size 3.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
89bd48858f09476ce1eded9daee65c5992e33f4b469bcacc5c7e5df55cb1c5c1
BLAKE2b-256 checksum
How to use checksums
5445609eee54da8b663a3712df933c49af215398299ce61b1738edbe0327dddb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.0.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page