asterisk -> AGI (perl) -> sqlplus(oracle)

Home » Asterisk Users » asterisk -> AGI (perl) -> sqlplus(oracle)
Asterisk Users No Comments

On Fri, 6 Jan 2012, Dale Noll wrote:

> I found the following lines to be helpful.
>
> $ENV{TNS_ADMIN}=”/usr/lib/oracle/11.2/client/”;
> $ENV{ORACLE_HOME}=”/usr/lib/oracle/11.2/client/”;
> $ENV{LD_LIBRARY_PATH}=”/usr/lib/oracle/11.2/client/lib/”;

I think a ‘better practice’ would be to put the ‘stuff likely to change’
into the environment variables of the Asterisk process so they will
‘trickle down’ to sub-processes like AGIs.

This way, when you upgrade Oracle, you don’t have to track down and change
all affected AGIs.

Something like this snippet from my Asterisk start up script:

nice –adjustment=-20
env –ignore-environment
HOSTNAME=${HOSTNAME}
LD_LIBRARY_PATH=’/usr/lib/oracle/11.2/client/lib/’
ORACLE_HOME=’/usr/lib/oracle/11.2/client/’
PATH=${PATH}
TNS_ADMIN=’/usr/lib/oracle/11.2/client/’
$ASTERISK $START_OPTIONS

I like to ‘ignore’ the environment of the process executing the script
that starts Asterisk and add in only what is needed — I’m a ‘parts left
out don’t get broken’ kind of guy 🙂

Can you give this a try and report back?