Giter Site home page Giter Site logo

gve-sw / cisco_cucm_axl_phone_inventory_flask_sample Goto Github PK

View Code? Open in Web Editor NEW
8.0 7.0 2.0 3.94 MB

Flask web app that display several information details about all the phone endpoints from your CUCM environment

License: Other

Python 67.37% HTML 32.63%
gve-devnet

cisco_cucm_axl_phone_inventory_flask_sample's Introduction

cucm_phone_inventory

Flask web app that displays several information details about all the phone endpoints from your CUCM environment

In this sample, you will be able to see an example of a front-end and back-end solution that utilizes the Administrative XML Layer (AXL) API and Risport (realtimeservice) API for Cisco Unified Communications Manager with python to view a list of all your phone endpoints.

Author:


Important Notes

  • The two test files are include to explore the responses that the api calls returns for the phones
  • The serial number will only display for phones that have a routable ip address from which this flask server will be running on.
  • The method this script is using, is grabbing the ip address for the phone, and then web scraping the phone's web page to grab the serial numbter.
  • If phone does not have an IP address, the serial number will show as "unassigned" and if the ip address is unreachable from the hosted server, the serial number will show as "unaccessible"

Prerequisites

Setup instructions

  1. Go to CUCM admin page and retrieve the AXL toolkit files from your environment.

1a. Click on Applications and then plugins. alt text

1b. Search for AXL and install the AXL toolkit alt text

  1. install and clone this repo onto a server that has python3 installed

  2. install and create a virtual environment for your project (https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/)

  3. enter the virtual environment by entering the terminal command

source (venv name)/bin/activate
  1. install dependencies by entering the terminal command
pip3 install -r requirements.txt file
  1. Edit user_env_default.py and add your CUCM environment and user details alt text

  2. After including your information on the user_env_default.py file, enter the terminal command

cp user_env_default.py user_env.py
  1. In main.py file, change to the desired ip address that is routable so people within the same network can visit the site. alt text

  2. Enter terminal command to start up flask server

python3 main.py
  1. If steps are complete and the flask server is up and running, user will be able to visit the page on port 5000 on the ip address that was provided.

Screenshots

alt text

API Reference/Documentation (VERY USEFUL TO CHECK OUT!):

License

Provided under Cisco Sample Code License, for details see LICENSE

Code of Conduct

Our code of conduct is available here

Contributing

See our contributing guidelines here

DISCLAIMER:

Please note: This script is meant for demo purposes only. All tools/ scripts in this repo are released for use "AS IS" without any warranties of any kind, including, but not limited to their installation, use, or performance. Any use of these scripts and tools is at your own risk. There is no guarantee that they have been through thorough testing in a comparable environment and we are not responsible for any damage or data loss incurred with their use. You are responsible for reviewing and testing any scripts you run thoroughly before use in any non-testing environment.

cisco_cucm_axl_phone_inventory_flask_sample's People

Contributors

ggchaves avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cisco_cucm_axl_phone_inventory_flask_sample's Issues

Erros

Hi

How can i fix that:

[2020-10-22 15:05:29,059] ERROR in app: Exception on / [GET]
Traceback (most recent call last):
File "/root/.pyenv/versions/3.7.9/lib/python3.7/urllib/request.py", line 1350, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
File "/root/.pyenv/versions/3.7.9/lib/python3.7/http/client.py", line 1277, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/root/.pyenv/versions/3.7.9/lib/python3.7/http/client.py", line 1323, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/root/.pyenv/versions/3.7.9/lib/python3.7/http/client.py", line 1272, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/root/.pyenv/versions/3.7.9/lib/python3.7/http/client.py", line 1032, in _send_output
self.send(msg)
File "/root/.pyenv/versions/3.7.9/lib/python3.7/http/client.py", line 972, in send
self.connect()
File "/root/.pyenv/versions/3.7.9/lib/python3.7/http/client.py", line 1447, in connect
server_hostname=server_hostname)
File "/root/.pyenv/versions/3.7.9/lib/python3.7/ssl.py", line 423, in wrap_socket
session=session
File "/root/.pyenv/versions/3.7.9/lib/python3.7/ssl.py", line 870, in _create
self.do_handshake()
File "/root/.pyenv/versions/3.7.9/lib/python3.7/ssl.py", line 1139, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: SSLV3_ALERT_ILLEGAL_PARAMETER] sslv3 alert illegal parameter (_ssl.c:1091)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/root/.pyenv/versions/3.7.9/lib/python3.7/site-packages/flask/app.py", line 2446, in wsgi_app
response = self.full_dispatch_request()
File "/root/.pyenv/versions/3.7.9/lib/python3.7/site-packages/flask/app.py", line 1951, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/root/.pyenv/versions/3.7.9/lib/python3.7/site-packages/flask/app.py", line 1820, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/root/.pyenv/versions/3.7.9/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/root/.pyenv/versions/3.7.9/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
rv = self.dispatch_request()
File "/root/.pyenv/versions/3.7.9/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request
return self.view_functionsrule.endpoint
File "main.py", line 31, in main
list_of_devices_axl = functions.axl_request()
File "/opt/cisco_cucm_AXL_phone_inventory_flask_sample/app/functions.py", line 79, in axl_request
'locationName': ''
File "/root/.pyenv/versions/3.7.9/lib/python3.7/site-packages/suds/client.py", line 554, in call
return client.invoke(args, kwargs)
File "/root/.pyenv/versions/3.7.9/lib/python3.7/site-packages/suds/client.py", line 617, in invoke
result = self.send(soapenv)
File "/root/.pyenv/versions/3.7.9/lib/python3.7/site-packages/suds/client.py", line 651, in send
reply = transport.send(request)
File "/root/.pyenv/versions/3.7.9/lib/python3.7/site-packages/suds/transport/http.py", line 178, in send
return HttpTransport.send(self, request)
File "/root/.pyenv/versions/3.7.9/lib/python3.7/site-packages/suds/transport/http.py", line 78, in send
fp = self.u2open(u2request)
File "/root/.pyenv/versions/3.7.9/lib/python3.7/site-packages/suds/transport/http.py", line 119, in u2open
return url.open(u2request, timeout=tm)
File "/root/.pyenv/versions/3.7.9/lib/python3.7/urllib/request.py", line 525, in open
response = self._open(req, data)
File "/root/.pyenv/versions/3.7.9/lib/python3.7/urllib/request.py", line 543, in _open
'_open', req)
File "/root/.pyenv/versions/3.7.9/lib/python3.7/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/root/.pyenv/versions/3.7.9/lib/python3.7/urllib/request.py", line 1393, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/root/.pyenv/versions/3.7.9/lib/python3.7/urllib/request.py", line 1352, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: SSLV3_ALERT_ILLEGAL_PARAMETER] sslv3 alert illegal parameter (_ssl.c:1091

Which python version should I use and how can I disable SSL checks?

Thanks.

Kay

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.