Hello,
We are running:
asterisk 22.3.0
FreePBX 17.0.19.27
debian 12.11
We installed asterisk and FreePBX using the FreePBX installation instructions, with dahdi enabled. We are running a Digium TC400P (or TC400B ?) transcoder card:
root@box:~# dahdi_hardware
pci:0000:03:00.0 wctc4xxp+ d161:3400 Wildcard TC400P
root@box:~#
We run an AGI application which we have recently ported from circa 2007 asterisk. The machine on which we experienced the “refcount 100000” error had been taking calls since July 3rd, processing about 20K calls in total. Yesterday the machine experienced very high CPU load. I was able to SSH in, and the "/var/log/asterisk/full log showed:
[2025-07-24 15:30:44] DTMF[4033940][C-0000b25e] channel.c: DTMF begin ignored '2' on PJSIP/CCI_1-0000b25d
[2025-07-24 15:30:44] VERBOSE[4033961][C-0000b25f] res_agi.c: AGI Script Executing Application: (PLAYBACK) Options: (/var/lib/asterisk/sounds/tpw/default/L1/ThankYou)
[2025-07-24 15:30:44] VERBOSE[4033961][C-0000b25f] file.c: <PJSIP/Intel_2673_NYC-0000b25e> Playing '/var/lib/asterisk/sounds/tpw/default/L1/ThankYou.ulaw' (language 'en')
[2025-07-24 15:30:44] DTMF[4033940][C-0000b25e] channel.c: DTMF end '2' received on PJSIP/CCI_1-0000b25d, duration 285 ms
[2025-07-24 15:30:44] DTMF[4033940][C-0000b25e] channel.c: DTMF end passthrough '2' on PJSIP/CCI_1-0000b25d
[2025-07-24 15:30:44] DTMF[4033940][C-0000b25e] channel.c: DTMF begin '7' received on PJSIP/CCI_1-0000b25d
[2025-07-24 15:30:44] DTMF[4033940][C-0000b25e] channel.c: DTMF begin ignored '7' on PJSIP/CCI_1-0000b25d
[2025-07-24 15:30:44] ERROR[4034010][C-0000b260] stasis_channels.c: Excessive refcount 100000 reached on ao2 object 0x55e10bb3cc78
[2025-07-24 15:30:44] ERROR[4034010][C-0000b260] stasis_channels.c: FRACK!, Failed assertion Excessive refcount 100000 reached on ao2 object 0x55e10bb3cc78 (0)
[2025-07-24 15:30:44] ERROR[4034010][C-0000b260] : Got 18 backtrace records
# 0: /usr/sbin/asterisk(__ast_assert_failed+0x90) [0x55e0d135c4e7]
# 1: /usr/sbin/asterisk(__ao2_ref+0x46d) [0x55e0d11bea1b]
# 2: /usr/sbin/asterisk(+0x1dece0) [0x55e0d1327ce0]
# 3: /usr/sbin/asterisk(ast_channel_blob_create_from_cache+0x49) [0x55e0d1327d8e]
# 4: /usr/sbin/asterisk(ast_channel_publish_cached_blob+0x46) [0x55e0d1328c19]
# 5: /lib/x86_64-linux-gnu/asterisk/modules/res_agi.so(+0x1019c) [0x7f8d3974919c]
# 6: /lib/x86_64-linux-gnu/asterisk/modules/res_agi.so(+0x106f0) [0x7f8d397496f0]
# 7: /lib/x86_64-linux-gnu/asterisk/modules/res_agi.so(+0x10ebb) [0x7f8d39749ebb]
# 8: /lib/x86_64-linux-gnu/asterisk/modules/res_agi.so(+0x12243) [0x7f8d3974b243]
# 9: /lib/x86_64-linux-gnu/asterisk/modules/res_agi.so(+0x123a6) [0x7f8d3974b3a6]
#10: /usr/sbin/asterisk(pbx_exec+0x12b) [0x55e0d12bbbf4]
#11: /usr/sbin/asterisk(+0x15d0f3) [0x55e0d12a60f3]
#12: /usr/sbin/asterisk(ast_spawn_extension+0x50) [0x55e0d12aa2fd]
#13: /usr/sbin/asterisk(+0x162075) [0x55e0d12ab075]
#14: /usr/sbin/asterisk(+0x1639df) [0x55e0d12ac9df]
#15: /usr/sbin/asterisk(+0x21047e) [0x55e0d135947e]
#16: /lib/x86_64-linux-gnu/libc.so.6(+0x891f5) [0x7f8d7c4a81f5]
#17: /lib/x86_64-linux-gnu/libc.so.6(+0x10989c) [0x7f8d7c52889c]
The three ERROR lines and the stack trace (of 17 or 18 lines) repeated endlessly in the “full” log, and the machine was not taking any calls. I rebooted at about 15:40, and the machine began to process calls normally.
There are some forum entries from 2017-2018 suggesting modifying the source to increase the reference count limit. Is there any possible misconfiguration issue that could cause this problem?
One possible problem source is that the transcoder card is not doing it’s job, which would increase the burden on the CPU. Are there log entries that I can look for to show that the transcoder card is actually processing calls?