Tag Archives: asterisk monit realtime

Asterisk + Realtime Monit Inboud & outbound call


#!/bin/bash

mustafa@intelix.com

color_1=’\e[1;32m’ #blue
color_2=’\e[0;32m’ #green
color_3=’\e[0;31m’ #red
color_4=’\e[0;35m’ #Purple
color_5=’\e[1;33m’ #Brown
color_6=’\e[1;37m’ #White
NC=’\e[0m’ # No Color

while true
do
sleep 3
LOG_FILE=”/tmp/call_log.log”
asterisk -rx “core show channels” | egrep -i ‘SIP/2000-|SIP/3000-‘ | awk ‘{print $2}’ | cut -f1 -d ‘@’ > ${LOG_FILE}
#LOG_FILE=”/home/file/test”
TRUNK_91=`egrep –color=auto -c 991[1-9] ${LOG_FILE}`
TRUNK_92=`egrep -c 992[1-9] ${LOG_FILE}`
TRUNK_93=`egrep -c 993[1-9] ${LOG_FILE}`
TRUNK_94=`egrep -c 994[1-9] ${LOG_FILE}`
TRUNK_95=`egrep -c 995[1-9] ${LOG_FILE}`
TRUNK_96=`egrep -c 996[1-9] ${LOG_FILE}`
CALL_INB=`egrep -c 915000 ${LOG_FILE}`
echo -e “*** CALL OUBOUND ***”
echo -e “${color_1}PSTN_1 = ${TRUNK_91}${NC}”
echo -e “${color_2}PSTN_2 = ${TRUNK_92}${NC}”
echo -e “${color_3}ISAT_1 = ${TRUNK_93}${NC}”
echo -e “${color_4}ISAT_2 = ${TRUNK_94}${NC}”
echo -e “${color_5}TSEL_1 = ${TRUNK_95}${NC}”
echo -e “${color_6}TSEL_2 = ${TRUNK_96}${NC}”
echo -e “”

echo -e “*** CALL INBOUND ***”
echo -e “${color_6}CALL_INB = ${CALL_INB}${NC}”
echo -e “”
done

shisdew

Listens until think alike

moses.spaceku@yahoo.com / voip ipbx

Hosted PBX, IP-PBX SOHO/ CALL CENTER, VOICE GATEWAY, VOICE CARD, COST EFECTIVE SOLUTIONS (LCR), GSM/CDMA GATEWAY

%d bloggers like this: