AEAP for external python text-to-speech


I am currently working on a project aimed at sending a report following a voicemail by email.

At first I wanted to simply send the audio file by email, with extended informations in the body, but to my knowledge it is not possible to access information from CDR for example in the body of email.

I then try to use AEAP, to create an external conversion application in Python, to directly convert the result of a voicemail into text.

According this documentation I send response “setup” :

My AEAP configuration :

[test-speech-to-text] type=client codecs=alaw,ulaw protocol=speech_to_text url=ws://

My dialplan :

exten => _[a-z].,1,Verbose(TEST AEAP)
same => n,Answer()
same => n,SpeechCreate(test-speech-to-text)
same => n,SpeechStart()
same => n,SpeechBackground(hello-world)
same => n,Verbose(0,${SPEECH_TEXT(0)})
same => n,SpeechDestroy()
same => n,Hangup()

data received by the websocket server :

On Asterisk :

Does this remind you of anything?

The logging would make it seem as though your implementation is immediately disconnecting the websocket after sending a response.

As for your original goal, voicemail transcription afterwards is really best done outside of Asterisk. AEAP is streaming of media in realtime for an active channel. You stated some information was not available in the body of the email - so I would suggest stating what information you wanted, what difficulties you ran into there.

Thank’s, I will verify my server and add more informations after.

The initial idea was to pass the report email through our complex distribution system, so that our agents could call callers back following an unanswered incoming call.
I wanted to add information such as customer ID, for easier identification in our distribution system. However, it is not possible (or I have not found), how to create a specific mail template for each voicemail. And according to this documentation

I cannot fetch variables, such as those from the CDR, to inject them into the body of the email. I would therefore be forced to do post-processing outside of asterisk and freepbx, to recover the voicemail and format the email correctly.

I can’t speak for FreePBX, but I can say that is exactly what others are doing to accomplish this. Doing their own processing outside of Asterisk for transcription, email formatting, and sending.

Here’s some older code that @billsimon has: GitHub - simontelephonics/transcribe-with-azure

1 Like

Great thank’s, it is a really interesting example. I will look on this.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.