#!/bin/bash
# Consume all variables sent by Asterisk
while read VAR && [ -n ${VAR} ] ; do : ; done
# Answer the call.
echo "ANSWER"
read RESPONSE
r=$(hostname -i)
sql=$(mysql -Dasterisk -uroot -p1234 -se "SELECT src FROM cdr limit 0,1")
space=$(df -h | awk '{print $5}' | awk 'NR==2')
# Say the letters of "Hello World"
#echo "SAY ALPHA "Hello World" """
#echo "EXEC "Dial" "SIP/callcentric/411" """
echo "EXEC "saydigits" "$1" """
echo "EXEC "read" "d,demo-thanks" """
echo "SET VARIABLE "x" "$r" "
echo "SET VARIABLE "y" "$sql" "
echo "SET VARIABLE "dk" "$space" "
read RESPONSE
exit 0
----------------------------------------
[channel]
exten => 500,1,AGI(/root/hello.sh,${EXTEN})
same=>n,saydigits(${d})
same=>n,sayalpha(${x})
same=>n,saydigits(${y})
same=>n,saynumber(${dk})
same=>n,sayalpha(%)
No hay comentarios:
Publicar un comentario