关于星号VOIP

问题描述 投票:0回答:1

嗨,伙计们!我们可以使用服务器星号停止dns服务器或启动dhcp服务吗? (当用户呼叫服务器时,他将收到部分服务器的响应“按按钮1停止dns服务,2重启服务器dns”。

asterisk
1个回答
0
投票

当然,您可以在拨号计划中使用系统命令来执行此操作。或使用AGI脚本。请注意,没有DNS服务器(新呼叫)时,星号的SIP协议可能无法工作。

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.
© www.soinside.com 2019 - 2024. All rights reserved.