marcin
July 12, 2021, 3:35pm
1
hello, with the help of an extension I manage to run a script that counts how many people call during the day and what is the hourly load. How can I get to the information about the outgoing connection and its duration (ending the connection) in the script. Here is my plugin:
[afyalog]
exten => s,1,Set(TIMEOUT(digit)=5)
exten => s,4,TrySystem(/var/spool/afya/log.py ${CALLERID(num)})
exten => s,5,GoToIfTime(9:00-16:00|mon-fri?app-announcement-3,s,1)
exten => s,6,Goto(app-announcement-4,s,1)
lgaetz
July 12, 2021, 5:16pm
2
Looks like you’re using FreePBX, in which case you will want to use a dialplan hook probably with a hangup handler as described in this thread:
Despite the frequency with which it arises here in the forum, there is not yet a good resource for learning to use dialplan hooks in FreePBX. This will probably end up in the wiki at some point, but until that happens, here are the broad strokes for...
Reading time: 7 mins 🕑
Likes: 27 ❤
marcin:
what is the hourly load
I collect this information with an external shell script:
COUNT=$(sudo /usr/sbin/asterisk -C /etc/asterisk/@PROJECT@/asterisk.conf -x "core show channels" | awk '/active call/ {print $1}')
gives me the count and then I insert it into a MySQL database with:
--execute="insert into channel_counts set count='${COUNT}', host='${HOSTNAME}';"\
This script runs on each Asterisk host every minute via cron and then my web page shows the counts per host.
system
Closed
August 11, 2021, 5:38pm
4
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.