send channel request hangup all command via dial plan extension

Looking to send the “channel request hangup all” command via a diaplan custom extension. So far I’ve tried

exten => 200,1,Answer()
exten => 200,2,System(asterisk -r channel request hangup all)
exten => 200,4,busy ()

and nothing happens

any help is appreciated

You are missing the -x option.

Also, you might need to quote the CLI command, as I’m not sure that Asterisk will reassemble the individual shell arguments into a complete command. You may need to escape the quotes.

As stupid as this may sound, where would the -x go?

Would it be replacing the -r, before after etc.

thanks

Edit: I got it working with both the quotations AND the -x after -r. Thank you!