Automatic process to detect vehicles via Meraki Camera and trigger a phone call.
- Eda Akturk ([email protected])
- Gerardo Chaves ([email protected])
- Python 3.8
- Meraki MV Camera (2nd generation)
- CUCM
- IP Phone
- MongoDB
$ git clone (link)
Initialize a virtual environment
virtualenv venv
Activate the virtual env
Windows venv\Scripts\activate
Linux source venv/bin/activate
Now you have your virtual environment setup and ready
$ pip install -r requirements.txt
Meraki MV Camera Connection
- Obtain the Meraki API key and add it to
env_var.py
file. You can find details on how to obtain the Meraki API key here.
MERAKI_API_KEY= " "
- Add your Network ID and Camera Serial to the
mv_mqtt.py
file.
NETWORK_ID = " "
CAMERA_SERIAL = " "
MQTT Setup
-
In the Meraki dashboard, go to Cameras > [Camera Name] > Settings > Sense page.
-
Click to Add or Edit MQTT Brokers > New MQTT Broker and add you broker information. For testing/trial you can find public broker at here.
-
Add the MQTT Server settings to the
env_var.py
file.
MQTT_SERVER = " "
MQTT_PORT = " "
CUCM Connection
- Also in the
env_var.py
file, set the values for the following fields:
username
: the CUCM username that is authorized to send XML objects to the phone device
password
: the password corresponding to the CUCM username that is authorized to send XML objects to the phone device
base_url
: the URL on the phone device to send the command to dial where the code will send the XML object; this is typically "http://XX.XX.XX.XX/CGI/Execute" where XX.XX.XX.XX is the IP address of the IP Phone.
phone_number
: the phone number or extension number to dial when a vehicle is detected.
You can find more information on the Dial URI, which initiates a new call to a specified number here. For more information about Cisco Unified IP Phone Services App Development please refer to the document here.
(Optional) Database Connection
-
Download and Install MongoDB.
-
Create a collection and add the Database, Cluster and Collection credentials to env_var.py.
Database = " "
Cluster = " "
Collection = " "
Now you have completed the setup and are ready to run the script.
Run the python script
$ python main.py
When a car is detected the a MQTT broker will send a notification to the python program. Once the notification is received a phone call will be made. The number of vehicles will be saved to the database with the timestamps.
Provided under Cisco Sample Code License, for details see LICENSE
Our code of conduct is available here
See our contributing guidelines here
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.