Linux command | in asterisk services

Good Evening there!

I am new to the word an asterisk, I just want to know how can I use the Linux Red hat command in the asterisk service.

Can you give us a typical red hat commend? I am not aware of such a thing. You should also describe more specifically where you want to use these commands. If it is within extensions.conf, the System application might do what you want (but I am not implying that this is a useful thing to do in general).

ok like the example we use this command ( cat /etc/passwd | head -n 2 ) these are used to manipulate and read text. in redhat … can use this in an asterisk to manipulate.

Not helpful, as I cannot translate this into something I might want to do with Asterisk, which isn’t a simple filter process. Please give a real world example.

I believe what you are looking for is Asterisk Gateway Interface (AGI), which you can then write a Bash script (or any other script/exec) to execute what you’re wanting to do.

First off, if this is actually an example, it should be:

head --lines=2 /etc/passwd

but since /etc/passwd is not ‘order dependent’ I suspect this isn’t a ‘real world’ example.

If you want to execute a shell command, either the system() application or the SHELL() function may be of use.

If you want to do something beyond a ‘one and done’ kind of thing (database access, business logic, parsing, interacting with Asterisk), an AGI may be more appropriate.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.