![如何在 shell 程序中使用星号](https://linux22.com/image/741146/%E5%A6%82%E4%BD%95%E5%9C%A8%20shell%20%E7%A8%8B%E5%BA%8F%E4%B8%AD%E4%BD%BF%E7%94%A8%E6%98%9F%E5%8F%B7.png)
我想在 shell Linux 程序中使用 Asterisk,大致如下:
asterisk -r && console dial 101
我该怎么做?谢谢。
答案1
您可以通过添加选项来运行星号命令-x
。
从手册页中:
-x command
Connect to a running Asterisk process and execute a command on a
command line, passing any output through to standard out and
then terminating when the command execution completes. Implies
-r when -R is not explicitly supplied.
因此你可以做类似的事情:
asterisk -rx "pjsip show endpoints"