Asterisk : How to get cli output to dialplan

is there any way to let Dialplan read what is in red ?? I know I’ll get ${AMDSTATUS} from AMD function but I need those

or as a General question How to get Cli feeds to question

all that because I need to detect noise before answer waitfornoise does not work because it give answer to the line before the other side answer

custom Dialplan to detect noise before answer

Please use the plain text content of the log file not an image. (Generally it is better to use the logfile than a screen scrape, but terminal emulators generally allow you to scrape text from the screen.)

This log is not intended for machine processing and there is no simple way of accessing it from the dialplan. You could check the source code to see if any channel variables are set (or less dialplan friendly, AMI events are generated).

You could use the AMI command command in an AGI.

You could use 'asterisk -x ‘<some-console-command’ and capture it using the SHELL() function. Parsing the output in dialplan may lead to premature hair loss.

Personally, I’d do it in an AGI either using AMI or a subprocess and return items of interest as channel variables.

1 Like

The title is misleading. He means the contents of logs, not CLI output. (In most cases, real CLI output also isn’t suitable for machine processing, as its format isn’t guaranteed.)

You can capture the Asterisk console log by opening a connection to its Unix socket (this does require root access). The protocol isn’t very complicated, so I added a wrapper to it in Seaskirt, and you can see it in action in the console_listen example scripts here.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.