Smart Voicemail: Modernising Asterisk with AI

The Curious Codex

             9 Votes  
100% Human Generated
2025-04-10 Published, 2025-04-10 Updated
1007 Words, 6  Minute Read

The Author
GEN UK Blog

Andrew (Voice)

Andrew has been with the firm since 2018.

 

Comedian Mail

Initially released in 1999 as a voicemail addon for Asterisk, Comedian Mail has become the standard package for voicemail on any Asterisk based system including FreePBX and PBXact.

With a fairly generic dial-plan, Comedian Mail allows users to call into the voicemail system, set messages, read messages, delete messages and so on as well as some quite advanced features (if enabled).

Screenshot 2025-04-09 at 19.26.41

Somewhere around 2013, Voicemail to Email became a popular feature allowing voicemail recordings to be sent via email to the mailbox owner, and even deleted saving the job of having to call into the system to listen and delete. We even wrote some systems a little after that time providing visibility of number of new voicemails, and a hot key to listen on the newer generation of android based SIP endpoints.

Since its inception, comedian mail has done exactly what it says on the box, provide a reliable and flexible voicemail system for Asterisk tenants, but can we make it better?

GEN Enhanced Voicemail Notifications

Yes we can. One of the many features exposed in voicemail.conf is the external notify option, which as the name would suggest launches an external program when a new voicemail is received.

Mailbox Structure

Voicemails are stored in

/var/spool/asterisk/voicemail/default/--EXTENSION--/INBOX

Every message has two components, a voice recording as a .wav audio file, and a text file containing information about the voicemail, such as from what number, when it was left, and other useful context information.

External Notify

voicemailflow

When our program is called, it is passed two important parameters, the extension for which the voicemail was left, and the message number. Using this information we can extrapolate the path to the specific voicemail inbox, and then locate the message using the message number.

We then pull information from the .txt file, and convert the .wav file to an MP3 file because they are smaller and more convenient.

Next we leverage GEN's Arkane API "Transcribe" to take the mp3 file and convert it to text, transcribing the contents. The models we use achieve a 1.5 to 3% WER (Word Error Rate) which is more than acceptable commercially and means that most voicemails will be transcribed perfectly. Poor language skills and excessive background noice can affect the performance of transcription.

Then we pass this text transcription into GEN's Arkane API "LLM" with a custom prompt to have a quick summary generated from that transcription. We generally use smaller models for this task since they produce more terse and accurate results. The prompt is configurable allowing special use cases and custom summarisation. Alternatively, this feature can be disabled.

The Transcription, the Summary and all the voicemail meta data like, from, time, duration, etc is built into a .json payload for GEN's Arkane "Generate" API which takes a pre-loaded template and generates an email with all this information. The Generate API saves us all the work of building a html email on the phone system, we have our pre-built template and we just pass variable substitutions into the API to generate the html email.

Since all the processing is offloaded to GEN's Arkane API, there is almost no loading on the switch.

Security & Privacy

GEN's Large Language Models are hosted in our own Datacentres in the UK, and there is no record of the prompts, embedding or responses stored after the request is complete. This ensures privacy and protection of sensitive data. Communications to and from the API's is encrypted. The email generated is sent over the internet, but the conversation is encrypted in transit and protected with DKIM. The Generate API does support GnuPG encryption at source if that is required.

Configuration

The system operates independently of FreePBX and Asterisk, requiring only one configuration file, which simply lists the extensions that we're going to include in the system (since existing mailbox notification and functionality is unaffected), the name of the mailbox, and the email address to send the voicemail.

The Result

Screenshot 2025-04-09 at 19.43.28

A fairly modern, optionally branded HTML Email containing a full and accurate transcription, Summary and metadata. The Summary is optional, but I find reading the summary is quicker especially for those waffley voicemails.

The MP3 file is attached anyway, but in the months I've been using this I don't think I've ever had to 'listen' to an attachment.

Limitations

The system is English only currently, because the transcription service currently supports english first, but other languages are in testing.

The model that provides the summary, expects the voicemail to actually have a purpose or intent, for voicemails that don't it can produce no output or simply not that there's no summarisation possible.

Future Development

On the roadmap, is better understanding intent and we will be able to extract key information such as the person's name, their company, and their callback number (if different) from the transcription and bring that to the metadata. We already have this in test internally but it will be a little while before its sufficiently stable for deployment.

Conclusion

Voicemail is still an important part of telephony, and having nice voicemail emails really brings a new level of convenience to the platform.

We have successfully implemented this solution for individual mailboxes, but also for queue and group mailboxes. Consider an early adopter that has a dial-in report-a-problem for their estate agency, customers call in to report issues with their property, and our system now takes the transcription and instead of emailing it, we create a ticket with it on the agencies system. Another client is now using this for their customer service out-of-hours queue to handle calls the following morning.

Like everything at GEN, this isn't a one stop package that you can either take or not, it's a collaborative effort and we can tailor the solution to your specific requirements. The email template is fully customisable, as is how the data is processed and handled.

If you're interested in this system, contact us today to discuss your needs and for pricing, which post installation is based on the cost of the API calls only.


             9 Votes  
100% Human Generated

Comments (1)

Maria Ventas ยท 2025-04-10 12:19 UTC
Oooh. I want that. Email sent.

×

--- This content is not legal or financial advice & Solely the opinions of the author ---


Index v1.038 Standard v1.114 Module v1.063   Copyright © 2025 GEN Partnership. All Rights Reserved, Content Policy, E&OE.   ^sales^  0115 933 9000  Privacy Notice   431 Current Users, 99 Hits