RE: [Asterisk-Users] Executing external script

2004-02-19 Thread Marc Fargas
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: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] En nombre de Alessio Focardi
Enviado el: jueves, 19 de febrero de 2004 14:38
Para: [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
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
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users




___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] Executing external script

2004-02-19 Thread dfm
I am actually keeping track the calls coming to * and i have:

exten => s,1,system(echo "${DATETIME} - ${CALLERID} - ${CHANNEL}" >>
/var/log/asterisk/llamadas)

and it works fien for me, if this work i cannot see any reason why other
scripts don't.

Diego

- Original Message - 
From: "Alessio Focardi" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, February 19, 2004 2:37 PM
Subject: 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
> [EMAIL PROTECTED]
> http://lists.digium.com/mailman/listinfo/asterisk-users
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users

___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] Executing external script

2004-02-19 Thread Alessio Focardi
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
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] Executing external script

2004-02-18 Thread Iain Stevenson
... looks like a case for the "System" application or AGI.  Check out AGI 
on the VoIP wiki.

 Iain

--On Wednesday, February 18, 2004 12:41 pm +0100 Alessio Focardi 
<[EMAIL PROTECTED]> wrote:

Hello asterisk-users,

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 ...

Tnx !



--
Best regards,
 Alessio  mailto:[EMAIL PROTECTED]
___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users




___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


[Asterisk-Users] Executing external script

2004-02-18 Thread Alessio Focardi
Hello asterisk-users,

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 ...

Tnx !



-- 
Best regards,
 Alessio  mailto:[EMAIL PROTECTED]

___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users