TrySystem()
TrySystem(Befehl
)
System()
einen Befehl auf der Shell
sh
aus, liefert aber stets 0 zurück, wohingegen
System()
bei einem Fehler -1 zurückgibt.SYSTEMSTATUS
auf
SUCCESS
(erfolgreich ausgeführt), FAILURE
(konnte
nicht ausgeführt werden) oder APPERROR
(Befehl ausgeführt, aber
mit Exit-Code ungleich 0).exten => 123,1,TrySystem(echo 'Hallo Welt' > /tmp/hallo.txt)
————————| 1.2 |————————| 1.4 |————————| 1.6 |————————
-= Info about application 'TrySystem' =-
[Synopsis]
Try executing a system command
[Description]
TrySystem(command): Executes a command by using system().
on any situation.
Result of execution is returned in the SYSTEMSTATUS channel variable:
FAILURE Could not execute the specified command
SUCCESS Specified command successfully executed
APPERROR Specified command successfully executed, but returned error code
Old behaviour:
If the command itself executes but is in error, and if
there exists a priority n + 101, where 'n' is the priority of the current
instance, then the channel will be setup to continue at that
priority level. Otherwise, System will terminate.
--- in Asterisk 1.4
+++ in Asterisk 1.6
@@ -10,9 +10,3 @@
FAILURE Could not execute the specified command
SUCCESS Specified command successfully executed
APPERROR Specified command successfully executed, but returned error code
-
- Old behaviour:
- If the command itself executes but is in error, and if
- there exists a priority n + 101, where 'n' is the priority of the current
- instance, then the channel will be setup to continue at that
- priority level. Otherwise, System will terminate.