[Asterisk-Users] Executing external script

Marc Fargas asterisk at telenieko.com
Thu Feb 19 07:10:23 MST 2004


Marc> I've seen its possible to use the System applications, but what 
Marc> about passing arguments to the command ?

A quick look at app_system.c shows that it just passes the string unaltered
to system(3).  So, running "man 3 system" will show exactly what system(3)
does:

   system()  executes  a command specified in string by calling
   /bin/sh -c string, and returns after the command has been completed.

As such, System(command arg1 arg2 etc) should do what you want.

-JimC

PS   No, I didn't know that before I looked at the src....

PPS  Except for what was in the system(3) manpage....

======== That has been copied from a previous thread called "Execute Command
in Shell" that's the reply I gave from James H. Cloos Jr. [cloos at
jhcloos.com] ================

NOTE that it seems that you need to specify full path to your 'sh'.

Marc.

-----Mensaje original-----
De: asterisk-users-admin at lists.digium.com
[mailto:asterisk-users-admin at lists.digium.com] En nombre de Alessio Focardi
Enviado el: jueves, 19 de febrero de 2004 14:38
Para: asterisk-users at lists.digium.com
CC: klitzing at pool.informatik.rwth-aachen.de
Asunto: Re: [Asterisk-Users] Executing external script

Tnx !

I tried System(), but documentation is very scarce ...

what can I insert in the () ?

a system command like System(sh myscript.sh) does not seem to work ....

Again tnx !


At 18.54 18/02/04, Philipp von Klitzing wrote:
>Hi!
>
> > just a simple question: I'm looking for a way to execute an external
> > script (php) on the server when an extension is dialed.
> >
> > I have looked around in google without results ...
>
>Use AGI, EAGI or System():
>
>http://www.voip-info.org/wiki-
>Asterisk+AGI?PHPSESSID=aa7ef3b3958673084a41274ea0c637aa
>
>http://www.voip-info.org/wiki-Asterisk+cmd+System
>
>Cheers, Philipp


Alessio Focardi



_______________________________________________
Asterisk-Users mailing list
Asterisk-Users at lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users







More information about the asterisk-users mailing list