If you have a business depending on asterisk you need to be sure that everything is running. You could use Nagios or Monit to check if asterisk is running, but is it also working? What about your AGI Server? Is it doing what it’s supposed to do?
The best way to find out if this works would be to call and see if the call is accepted and if you get something back from your AGI server and you can do this with automatically with Adhearsion!
What you will need is a wav file containing a DTMF sequence. You can create one with Adobe Audition for example (aka Cooledit before Adobe took over). The Trial version is enough to create the DTMF. Use a 300ms pause at least the other settings didn’t really work for me. Also don’t forget to set your Asterisk server to dtmfmod=inband.
I created a new adhearsion project and used the Simon game as start of and modified it to look like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
What this does is check if the called server sent the DTMF sequence 12345 and if not it would do something.
Also don’t forget to activate drb in your adhersion project, do this in startup.rb
1 2 3 4
Ok now all we need is the script that triggers the call. This could look like this:
1 2 3 4 5 6 7 8 9
So, this is it. I know this isn’t really a copy & paste howto, some things are missing but I don’t want to repeat things that can be read in the adhearsion documentation.
Oh, what I forgot to mention, I use a separate server which runs Asterisk to do the checks, the checks are NOT done form the same server I am checking, but I think this should be obvious.
If you need a VPS with this Setup, or need someone to verify your VoIP Servers, feel free to contact me!