On May 29, 2017, at 10:25 AM, Michael Keuter <li...@mksolutions.info> wrote:

> 
>> Am 29.05.2017 um 15:29 schrieb Lonnie Abelbeck <li...@lonnie.abelbeck.com>:
>> 
>> Michael,
>> 
>> The problem running 'asterisk -rx ...' is a user's permissions issue, not 
>> rbash per se.
>> 
>> pbx ~ # sudo -u staff asterisk -rx 'sip show peers'
>> Unable to connect to remote asterisk (does /var/run/asterisk/asterisk.ctl 
>> exist?)
>> 
>> This is probably a good thing :-)
>> 
>> Here is something I created for you to play with, a PHP script wrapper to 
>> make Asterisk command calls using AMI ...
>> (I recall Michael Keuter was interested in something like this as well)
>> 
>> asterisk-command
>> https://abelbeck.com/lonnie/share/asterisk-command.tar.gz
>> 
>> Place it into /mnt/kd/rbin/ and your rbash users will have access to it.
>> 
>> While I spent a little more time on this than I intended, it's not 
>> production ready until it is tested more.
>> 
>> It should be clear how to add/remove allowed commands, be sure to update the 
>> "usage" as well.
>> 
>> Lonnie
>> 
>> Example:
>> --
>> pbx [staff] $ asterisk-command 
>> Usage: asterisk-command command_string
>> 
>> Allowed command strings:
>> 'core show channels'   - Display information on channels
>> 'dahdi show status'    - Show all DAHDI cards status
>> 'sip show peers'       - List defined SIP peers
>> 'sip show registry'    - List SIP registration status
>> 'voicemail show users' - List defined voicemail boxes
>> --
> 
> Hi Lonnie,
> 
> interesting approach :-), I haven't tested it yet.
> 
> What would be interesting, apart from these commands, would be getting 
> "simple" the Asterisk console "dialplan output" for simple troubleshooting. 

Like 'dialplan show' ?  Possibly 'module show' ?

Give it a try ...

Lonnie


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Astlinux-users mailing list
Astlinux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/astlinux-users

Donations to support AstLinux are graciously accepted via PayPal to 
pay...@krisk.org.

Reply via email to