We originate loopback channels which are bridged to sofia.
The call is pushed into fifo.
I connected 2 FS's .say A and B.
on A I originate calls, with test.py. the dialplan is A.xml
B plays back soundfiles. (B.xml)
I can reproduce with a small script which sends bgapi originate.
After running this script for a while (it takes sometimes a 15 miutes sometimes 1 hour) and stop. "show channels" shows old channels.
eg:
I added SWITCH_DEBUG_RWLOCKS define to see what happens with rwlocks
show calls:
539c80f9-21bd-11de-841e-4731eebc5a5d,outbound,2009-04-05 10:39:50,1238920790,loopback/#2#279#9243#1#predictivedialer#-a,CS_EXECUTE,FreeSWITCH,0000000000,,pp-
queue,fifo,pp-queue-2 in,XML,queues-asp2,L16,8000,L16,8000
when I try to uuid_kill it I get:
2009-04-05 11:28:31 [ERR] mod_commands.c:1259 kill_function() loopback/#2#279#9243#1#predictivedialer#-b Read lock FAIL
freeswitch@default>
The last lines mentioning this channels in the log are:
2009-04-05 10:40:05 [DEBUG] switch_core_state_machine.c:420 switch_core_session_run() (loopback/#2#279#9243#1#predictivedialer#-b) State Change CS_REPORTING
-> CS_DONE
2009-04-05 10:40:05 [DEBUG] switch_core_session.c:1001 switch_core_session_thread() Session 205351 (loopback/#2#279#9243#1#predictivedialer#-b) Locked, Waiti
ng on external entities
2009-04-05 10:40:05 [ERR] switch_core_session.c:1003 switch_core_session_thread() loopback/#2#279#9243#1#predictivedialer#-b Write lock ACQUIRED
I guess setting SSF_DESTROYED flag blocks in switch_core_session_thread becasue the write lock is acquired in the line right before it according to the log
and I lookes into switch_core_session_read_lock which is performed when I make "uuid_kill", and I added logs to see
which condition is true in switch_test_flag(session, SSF_DESTROYED) || switch_channel_down(session->channel)
I always see SSF_DESTROYED isn't set, but the channel is down.