Klaus Darilion writes:

> utils/kamctl: new command 'trap'
>   - useful to get a full bt dump of all kamailio processes
>   - handy in dead-lock investigatigations

klaus,

thanks for the pointer.  i pulled out shell script from it (below).

it would be still nice to know how kamailio is dispatching the requests
to worker processes.

-- juha

#!/bin/bash

BINARY=kamailio

GDB=gdb
DATE=`/bin/date +%Y%m%d_%H%M%S`
LOG_FILE=/tmp/gdb_kamailio_$DATE
echo "Trap file: $LOG_FILE"
pres-serv_ctl ps > $LOG_FILE
echo -n "Trapping Kamailio with gdb: "
PID_TIMESTAMP_VECTOR=`sed -e 's/\([0-9]*\).*/\1/' $LOG_FILE`
for pid in $PID_TIMESTAMP_VECTOR
    do
        echo -n "."
        PID=`echo $pid | cut -d '-' -f 1`
        echo "" >> $LOG_FILE
            echo "---start $PID 
-----------------------------------------------------" >> $LOG_FILE
            $GDB $BINARY $PID -batch --eval-command="bt full" &>> $LOG_FILE
            echo "---end $PID 
-------------------------------------------------------" >> $LOG_FILE
    done
echo "."

_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

Reply via email to