Об Asterisk VOIP - PullRequest
       9

Об Asterisk VOIP

0 голосов
/ 24 февраля 2020

Привет, ребята! Можем ли мы остановить сервер DNS или запустить службу DHCP, используя звездочку сервера? (Когда пользователь вызывает сервер, он получит ответ от части сервера «нажмите кнопку 1, чтобы остановить службу DNS, 2, чтобы перезапустить сервер DNS».

1 Ответ

0 голосов
/ 24 февраля 2020

Конечно, вы можете сделать это, используя системную команду в диалплане. Или используя скрипт AGI. Обратите внимание, что SIP-протокол Asterisk может не работать, пока нет DNS-сервера (новые вызовы).

System()  

Execute a system (Linux shell) command Description

System(command) – System command alone System(command arg1 arg2 etc) – Pass in some arguments System(command|args) – Use the standard asterisk syntax to pass in arguments Technical Info

Executes a command by using system(). System() passes the string unaltered to system(3). Running “man 3 system” will show exactly what system(3) does:

system() executes a command specified in string by calling /bin/sh -c string, and returns after the command has been completed.

Therefore System(command arg1 arg2 etc) can be used to pass along arguments. Return codes

System(command): Executes a command by using system(). If the command fails, the console should report a fallthrough. If you need to return a specific value (string) to the dialplan then use either AGI or Asterisk func shell as introduced in Asterisk 1.6.0.

Result of execution is returned in the SYSTEMSTATUS channel variable:

FAILURE Could not execute the specified command SUCCESS Specified command successfully executed APPERROR Triggered for example when you try to delete a file but the file was not there. NOTE – not documented, but can also return APPERROR NOTE – I don’t seem to be able to create a situation when FAILURE will be returned.
...