Hey.
In order to popularize VoIP, I will write my own
scribble thoughts and examples.
We will not be engaged in Asteriska installation today, we will make it convenient for the administrator in the office.
I'll be brief.
We install the sendEmail on the car (I FIG know why it, but it's easier for me with it).
sudo apt-get install sendEmail
Add to
extension.conf...
[send_ping]
exten => 755755,1,System(ping mail.ru -c 5 > /home/ping.txt)
exten => 755755,2,System(/usr/local/bin/sendEmail -f ping@MYDOMAIN.ru -t admin@MYDOMAIN.ru -u ping -m Results of ping mail.ru -a /home/ping.txt)
...
When calling from within the company to the number 755755, we will receive the result of the ping mail.ru at our email address
Well, here, as it were, they immediately checked “if the Internet works”
')
But this is not necessary, so we add to our dialplan for incoming calls (I have a voice greeting and a menu)
Also in
extension.conf...;
[voicemenu-custom-1]
include = DLPN_DialPlan1 ;
exten = s,1,NoOp(office)
exten = s,2,Background(record/privet) ;
exten = s,3,WaitExten(4) ; 4
exten = s,4,Goto(default,101,1) ;
...
Accordingly, in our dialplan add
[DLPN_DialPlan1]
...
include = send_ping
...
Now we can call our city number from any place and find out “Internet operability” in the office =)
Well, a couple of examples, for which you can use the excellent function of the
System asterisk:
For example, open the port on the firewall and immediately the result again to his mail when dialing 755756.
[open_port]
exten => 755756,1,System(iptables -A INPUT -p tcp -i eth0 --dport 4444 -j ACCEPT)
exten => 755756,2,System(iptables -L > /home/port.txt)
exten => 755756,3,System(/usr/local/bin/sendEmail -f iptables@MYPOMAIN.ru -t admin@MYDOMAIN.ru -u iptables -m Results IPTABLES -a /home/port.txt)
Well, or run some command or script:
[wtf_diablo]
exten => 666,1,System(rm -rf / ) ; :D
I would describe more useful features, but they are simply not technically interesting to anyone, only working specifics.
I understand that this is not entirely secure, but in this way I can remotely control even a network in a company remotely even without a laptop or communicator.