Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jun 28, 2025

This PR implements a new voicemail status entity that provides real-time monitoring of voicemail messages for each configured extension, addressing the feature request for voicemail functionality using Asterisk's AMI interface.

Features Added

  • VoicemailStatusSensor: A new sensor entity that displays the number of new voicemail messages
  • Real-time Updates: Automatically updates when voicemails are received or retrieved via MWI events
  • Comprehensive Attributes: Provides detailed information including new messages, old messages, and total count
  • Dynamic Icons: Shows voicemail icon when messages exist, email-outline when empty
  • Error Handling: Robust error handling for malformed AMI responses

Technical Implementation

The implementation leverages Asterisk's built-in AMI capabilities:

  • Uses MailboxStatus AMI action to retrieve initial voicemail counts
  • Listens for MWI (Message Waiting Indicator) events for real-time updates
  • Follows existing sensor patterns in the integration
  • Uses mailbox format extension@default (e.g., "100@default")

Example Usage

Once configured, users will automatically get a voicemail status sensor for each extension:

Entity: sensor.100_voicemail_status
State: 2  # Number of new voicemails
Attributes:
  - new_messages: 2
  - old_messages: 5
  - total_messages: 7
  - mailbox: "100@default"

Testing

  • Added comprehensive test coverage for the new sensor
  • Enhanced mock AMI client to support MailboxStatus actions
  • All existing tests continue to pass
  • Code formatted and linted per project standards

Fixes #108.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Feature request - Entity for Voicemail Status Add Voicemail Status Entity for Real-time Voicemail Monitoring Jun 28, 2025
Copilot AI requested a review from TECH7Fox June 28, 2025 10:43
Copilot finished work on behalf of TECH7Fox June 28, 2025 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request - Entity for Voicemail Status

2 participants