System()

Führt einen Shell-Befehl aus.

System(Befehl)

Führt durch die C-Funktion system() einen Befehl auf der Shell sh aus.

Diese Anwendung ist der TrySystem()-Anwendung sehr ähnlich, abgesehen davon, dass sie -1 zurückliefert, falls sie den Systembefehl nicht ausführen kann, wohingegen die TrySystem()-Anwendung stets 0 zurückliefert.

Setzt die Channelvariable SYSTEMSTATUS auf SUCCESS (erfolgreich ausgeführt), FAILURE (konnte nicht ausgeführt werden) oder (undokumentiert) auf APPERROR (Befehl ausgeführt aber mit Exit-Code ungleich 0).

exten => s,1,System(echo '${DATETIME} - ${CALLERID} - ${CHANNEL}' >> /var/log/asterisk/anrufe)

Siehe auch. TrySystem()

[Anmerkung]Anmerkung

Als Alternative kann die Applikation Backticks() oder Funktion BACKTICKS() aus dem Modul app_backticks[66] verwenden, mit denen man auch die Ausgabe des Befehls erhält.

[Anmerkung]Anmerkung

Interner Hilfetext zu dieser Applikation in Asterisk 1.4: 

  -= Info about application 'System' =- 

[Synopsis]
Execute a system command

[Description]
  System(command): Executes a command  by  using  system(). If the command
fails, the console should report a fallthrough. 
Result of execution is returned in the SYSTEMSTATUS channel variable:
   FAILURE  Could not execute the specified command
   SUCCESS  Specified command successfully executed

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.
Note that this jump functionality has been deprecated and will only occur
if the global priority jumping option is enabled in extensions.conf.

Differenz zum internen Hilfetext in Asterisk 1.2: 

- keine - 

Version 1.2, November 2002

Neue Version verfügbar

Sie betrachten gerade die alte Version des Buches (Version 1.0). Wir empfehlen Ihnen für Asterisk 1.4 und 1.6 die neue Version des Buches.

Asterisk-Tag 2008

Lernen Sie Mark Spencer (den Erfinder von Asterisk) kennen! Viele Vorträge, Case-Studies und Workshops rund um das Thema VoIP. Asterisk-Tag.org

Das gedruckte Buch