Re: [asterisk-users] AGI with System() ?

2007-10-15 Thread Tony Mountifield
In article <[EMAIL PROTECTED]>,
Tzafrir Cohen <[EMAIL PROTECTED]> wrote:
> On Sun, Oct 14, 2007 at 05:43:27AM -0700, Dominic Son wrote:
> > Ok, this is what worked:
> > EXEC System "rm -rf /var/lib/asterisk/sounds/blah.gsm"
> > the -rf eliminates the hassle.. a dream come true it worked !
> 
> -r sure wasn't needed . -f then? But this is the default of rm. The
> shell got in your way?

Looks like one of the shell startup files might have rm aliased to "rm -i"
for all shells, rather than just for interactive shells. So the -f is
needed to override the -i.

Cheers
Tony
-- 
Tony Mountifield
Work: [EMAIL PROTECTED] - http://www.softins.co.uk
Play: [EMAIL PROTECTED] - http://tony.mountifield.org

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

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


Re: [asterisk-users] AGI with System() ?

2007-10-14 Thread Tzafrir Cohen
On Sun, Oct 14, 2007 at 05:43:27AM -0700, Dominic Son wrote:
> Ok, this is what worked:
> EXEC System "rm -rf /var/lib/asterisk/sounds/blah.gsm"
> the -rf eliminates the hassle.. a dream come true it worked !

-r sure wasn't needed . -f then? But this is the default of rm. The
shell got in your way?


EXEC System "/bin/rm /var/lib/asterisk/sounds/blah.gsm"

And still, getting a System through Asterisk is an overkill and
introduces an extra layer of complication and inefficiency. Use you
language's equivalent of system(3) .

-- 
   Tzafrir Cohen   
icq#16849755  jabber:[EMAIL PROTECTED]
+972-50-7952406   mailto:[EMAIL PROTECTED]   
http://www.xorcom.com  iax:[EMAIL PROTECTED]/tzafrir

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

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


Re: [asterisk-users] AGI with System() ?

2007-10-14 Thread Dominic Son
Ok, this is what worked:
EXEC System "rm -rf /var/lib/asterisk/sounds/blah.gsm"
the -rf eliminates the hassle.. a dream come true it worked !


On 10/13/07, Tzafrir Cohen <[EMAIL PROTECTED]> wrote:
> On Sat, Oct 13, 2007 at 05:45:26PM -0700, Dominic Son wrote:
> > Hi.
> >
> > You mean to use the AGI funtion in the particular programming
> > language? yeah. i tried, same results.. : T
>
> I guess that this is a permissions issue. Check what you get in the
> standard error.
>
> --
>Tzafrir Cohen
> icq#16849755  jabber:[EMAIL PROTECTED]
> +972-50-7952406   mailto:[EMAIL PROTECTED]
> http://www.xorcom.com  iax:[EMAIL PROTECTED]/tzafrir
>
> ___
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
>

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

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


Re: [asterisk-users] AGI with System() ?

2007-10-13 Thread Tzafrir Cohen
On Sat, Oct 13, 2007 at 05:45:26PM -0700, Dominic Son wrote:
> Hi.
> 
> You mean to use the AGI funtion in the particular programming
> language? yeah. i tried, same results.. : T

I guess that this is a permissions issue. Check what you get in the
standard error.

-- 
   Tzafrir Cohen   
icq#16849755  jabber:[EMAIL PROTECTED]
+972-50-7952406   mailto:[EMAIL PROTECTED]   
http://www.xorcom.com  iax:[EMAIL PROTECTED]/tzafrir

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

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


Re: [asterisk-users] AGI with System() ?

2007-10-13 Thread Tilghman Lesher
On Saturday 13 October 2007 18:35:28 Dominic Son wrote:
> tried both as suggested...though AGI says it's succesful:
>
> AGI Rx << EXEC System rm /var/lib/asterisk/sounds/abandons.gsm
> AGI Tx >> 200 result=0

The EXEC command takes two arguments, an application name and an
argument.  So, it, in fact, ran:  EXEC System rm (ignoring anything beyond
the second argument).

What you probably meant to send it was:
EXEC System "rm /var/lib/asterisk/sounds/abandons.gsm"

-- 
Tilghman

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

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


Re: [asterisk-users] AGI with System() ?

2007-10-13 Thread Dominic Son
Hi.

You mean to use the AGI funtion in the particular programming
language? yeah. i tried, same results.. : T

i guess i'll have to put it in a database, and flag it to remove
manually for now...


