Hi Folks,
I’m pretty much a noob at Asterisk but have come a long way.
I’m running a bash script form the dialplan successfully but I’m seeing no real feedback from it in my Asterisk console.
Extensions.Conf
; MySQL Test Extension
exten => 800,1,Answer()
same => n,Set(CLI=${CALLERID(num)})
same => n,Verbose(CLI is ${CLI})
same => n,Set(CODE=${ODBC_TEST(${CLI})})
same => n,Verbose(Returned code is ${CODE})
same => n,SayNumber(${CODE})
[color=#FF0040]same => n,AGI(${scripts}gsmtest.sh)[/color]
same => n,Hangup()
So above is where I’m calling the script, and below is the script itself (very simple).
#!/bin/bash
if echo “” | nc 192.168.16.230 63333; then
echo "Server Alive!!"
else
echo "Oops Server Dead"
fi
What I’m trying to do is see if the machine at the IP address is up and get that feedback in the Asterisk console much like the “Verbose” application. The only feedback I see is :-
-- Launched AGI Script /home/scripts/gsmtest.sh
-- <SIP/1000-00000001>AGI Script /home/scripts/gsmtest.sh completed, returning 0
I’d like to see either “server alive” or “Oops server dead” message in Asterisk console.
Can’t find anything on the tinterwebz so I’m leaning towards myself missing something very important like it can’t be done?!
I’m just doing this as part of my learning so I’d be very grateful for some advice on what I’m missing and which direction I should be going…
Thanks in advance