asterisk -rx "dialplan show" | cut -d' ' -f3 | grep '^..' | grep -o '[0-9]*' | uniq
EXPLANATION:
asterisk -rx "dialplan show" --> Asterisk CLI command that shows the loaded dialplan
| cut -d' ' -f3 --> shows only the third field of each line (with whitespace as the delimiter)
| grep '^..' --> removes empty lines
| grep -o '[0-9]*' --> filters out anything non-numeric
| uniq --> removes duplicates
Nessun commento:
Posta un commento