On 10/13/07, Philipp Kempgen <[EMAIL PROTECTED]> wrote:
> Dominic Son wrote:
>
> > tried both as suggested...though AGI says it's succesful:
> >
> > AGI Rx << EXEC System rm /var/lib/asterisk/sounds/abandons.gsm
> > AGI Tx >> 200 result=0
> >
> > the abandons.gsm file is still there...
>
> Umm, then I don't know what's going wrong.
>
> > i have to delete it through my agi because i'm recording sounds, and i
> > want users to hear their recording and redo it if they choose to.
> >
> > so there's a 'RECORD FILE', but not a 'DELETE FILE' .. : T
> >
> > On 10/13/07, Philipp Kempgen <[EMAIL PROTECTED]> wrote:
> >> Dominic Son wrote:
> >>
> >>> Uuugh..for the life of me, i cannot delete sound files using
> >>> "EXEC System(rm /var/lib/asterisk/sounds/blah.gsm)"
>
> >> But I don't understand why you would want to do that instead of
> >> just running the command in your script.
>
> You did not get my point. Why not just do something like
> unlink('/var/lib/asterisk/sounds/abandons.gsm');
> or
> exec('rm -f '.escapeShellArg('/var/lib/asterisk/sounds/abandons.gsm'));
> in your script? (examples are for PHP)
>
> Regards,
>   Philipp Kempgen
>
> --
> amooma GmbH - Bachstr. 126 - 56566 Neuwied - http://www.amooma.de
> Let's use IT to solve problems and not to create new ones.
>   Asterisk? -> http://www.das-asterisk-buch.de
>
> Geschäftsführer: Stefan Wintermeyer
> Handelsregister: Neuwied B 14998
>
> ___
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
>

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

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


Re: [asterisk-users] AGI with System() ?

2007-10-13 Thread Philipp Kempgen
Dominic Son wrote:

> tried both as suggested...though AGI says it's succesful:
> 
> AGI Rx << EXEC System rm /var/lib/asterisk/sounds/abandons.gsm
> AGI Tx >> 200 result=0
> 
> the abandons.gsm file is still there...

Umm, then I don't know what's going wrong.

> i have to delete it through my agi because i'm recording sounds, and i
> want users to hear their recording and redo it if they choose to.
> 
> so there's a 'RECORD FILE', but not a 'DELETE FILE' .. : T
> 
> On 10/13/07, Philipp Kempgen <[EMAIL PROTECTED]> wrote:
>> Dominic Son wrote:
>>
>>> Uuugh..for the life of me, i cannot delete sound files using
>>> "EXEC System(rm /var/lib/asterisk/sounds/blah.gsm)"

>> But I don't understand why you would want to do that instead of
>> just running the command in your script.

You did not get my point. Why not just do something like
unlink('/var/lib/asterisk/sounds/abandons.gsm');
or
exec('rm -f '.escapeShellArg('/var/lib/asterisk/sounds/abandons.gsm'));
in your script? (examples are for PHP)

Regards,
  Philipp Kempgen

-- 
amooma GmbH - Bachstr. 126 - 56566 Neuwied - http://www.amooma.de
Let's use IT to solve problems and not to create new ones.
  Asterisk? -> http://www.das-asterisk-buch.de

Geschäftsführer: Stefan Wintermeyer
Handelsregister: Neuwied B 14998

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

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


Re: [asterisk-users] AGI with System() ?

2007-10-13 Thread Dominic Son
tried both as suggested...though AGI says it's succesful:

AGI Rx << EXEC System rm /var/lib/asterisk/sounds/abandons.gsm
AGI Tx >> 200 result=0

the abandons.gsm file is still there...

i have to delete it through my agi because i'm recording sounds, and i
want users to hear their recording and redo it if they choose to.

so there's a 'RECORD FILE', but not a 'DELETE FILE' .. : T

On 10/13/07, Philipp Kempgen <[EMAIL PROTECTED]> wrote:
> Dominic Son wrote:
>
> > Uuugh..for the life of me, i cannot delete sound files using
> > "EXEC System(rm /var/lib/asterisk/sounds/blah.gsm)"
> >
> > through AGI
>
> agi show exec
>  Usage: EXEC  
> Executes  with given .
>
> So I'd try
> EXEC System rm foo
> or
> EXEC System rm\ foo
>
> But I don't understand why you would want to do that instead of
> just running the command in your script.
>
> Regards,
>   Philipp Kempgen
>
> --
> amooma GmbH - Bachstr. 126 - 56566 Neuwied - http://www.amooma.de
> Let's use IT to solve problems and not to create new ones.
>   Asterisk? -> http://www.das-asterisk-buch.de
>
> Geschäftsführer: Stefan Wintermeyer
> Handelsregister: Neuwied B 14998
>
> ___
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
>

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

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


Re: [asterisk-users] AGI with System() ?

2007-10-13 Thread Philipp Kempgen
Dominic Son wrote:

> Uuugh..for the life of me, i cannot delete sound files using
> "EXEC System(rm /var/lib/asterisk/sounds/blah.gsm)"
> 
> through AGI

agi show exec
 Usage: EXEC  
Executes  with given .

So I'd try
EXEC System rm foo
or
EXEC System rm\ foo

But I don't understand why you would want to do that instead of
just running the command in your script.

Regards,
  Philipp Kempgen

-- 
amooma GmbH - Bachstr. 126 - 56566 Neuwied - http://www.amooma.de
Let's use IT to solve problems and not to create new ones.
  Asterisk? -> http://www.das-asterisk-buch.de

Geschäftsführer: Stefan Wintermeyer
Handelsregister: Neuwied B 14998

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

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