Asterisk As A Toolkit

Asterisk in the beginning started as a PBX but over its life has evolved into that of a communications toolkit. In fact if you ever run into me and ask me what Asterisk is I will always start with “Asterisk is a telecommunications toolkit”. Saying this is one thing but what does this actually mean in practice?

It means that Asterisk is providing the foundational elements to create other things. The building blocks as it were. To that end I urge you whenever you are looking for functionality and don’t find it to break it down into the constituent parts because the precise feature you may want does not exist but the building blocks are present to put it together and create it. A great example is one that I’ve seen come up a few times: injecting a sound file into a channel while it is doing other things.

Let’s break this down into what is actually needed:

  1. The ability to inject audio into a channel no matter what it is doing
  2. The ability to play back an audio file
  3. The ability to connect these two things together
  4. The ability to trigger this to happen

If you look at these individually then Asterisk has the required building blocks but not the feature:

  1. ChanSpy with whisper functionality
  2. Playback application
  3. Local channels
  4. Channel origination

This means that we can use the Originate functionality in Asterisk to dial a Local channel that calls Chanspy with whisper. Once answered we can connect it to Playback and have an audio file played.

This is a great example of using the building blocks to create new functionality that isn’t built in.

So if you ever find yourself not able to do something, then try this approach and see if you can create it!

About the Author

What can we help you find?