The simplest way to control Asterisk from an external shell or
application is to issue the command asterisk with the
option -rx followed by the CLI command. Any CLI
command may be entered from the system shell in this fashion.
Say you wanted to see the dialplan for extension 23 in the context
[my-phones]; you would do this with
asterisk -rx "dialplan show 23@my-phones" entered in
the shell:
root@molokai:~>asterisk -rx "dialplan show 23@my-phones"
[ Context 'my-phones' created by 'pbx_config' ]
'23' => 1. Wait(1) [pbx_c
onfig]
2. Answer() [pbx_c
onfig]
3. Playback(hello-world) [pbx_c
onfig]
4. Wait(1) [pbx_c
onfig]
5. Hangup() [pbx_c
onfig]
-= 1 extension (5 priorities) in 1 context. =-
root@molokai:~>