JCT - Linux application unable to start automatically
Symptom
Sometimes when trying to start a Dialogic®-based application automatically in Linux, it can fail to initialize properly, with erors occurring in several Dialogic API functions. The same application works, however, if it is started manually after bootup is complete.
Reason for the issue
The issue occurs when the application is started before Dialogic services have been completely initialized. This condition can occur even when the application is started after the Dialogic services in the startup script because the Dialogic services are still not completely initialized when the application tries to start. If this condition does occur the application will see errors in the Dialogic API calls that it makes.
Fix / Solution
The following code can be placed in rc.local prior to calling the application.  This is part of the ct_intel script that checks environment variables and tries to set them if necessary.
OURVARS=/etc/profile.d/ct_intel.sh
if [ -x ${OURVARS} ]
then
# if INTEL_DIALOGIC_DIR is not set, then get
# the Dialogic environment variables
[ -z "${INTEL_DIALOGIC_DIR}" ] && . ${OURVARS}
else
echo "$0: FATAL ERROR: Unable to find ${OURVARS}."
echo "$0: FATAL ERROR: Execution aborted due to invalid installation."
echo "$0: FATAL ERROR: Please reinstall the software by running install.sh."
exit $NOTINST_ERROR
fi |
Â
Here is an explanation of this code:
OURVARS=/etc/profile.d/ct_intel.sh // defining a variableÂ
if [ -x ${OURVARS} ] // checking if /etc/profile.d/ct_intel.sh exists, which it should if the Dialogic® System Release Software is installedÂ
[ -z "${INTEL_DIALOGIC_DIR}" ] && . ${OURVARS}Â // -z analyzes this AND statement one piece at a time. First it checks for INTEL_DIALOGIC_DIR. If this is blank (or 0), it will know that this line is going to analyze to false, and will stop right there and fall through outside the if statement. If INTEL_DIALOGIC_DIR is defined, it will execute ${OURVARS} (because of the '.'). This executes the script /etc/profile.d/ct_intel.sh.
Product List
All Dialogic JCT Media Boards