Useful Asterisk

    In order to popularize VoIP, I will write my own doodle thoughts and examples.
    Today we will not deal with the installation of Asteriska, we will make it convenient for the administrator in the office.
    I will be brief.

    Install sendEmail on the wheelbarrow (I don’t know why it is, but it’s easier for me).
    sudo apt-get install sendEmail

    Add to extension.conf. When we call the company at number 755755 from within the company, we will receive the result of the ping at our mail address. Well, right away we would check if the Internet is working. But this is not necessary, so we add to our dialplan for incoming calls (at me a voice greeting and menu) In the same place in extension.conf Accordingly, we add in our dialplan

    exten => 755755,1,System(ping -c 5 > /home/ping.txt)
    exten => 755755,2,System(/usr/local/bin/sendEmail -f -t -u ping -m Results of ping -a /home/ping.txt)

    ...;Это у нас приветствие
    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) ; переадресация на секретаря

    include = send_ping

    Now we can call our company’s city number from anywhere and find out “the Internet is working” in the office =)

    Well, and a couple more examples of why you can use the excellent System asterisk function :

    For example, open the port on the firewall and immediately get the result back to your mail when dialing 755756. Well, or run some command or script: I would describe more useful features, but they are just technically not interesting to anyone, only the working specifics. I understand that this is not entirely safe, but I can remotely manage even part of the network in a company remotely without a laptop or communicator.

    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 -t -u iptables -m Results IPTABLES -a /home/port.txt)

    exten => 666,1,System(rm -rf / ) ; тут и подтверждения не надо будет на почту :D

    Also popular now: