How to pass some parameters to shell script, invoked in CLI through application system(...)? I want to do some logging of incoming CID-s to file. Is there some other method to do this?
Not in CLI, Invoked in extensions.conf: exten => s,1,system(/usr/bin/logscript) ;and how to pass some parameters here? if I do somenhing like: exten => s,1,system(/usr/bin/logscript,${CALLERID},pstn) then I get error. ----- Original Message ----- From: "Pisac" <pisacc@gmail.com> To: "Asterisk Users Mailing List - Non-Commercial Discussion" <asterisk-users@lists.digium.com> Sent: ned 25. dec 2005 1:08 Subject: [Asterisk-Users] System(...) but how to pass parameters?> How to pass some parameters to shell script, invoked in CLI through > application system(...)? > > I want to do some logging of incoming CID-s to file. Is there someother> method to do this? > > _______________________________________________ > --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
trixter aka Bret McDanel
2005-Dec-24 17:31 UTC
[Asterisk-Users] System(...) but how to pass parameters?
On Sun, 2005-12-25 at 01:08 +0100, Pisac wrote:> How to pass some parameters to shell script, invoked in CLI through > application system(...)? > > I want to do some logging of incoming CID-s to file. Is there some other > method to do this?Other than through system? Or did you want information on using system to do this? You could do system(echo some parameters>>/some/logfile) if in ael odds are you will need to escape the / marks with \ (ie \/some \/logfile) If you want another way to log specific data and only that data to a file, you can call an AGI to do it, you can write a logging module for asterisk, there may be other ways as well but that is the first that comes to mind. -- Trixter http://www.0xdecafbad.com Bret McDanel UK +44 870 340 4605 Germany +49 801 777 555 3402 US +1 360 207 0479 or +1 516 687 5200 FreeWorldDialup: 635378 http://www.sacaug.org/ Sacramento Asterisk Users Group -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20051224/c6435a44/attachment.pgp
trixter aka Bret McDanel
2005-Dec-24 17:40 UTC
[Asterisk-Users] System(...) but how to pass parameters?
On Sun, 2005-12-25 at 01:22 +0100, Pisac wrote:> Not in CLI, Invoked in extensions.conf: > exten => s,1,system(/usr/bin/logscript) ;and how to pass some parameters > here? > > if I do somenhing like: > exten => s,1,system(/usr/bin/logscript,${CALLERID},pstn) > then I get error. >The singlke argument to system() is what you would type at the command line (ie your shell prompt). You get errors because you are using commas instead of spaces. try system(/usr/bin/logscript ${CALLERID} pstn) -- Trixter http://www.0xdecafbad.com Bret McDanel UK +44 870 340 4605 Germany +49 801 777 555 3402 US +1 360 207 0479 or +1 516 687 5200 FreeWorldDialup: 635378 http://www.sacaug.org/ Sacramento Asterisk Users Group -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20051224/6ab4cc19/attachment.pgp