vicidial: no one is in your session after power outage/sudden power off
i recently had a power outage and the ups on my server malfunctioned, and then i was having a problem with people logging into the dialer and immediately being kicked out to the “no one is in your session” blue screen. this issue was persistent through reboots and running AST_reset_mysql_vars.pl.
i drilled down and found that the live_channels and live_sip_channels tables were corrupted, so i fixed this issue by repairing them in mysql.
just putting this out there if anyone ever has a similar problem so you have a point of entry where to look.
for leet hax:
nano /usr/share/astguiclient/mysql_tables.sh
paste this:
#!/bin/sh
# this shell script finds all the tables for a database and run a command against it
# @usage "mysql_tables.sh --optimize MyDatabaseABC"
# @date 6/14/2006
# @version 1.1 - 1/28/2007 - add repair
# @version 1.0 - 6/14/2006 - first release
# @author Son Nguyen
DBNAME=$2
printUsage() {
echo "Usage: $0"
echo " --optimize
echo ” –repair
return
}
doAllTables() {
# get the table names
TABLENAMES=`mysql -D $DBNAME -e “SHOW TABLES\G;”|grep ‘Tables_in_’|sed -n ’s/.*Tables_in_.*: \([_0-9A-Za-z]*\).*/\1/p’`
# loop through the tables and optimize them
for TABLENAME in $TABLENAMES
do
mysql -D $DBNAME -e “$DBCMD TABLE $TABLENAME;”
done
}
if [ $# -eq 0 ] ; then
printUsage
exit 1
fi
case $1 in
–optimize) DBCMD=OPTIMIZE; doAllTables;;
–repair) DBCMD=REPAIR; doAllTables;;
–help) printUsage; exit 1;;
*) printUsage; exit 1;;
esac
make sure its rwxrxrx
in your startup script put
/usr/share/astguiclient/mysql_tables.sh –repair asterisk
/usr/share/astguiclient/mysql_tables.sh –optimize asterisk
