Asterisk - A Communications Powerhouse

is a great article that easily shows just how powerful asterisk is especially when paired with today’s LLMs.

Asterisk is Awesome :wink:

Thanks for sharing. Cool idea. Some thoughts to consider:

  1. Where are the AGI script sources mentioned in these lines ?
    same => n,AGI(gTTS.agi)
    same => n,AGI(voice-to-text.agi)
    same => n,AGI(llm.agi,1)
  2. Putting what looks like two dialplan lines onto one line is problematic – probably typo ?
    same => n,Set(VTT_FILE=/tmp/emh-${UNIQUEID}.wav) same => n,Record(${VTT_FILE},60,5,q)
  3. It is dangerous to use the SHELL() function with untrusted, unfiltered input. But it depends on what is being populated by the AGI… which isn’t shown :nerd_face:
    same => n,Set(LLM_RESPONSE=${SHELL(cat ${LLM_RESPONSE_FILE})})
  1. The AGI isn’t in the article and actually as was explained the AGI simply offloads the handling to another server so the actual AGI is simply some python to send a REST request and return the result.
  2. It is two lines, reads as two on my laptop, maybe wraps on a small screen? does anyone else see this?
  3. You’ll need to sanitise the LLM response, which it is and then we’re only 'cat’ing it into a variable. I wish asterisk had a way to read a file into a variable but alas not.

It is just an example to showcase how powerful asterisk really is, and no one should ever take medical advice from an LLM. That being said, I think it does the job;

One of the many joys, is when someone comes and asks ‘Can it do…’ and before they’ve finished I can say ‘YES’ because I know whatever it is, I can make it so. (and it does help working for a company with several racks full of H100s).

Maybe FILE() fits :slight_smile: ?

Nice!

Maybe FILE() fits :slight_smile: ?

FILE does indeed read a file, something like Set(LLM=${FILE(/tmp/somefile.txt)}) but for some reason there was an issue, and for the life of me I can’t think what it was - but we’re on V22 now so I’m going to dedicate some time next week testing FILE again, so thank you for reminding me :smiley:

(Was it something about concurrency with FILE? ah, I can’t remember - I’ll play next week)

+1 (on a desk top)

Also, either voice-to-text.agi has side effect or ${VTT_FILE} is deleted until the system reboots.

Indeed voice-to-text removes the source audio file if transcription is successful, which is important because there’s no built in way to drop a file from the dial plan (without system or shell) but of course in AGI it’s easy.

Thanks for confirming the layout :slight_smile: appreciated.

Just to be clear, I see what PenguinPBX sees regarding the two line.