Asterisk -rx runs CLI

Hi,
I’ve updated my asterisk to 14.4.1 and now I can’t run commands outside of CLI. It used to be : " asterisk -rx <command>" but now it runs the CLI and not the command.
I’ve also tried ‘-x’ alone but still nothing.

Thanks

I just built this and was not able to reproduce the problem. What version were you previously on, did you build it yourself to upgrade? What is the actual console output?

Used to be 11.18.0
I downloaded the new version from the website and then built it. but it had problem with overwriting, so i had to delete my old modules and libasteriskssl.so so it would reinstall them.
there is no console output. it doesn’t run the command, just runs clli. like this:
//I run this command:
#asterisk -rx "core show help"
Asterisk 14.4.1, Copyright © 1999 - 2016, Digium, Inc. and others.
Created by Mark Spencer markster@digium.com
Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘core show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type ‘core show license’ for details.

Connected to Asterisk 11.18.0 currently running on NLND (pid = 3148)
NLND*CLI>

but it used to be:
#asterisk -rx “core show help”
! Execute a shell command
acl show Show a named ACL or list all named ACLs
aoc set debug enable cli debugging of AOC messages
cc cancel Kill a CC transaction
cc report status Reports CC stats
cdr show status Display the CDR status
cel show status Display the CEL status
channel request hangup Request a hangup on a given channel
cli check permissions Try a permissions config for a user
cli reload permissions Reload CLI permissions config

You have 14.4.1 installed, but it is connecting to an 11.18.0 running Asterisk. You need to ensure that both match.

No that connecting to 11.18.0 was just because i had already ran the program while it was built under 11.18.0.
It would happen either way:

asterisk -rx “core show help”

Asterisk 14.4.1, Copyright © 1999 - 2016, Digium, Inc. and others.
Created by Mark Spencer markster@digium.com
Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘core show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type ‘core show license’ for details.

Connected to Asterisk 14.4.1 currently running on NLND (pid = 10392)
NLND*CLI>

You can see here it connects to 14.4.1 but still nothing!

I sadly don’t really have any additional suggestions, as this is not something I’ve seen from anyone else and I’m unfamiliar with that code. You can file an issue[1] but due to the fact that it’s only you being impacted it may take quite awhile for any further investigation.

[1] https://issues.asterisk.org/jira

1 Like

Looks like that the program doesn’t go inside the second “getopt” loop and so the “AST_OPT_FLAG_EXEC” option doesn’t get set. Ergo, ast_opt_exec is always false and so “ast_remotecontrol(xarg);” doesn’t get called.
I don’t know if i’m right or not, but that seems to be the problem.

Your big problem is that asterisk -rx is so extensively used that, if there were a design problem, it would have been reported long before now. That suggests there is a problem that is specific to what you are doing, not to -rx in general.

Yes i understand that.
Weird thing is that i downloaded and built 13.15.1 and that didn’t have this problem.