When communication with your FreeSWITCH breaks abruptly, it is a common symptom you have what we call zombie calls. A zombie call seems to be listed when you do show channels or show calls command, and it seems to still be using system resources.

Sadly, there is no a magic pill to void this kind of zombies. When a call comes, FreeSWITCH updates its core database and saves the status of each channel and the overall call. Sometimes, endpoints break the connection without notifying the switch. Therefore, the record in the core database is kept orphan.

FreeSWITCH by default, unless you do some special configurations, uses SQLite. Usually this database is located in /var/lib/freeswitch/db/core.db.

I have written the following script to flush zombie calls identified by the age of the call or channel. Modify it to fit your needs.

t=$(date +%s)
let "tm1=$t-18000"

sql_channels="DELETE FROM channels WHERE created_epoch < $tm1"  
sql_calls="DELETE FROM calls WHERE call_created_epoch < $tm1"  

/usr/bin/sqlite3 /var/lib/freeswitch/db/core.db "$sql_channels"
/usr/bin/sqlite3 /var/lib/freeswitch/db/core.db "$sql_calls"

Good luck!

blog comments powered by Disqus