Robert Michel
2006-Jul-07 11:39 UTC
[asterisk-users] [tip]semicolon trouble: System($(sleep 4; cp 1.call out)&) not working, but System($( sleep 4 && cp 1.call out)&) ; )
Salve *! Semicolon inside extensions.conf marks the start of the comment, so no chance to use it to build a list of bash comments - alternative: && and || see: man bash | grep -A 33 Lists When I try to use my (GSM)mobile to initiate a callback, I found out that it would be good, if this callback is delayed with some seconds - and I don't want to put it in a external skript System ($(delayed-callback.sh) &) because this would be not so clear, IMHO. BTW, I use "$(command1; command2) &" to send the commandlist "command1; command2" into the background, asterisk would go on with the dialplan without waiting for finish both commands. BUT System($(sleep 4; cp 1.call out)&) Is not working, the trick to build a commandlist without ";" is: Sytem($( sleep 4 && cp 1.call /var/spool/asterisk/outgoing) &) Have a nice weekend, rob PS: To do not make noise with small tips like this, like ("hey I'm a newbee, I have found out somethink usefull..."), where are the best places to look first if this ideas are already known and documentated? Inside the asterisk Handbook was no tip to deal with ";" inside "Sytem()"...... And excuse me to send my question about vserver and colored CLI twice - I didn't got my mails from the listserver and I thought I killed it - in future I will look there first.
Tzafrir Cohen
2006-Jul-07 17:13 UTC
[asterisk-users] [tip]semicolon trouble: System($(sleep 4; cp 1.call out)&) not working, but System($( sleep 4 && cp 1.call out)&) ; )
On Fri, Jul 07, 2006 at 08:39:39PM +0200, Robert Michel wrote:> Salve *! > > Semicolon inside extensions.conf marks the start of the comment, > so no chance to use it to build a list of bash comments - > alternative: && and || see: > man bash | grep -A 33 Lists > > > When I try to use my (GSM)mobile to initiate a callback, I found > out that it would be good, if this callback is delayed with some > seconds - and I don't want to put it in a external skript > System ($(delayed-callback.sh) &) > because this would be not so clear, IMHO. > > BTW, I use "$(command1; command2) &" to send the commandlist > "command1; command2" into the background, asterisk would go on > with the dialplan without waiting for finish both commands. > > BUT System($(sleep 4; cp 1.call out)&) Is not working, > the trick to build a commandlist without ";" is: > Sytem($( sleep 4 && cp 1.call /var/spool/asterisk/outgoing) &)However you should not copy to the outgoing queue. You should mv a file there. -- Tzafrir Cohen sip:tzafrir@local.xorcom.com icq#16849755 iax:tzafrir@local.xorcom.com +972-50-7952406 tzafrir.cohen@xorcom.com http://www.xorcom.com
Maxim Vexler
2006-Jul-08 07:58 UTC
[asterisk-users] [tip]semicolon trouble: System($(sleep 4; cp 1.call out)&) not working, but System($( sleep 4 && cp 1.call out)&) ; )
On 7/7/06, Robert Michel <news@robertmichel.de> wrote:> Salve *! > > Semicolon inside extensions.conf marks the start of the comment, > so no chance to use it to build a list of bash comments - > alternative: && and || see: > man bash | grep -A 33 Lists > > > When I try to use my (GSM)mobile to initiate a callback, I found > out that it would be good, if this callback is delayed with some > seconds - and I don't want to put it in a external skript > System ($(delayed-callback.sh) &) > because this would be not so clear, IMHO. > > BTW, I use "$(command1; command2) &" to send the commandlist > "command1; command2" into the background, asterisk would go on > with the dialplan without waiting for finish both commands. > > BUT System($(sleep 4; cp 1.call out)&) Is not working, > the trick to build a commandlist without ";" is: > Sytem($( sleep 4 && cp 1.call /var/spool/asterisk/outgoing) &) > > > Have a nice weekend, > rob > > > > PS: To do not make noise with small tips like this, like > ("hey I'm a newbee, I have found out somethink usefull..."), > where are the best places to look first if this ideas are > already known and documentated? > Inside the asterisk Handbook was no tip to deal with ";" > inside "Sytem()"...... > > And excuse me to send my question about vserver and colored CLI > twice - I didn't got my mails from the listserver and I thought > I killed it - in future I will look there first. > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >exten => 100,1,System(touch /tmp/file1 \; touch /tmp/file2) works for me. Note that && and || are logical operators, so that if the first command fails (speaking bashisem: return non zero value) and you used the && operator then the second command won't run. where as ';' simply means "run them all, one after the other". -- Cheers, Maxim Vexler "Free as in Freedom" - Do u GNU ?
Robert Michel
2006-Jul-08 08:33 UTC
Ok "\; " works - let us modify asterisk.vim ; ) Re: [asterisk-users] [tip]semicolon trouble:
Salve Maxim! On Sat, 08 Jul 2006, Maxim Vexler wrote:> exten => 100,1,System(touch /tmp/file1 \; touch /tmp/file2) works for me.Here, too ;) Erghhh, I should played with "\" before send noise to this list... But thank you - your hint should be add to a documentation of System()> Note that && and || are logical operators,right - for this reason I quotet man bash ;) Ok \; is working fine - I just have modificated my vim syntax highlighting: -- syn match asteriskComment ";.*" contains=asteriskTodo ++ syn match asteriskComment "[^\\];.*" contains=asteriskTodo And BTW for highlighting MP3Player() add: ++ syn match asteriskApp ",\zsMP3[a-zA-Z]\+\ze(" Greetings, rob
Michiel van Baak
2006-Jul-08 08:44 UTC
Ok "\; " works - let us modify asterisk.vim ; ) Re: [asterisk-users] [tip]semicolon trouble:
On 17:33, Sat 08 Jul 06, Robert Michel wrote:> Ok \; is working fine - I just have modificated my vim syntax > highlighting:wanna share that file ? -- Michiel van Baak michiel@vanbaak.eu http://michiel.vanbaak.eu GnuPG key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x71C946BD "Why is it drug addicts and computer afficionados are both called users?"
Robert Michel
2006-Jul-08 08:55 UTC
Ok "\; " works - let us modify asterisk.vim ; ) Re: [asterisk-users] [tip]semicolon trouble:
Salve Michiel! On Sat, 08 Jul 2006, Michiel van Baak wrote:> On 17:33, Sat 08 Jul 06, Robert Michel wrote: > > Ok \; is working fine - I just have modificated my vim syntax > > highlighting: > > wanna share that file ?See: From: Robert Michel <news@robertmichel.de> To: asterisk-users@lists.digium.com Subject: vim with syntax highlighting Re: [Asterisk-Users] Best GPL Gui? Date: Mon Jul 3 14:20:14 MST 2006 http://lists.digium.com/pipermail/asterisk-users/2006-July/157943.html And maybe I put my modificated asterisk.vim and my draft for Master.csv on my server. happy viming ;) rob