AMI Event Monitor This script monitors events from an Asterisk Manager Interface (AMI) and logs specific events to a file.
Prerequisites
- Python 3 installed on your system
- Access to the Asterisk Manager Interface (AMI) with appropriate credentials
- Knowledge of the events you want to monitor and their corresponding event names Setup
- Clone or download the script to your local machine.
- Install any required Python dependencies (if applicable).
- Open the script and update the following variables with your configuration:
- AMI_HOST: The IP address of your Asterisk server.
- AMI_PORT: The port number for the AMI.
- AMI_USERNAME: Your AMI username.
- AMI_PASSWORD: Your AMI password.
- DID_TO_CALL: The destination DID you want to call.
- EVENT_TO_TRACK: The event you want to monitor (e.g., "Newstate" for call state changes).
- LOG_FILE: The path to the log file where event details will be stored.
- Save the changes to the script.
Usage
- Open a terminal or command prompt.
- Navigate to the directory containing the script.
- Run the script using the following command: Copy code python ami_event_monitor.py License This project is licensed under the MIT License - see the LICENSE file for details.