Think I caused my system to have a brain freeze

Up to now I’ve successfully got my system to send two text messages when a particular customer rings to confirm their dental appointment.

I do this like this in extensions_custom.conf:-

[textstaff]
exten => s,1,TrySystem(. /home/asterisk/textstaff.sh > /dev/null 2>&1 &)
exten => s,n,Return

the file contents look like this

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin/:/usr/sbin/postfix
echo "VIP customer coming on Tuesday" | mail -s sender=VIP [email protected]

I just tried ‘extending’ this system by trying to do a company wide page to all phones at the same time by modifying textstaff.sh to this:

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin/:/usr/sbin/postfix
echo "VIP customer coming on Tuesday" | mail -s sender=VIP [email protected]
cp /var/spool/asterisk/tmp/vipannounce.call /var/spool/asterisk/tmp/vipannouncebk.call
mv /var/spool/asterisk/tmp/vipannouncebk.call /var/spool/asterisk/outgoing

The contents of vipannounce.call are

Channel: Local/[email protected]
Callerid: "VIP NOTIFICATION"
MaxRetries: 5
RetryTime: 300
WaitTime: 45
Context: vipnotification
Extension: s
Priority: 1

The contents of vipnotifications is

[vipnotifications ]
exten => s,1,Background(en/custom/vip_received)

I tested it, but the system froze and was very sluggish on SSH and it took me issuing a fwconsole reload for it to respond. The SECOND I issued the fwconsole reload, though, it woke up and started responding again.

Did I do this in a wrong headed way? It seems like I maybe was asking the system to be doing two things at the same time? Which I know it can do, but maybe not like this??

Cheers!

Its all conjecture. htop to see what is consuming system resources. maybe watch the logs as you execute to see if you can see anything.

I had a look at top (don’t know about htop!) and it wasn’t showing anything that weird. Just PHP and MySQL alternative for top spot but neither using up much CPU or memory.

So you’re saying my approach isn’t inherently wrong?

Tried it again and it worked mostly fine this time. I think that’s the first time I’ve ever seen FreePBX/Asterisk keel over!

The mostly is just that the first couple of seconds of the paging announcement is lost - I guess as the connection is established.

Is there not an infinite loop going on here? The context vipnotification generates an email and generates a call file, and the call file goes to vipnotification.

Thought all it does is play a sound file?

My mistake, ignore my ramblings.

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.