Not able to run external scripts inside of on_multiple_recocd_hook.sh

Hi Max,

We are invoking a external python script inside
Code:
on_multiple_recocd_hook.sh
, so that when Room Recording will finish it can call that external python script, but we are not able to achieve that, we are using
Code:
sudo
but still external script is not executing.


System: AWS Flashphoner Instance (Latest Build)
 

Max

Administrator
Staff member
Good day.
Please check if read and execute privilegies are set to the external script for all users:
Code:
sudo chmod +rx your_script.sh
If this does not help, please do one of the following:
- add flashphoner user to sudoers
or
- switch WCS to run in root mode by changing the following paramerer in /usr/local/FlashphonerWebCallServer/bin/setenv.sh file from
Code:
WCS_NON_ROOT=true
to
Code:
WCS_NON_ROOT=false
and restart WCS
 
Hi Max, this script we are running on_multiple_record_hook.sh, above mentioned both solutions are not working please suggest some alternative method.



Bash:
# This script copies a recorded stream to client/records

FILE_NAME=$1
WCS_HOME=/usr/local/FlashphonerWebCallServer


echo $FILE_NAME >> $WCS_HOME/logs/multi-record.log
echo "starting"

bash $WCS_HOME/tools/offline_mixer_tool.sh $FILE_NAME > $WCS_HOME/logs/multi-record.log 2>&1

if [ "$?" -ne "0" ]; then
        echo "running python script"
        echo $? >> $WCS_HOME/logs/multi-record.log
        echo "sudo python3 /home/ec2-user/combined_transcribe.py"
        sudo python3 /home/ec2-user/combined_transcribe.py
fi
 

Max

Administrator
Staff member
Please set the full path to python3 executable
If this does not help, please provide SSH access to the instance using this form, we will check.
 
Max,

When we are doing room recording every time its creating two identical files with slightly different name (one has _mixed has in it), any specific reason is there for the same ? can we disable it ?

Streamm-Conference-a3e7cc1e-mockLogin_multiRecorded_mixed.mp4
Streamm-Conference-a3e7cc1e-mockLogin_multiRecorded.mp4

also, as you said earlier we set full path of python3 executable still its not working, we are checking regarding SSH permission with our team, will respond with that shortly.
 

Max

Administrator
Staff member
When we are doing room recording every time its creating two identical files with slightly different name (one has _mixed has in it), any specific reason is there for the same ? can we disable it ?

Streamm-Conference-a3e7cc1e-mockLogin_multiRecorded_mixed.mp4
Streamm-Conference-a3e7cc1e-mockLogin_multiRecorded.mp4
This is normal behaviour:
Streamm-Conference-a3e7cc1e-mockLogin_multiRecorded.mp4 is the room streams recording file. They all are separate tracks in the file
Streamm-Conference-a3e7cc1e-mockLogin_multiRecorded_mixed.mp4 is the mixed recording file. Offline mixer utility parses room streams recording file and mixes all the streams to one, to play it in VLC, browser etc. The utility is called from on_multiple_record_hook.sh script
Code:
...
bash $WCS_HOME/tools/offline_mixer_tool.sh $FILE_NAME > $WCS_HOME/logs/multi-record.log 2>&1
...
Please read the details about multiple stream recording here.
 
The updated on_multiple_record_hook.sh is not allowing the python script to execute , we have followed all the options given by you.
please suggest some alternatives
Code:
# This script copies a recorded stream to client/records
FILE_NAME=$1
WCS_HOME=/usr/local/FlashphonerWebCallServer
LOG_FILE=$WCS_HOME/logs/multi-record.log
MIXER_TOOL=$WCS_HOME/tools/offline_mixer_tool.sh
# Set LOGGER_ENABLED to true to enable mixing debug logging
LOGGER_ENABLED=false

echo "[$(date '+%Y-%m-%d %H:%M:%S')] Start mixing multiple recording file $FILE_NAME" >> $LOG_FILE

if $LOGGER_ENABLED; then
    bash $MIXER_TOOL $FILE_NAME >> $LOG_FILE 2>&1
else
    bash $MIXER_TOOL $FILE_NAME > /dev/null 2>&1
fi

CODE=$?
if [ "$CODE" -ne "0" ]; then
    if [ "$CODE" -eq "64" ]; then
        echo "ERROR: File to mix not found" >> $LOG_FILE
    elif [ "$CODE" -eq "65" ]; then
        echo "ERROR: Offline mixer config not found" >> $LOG_FILE
    else
            echo "ERROR: Offline mixer tool error code: $CODE" >> $LOG_FILE
        fi
        exit $CODE
fi
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Multiple recording file $FILE_NAME is mixed successfully" >> $LOG_FILE


echo "sudo /usr/bin/python3 /home/ec2-user/combined_transcribe.py" >> $WCS_HOME/logs/custom-logs.log

sudo /usr/bin/python3 /home/ec2-user/combined_transcribe.py >> $WCS_HOME/logs/custom-logs.log

echo "-------------After python Execution------------" >> $WCS_HOME/logs/custom-logs.log

exit 0
 
Top