Queues - dialparties.agi & high CPU load

It was fixed in r7917 for 2.5 but it is not published as an update yet.

I published 2.5.2 on 9/5 so if it was rolled in on that revision, it should be out now.

Hello everyone :slight_smile:
I’ve read this forum with great interest as the problem described here is exactly what’s been happening to us. We have switched from a two year old setup running on trixbox appliance with Asterisk 1.2 to Debian Lenny + Asterisk 1.4 + FreePBX. Since then I noticed the excessive load when more then 3 calls landed in queues.

After reading this thread we have upgraded to Asterisk 1.4.26.2 & FreePBX 2.6.0.RC2.1 however problem still continues for us. Switching queue members to SIP channels solves the load problem in testing, however introduces other side effects we cannot afford in production environment (call transfer, calls don’t get recorded).

I have now setup a test server with a very simple setup of 3 active extensions and 1 queue. Watching load with atop on Debian with 1 second refresh interval I notice spikes of CPU usage up to 100% when agi scripts are run. These spikes quickly add up to continued high CPU utilization when more then 3 calls are placed in queue.

I am not sure if the problem is with agi log function (we have replaced it with a dummy stub for testing)

Since this issue is reported here as fixed in versions of asterisk/freepbx we use - is there any setting we have missed? Below is log output & settings, I am not asterisk guru, but will be glad to post any further details.

asterisk-vh*CLI> queue show 951
951 has 0 calls (max unlimited) in ‘ringall’ strategy (0s holdtime), W:0, C:0, A:0, SL:0.0% within 0s
Members:
Local/912@from-queue/n (Not in use) has taken no calls yet
Local/910@from-queue/n (Not in use) has taken no calls yet
Local/909@from-queue/n (Not in use) has taken no calls yet
No Callers

– Executing [951@from-internal:1] Macro(“SIP/912-0872e120”, “user-callerid|”) in new stack
– Executing [s@macro-user-callerid:1] Set(“SIP/912-0872e120”, “AMPUSER=912”) in new stack
– Executing [s@macro-user-callerid:2] GotoIf(“SIP/912-0872e120”, “0?report”) in new stack
– Executing [s@macro-user-callerid:3] ExecIf(“SIP/912-0872e120”, “1|Set|REALCALLERIDNUM=912”) in new stack
– Executing [s@macro-user-callerid:4] Set(“SIP/912-0872e120”, “AMPUSER=912”) in new stack
– Executing [s@macro-user-callerid:5] Set(“SIP/912-0872e120”, “AMPUSERCIDNAME=912”) in new stack
– Executing [s@macro-user-callerid:6] GotoIf(“SIP/912-0872e120”, “0?report”) in new stack
– Executing [s@macro-user-callerid:7] Set(“SIP/912-0872e120”, “AMPUSERCID=912”) in new stack
– Executing [s@macro-user-callerid:8] Set(“SIP/912-0872e120”, “CALLERID(all)=“912” <912>”) in new stack
– Executing [s@macro-user-callerid:9] ExecIf(“SIP/912-0872e120”, “0|Set|CHANNEL(language)=”) in new stack
– Executing [s@macro-user-callerid:10] GotoIf(“SIP/912-0872e120”, “0?continue”) in new stack
– Executing [s@macro-user-callerid:11] Set(“SIP/912-0872e120”, “__TTL=64”) in new stack
– Executing [s@macro-user-callerid:12] GotoIf(“SIP/912-0872e120”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,19)
– Executing [s@macro-user-callerid:19] NoOp(“SIP/912-0872e120”, “Using CallerID “912” <912>”) in new stack
– Executing [951@from-internal:2] Answer(“SIP/912-0872e120”, “”) in new stack
– Executing [951@from-internal:3] ExecIf(“SIP/912-0872e120”, “1|Set|__QUEUEWAIT=1253979249”) in new stack
– Executing [951@from-internal:4] Set(“SIP/912-0872e120”, “__BLKVM_OVERRIDE=BLKVM/951/SIP/912-0872e120”) in new stack
– Executing [951@from-internal:5] Set(“SIP/912-0872e120”, “__BLKVM_BASE=951”) in new stack
– Executing [951@from-internal:6] Set(“SIP/912-0872e120”, “DB(BLKVM/951/SIP/912-0872e120)=TRUE”) in new stack
– Executing [951@from-internal:7] ExecIf(“SIP/912-0872e120”, “1|Set|_DIAL_OPTIONS=trM(auto-blkvm)”) in new stack
– Executing [951@from-internal:8] Set(“SIP/912-0872e120”, “__NODEST=951”) in new stack
– Executing [951@from-internal:9] GotoIf(“SIP/912-0872e120”, “1?REPCID”) in new stack
– Goto (from-internal,951,14)
– Executing [951@from-internal:14] NoOp(“SIP/912-0872e120”, “CALLERID(name) is 912”) in new stack
– Executing [951@from-internal:15] Set(“SIP/912-0872e120”, “_RGPREFIX=test”) in new stack
– Executing [951@from-internal:16] Set(“SIP/912-0872e120”, “CALLERID(name)=test912”) in new stack
– Executing [951@from-internal:17] Set(“SIP/912-0872e120”, “MONITOR_FILENAME=/var/spool/asterisk/monitor/q951-20090927-013410-1253979249.0”) in new stack
– Executing [951@from-internal:18] Set(“SIP/912-0872e120”, “__CWIGNORE=TRUE”) in new stack
– Executing [951@from-internal:19] Queue(“SIP/912-0872e120”, “951|t||”) in new stack
– Started music on hold, class ‘default’, on SIP/912-0872e120
– Executing [909@from-queue:1] Set(“Local/909@from-queue-3a63,2”, “QAGENT=909”) in new stack
– Executing [909@from-queue:2] Goto(“Local/909@from-queue-3a63,2”, “951|1”) in new stack
– Goto (from-queue,951,1)
– Executing [951@from-queue:1] Goto(“Local/909@from-queue-3a63,2”, “from-internal|909|1”) in new stack
– Goto (from-internal,909,1)
– Executing [909@from-internal:1] Macro(“Local/909@from-queue-3a63,2”, “exten-vm|novm|909”) in new stack
– Executing [s@macro-exten-vm:1] Macro(“Local/909@from-queue-3a63,2”, “user-callerid”) in new stack
– Executing [s@macro-user-callerid:1] Set(“Local/909@from-queue-3a63,2”, “AMPUSER=912”) in new stack
– Executing [s@macro-user-callerid:2] GotoIf(“Local/909@from-queue-3a63,2”, “1?report”) in new stack
– Goto (macro-user-callerid,s,10)
– Executing [s@macro-user-callerid:10] GotoIf(“Local/909@from-queue-3a63,2”, “0?continue”) in new stack
– Executing [s@macro-user-callerid:11] Set(“Local/909@from-queue-3a63,2”, “__TTL=63”) in new stack
– Executing [s@macro-user-callerid:12] GotoIf(“Local/909@from-queue-3a63,2”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,19)
– Executing [s@macro-user-callerid:19] NoOp(“Local/909@from-queue-3a63,2”, “Using CallerID “test912” <912>”) in new stack
– Executing [s@macro-exten-vm:2] Set(“Local/909@from-queue-3a63,2”, “RingGroupMethod=none”) in new stack
– Executing [s@macro-exten-vm:3] Set(“Local/909@from-queue-3a63,2”, “VMBOX=novm”) in new stack
– Executing [s@macro-exten-vm:4] Set(“Local/909@from-queue-3a63,2”, “EXTTOCALL=909”) in new stack
– Executing [s@macro-exten-vm:5] Set(“Local/909@from-queue-3a63,2”, “CFUEXT=”) in new stack
– Executing [s@macro-exten-vm:6] Set(“Local/909@from-queue-3a63,2”, “CFBEXT=”) in new stack
– Executing [s@macro-exten-vm:7] Set(“Local/909@from-queue-3a63,2”, “RT=”"") in new stack
– Executing [s@macro-exten-vm:8] Macro(“Local/909@from-queue-3a63,2”, “record-enable|909|IN”) in new stack
– Executing [s@macro-record-enable:1] GotoIf(“Local/909@from-queue-3a63,2”, “1?check”) in new stack
– Goto (macro-record-enable,s,4)
– Executing [s@macro-record-enable:4] AGI(“Local/909@from-queue-3a63,2”, “recordingcheck|20090927-013410|1253979250.2”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck
– Executing [910@from-queue:1] Set(“Local/910@from-queue-17cb,2”, “QAGENT=910”) in new stack
– Executing [910@from-queue:2] Goto(“Local/910@from-queue-17cb,2”, “951|1”) in new stack
– Goto (from-queue,951,1)
– Executing [951@from-queue:1] Goto(“Local/910@from-queue-17cb,2”, “from-internal|910|1”) in new stack
– Goto (from-internal,910,1)
– Executing [910@from-internal:1] Macro(“Local/910@from-queue-17cb,2”, “exten-vm|novm|910”) in new stack
– Executing [s@macro-exten-vm:1] Macro(“Local/910@from-queue-17cb,2”, “user-callerid”) in new stack
– Executing [s@macro-user-callerid:1] Set(“Local/910@from-queue-17cb,2”, “AMPUSER=912”) in new stack
– Executing [s@macro-user-callerid:2] GotoIf(“Local/910@from-queue-17cb,2”, “1?report”) in new stack
– Goto (macro-user-callerid,s,10)
– Executing [s@macro-user-callerid:10] GotoIf(“Local/910@from-queue-17cb,2”, “0?continue”) in new stack
– Executing [s@macro-user-callerid:11] Set(“Local/910@from-queue-17cb,2”, “__TTL=63”) in new stack
– Executing [s@macro-user-callerid:12] GotoIf(“Local/910@from-queue-17cb,2”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,19)
– Executing [s@macro-user-callerid:19] NoOp(“Local/910@from-queue-17cb,2”, “Using CallerID “test912” <912>”) in new stack
– Executing [s@macro-exten-vm:2] Set(“Local/910@from-queue-17cb,2”, “RingGroupMethod=none”) in new stack
– Executing [s@macro-exten-vm:3] Set(“Local/910@from-queue-17cb,2”, “VMBOX=novm”) in new stack
– Executing [s@macro-exten-vm:4] Set(“Local/910@from-queue-17cb,2”, “EXTTOCALL=910”) in new stack
– Executing [s@macro-exten-vm:5] Set(“Local/910@from-queue-17cb,2”, “CFUEXT=”) in new stack
– Executing [s@macro-exten-vm:6] Set(“Local/910@from-queue-17cb,2”, “CFBEXT=”) in new stack
– Executing [s@macro-exten-vm:7] Set(“Local/910@from-queue-17cb,2”, “RT=”"") in new stack
– Executing [s@macro-exten-vm:8] Macro(“Local/910@from-queue-17cb,2”, “record-enable|910|IN”) in new stack
– Executing [s@macro-record-enable:1] GotoIf(“Local/910@from-queue-17cb,2”, “1?check”) in new stack
– Goto (macro-record-enable,s,4)
– Executing [s@macro-record-enable:4] AGI(“Local/910@from-queue-17cb,2”, “recordingcheck|20090927-013410|1253979250.4”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck
– Executing [912@from-queue:1] Set(“Local/912@from-queue-ac5e,2”, “QAGENT=912”) in new stack
– Executing [912@from-queue:2] Goto(“Local/912@from-queue-ac5e,2”, “951|1”) in new stack
– Goto (from-queue,951,1)
– Executing [951@from-queue:1] Goto(“Local/912@from-queue-ac5e,2”, “from-internal|912|1”) in new stack
– Goto (from-internal,912,1)
– Executing [912@from-internal:1] Macro(“Local/912@from-queue-ac5e,2”, “exten-vm|novm|912”) in new stack
– Executing [s@macro-exten-vm:1] Macro(“Local/912@from-queue-ac5e,2”, “user-callerid”) in new stack
– Executing [s@macro-user-callerid:1] Set(“Local/912@from-queue-ac5e,2”, “AMPUSER=912”) in new stack
– Executing [s@macro-user-callerid:2] GotoIf(“Local/912@from-queue-ac5e,2”, “1?report”) in new stack
– Goto (macro-user-callerid,s,10)
– Executing [s@macro-user-callerid:10] GotoIf(“Local/912@from-queue-ac5e,2”, “0?continue”) in new stack
– Executing [s@macro-user-callerid:11] Set(“Local/912@from-queue-ac5e,2”, “__TTL=63”) in new stack
– Executing [s@macro-user-callerid:12] GotoIf(“Local/912@from-queue-ac5e,2”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,19)
– Executing [s@macro-user-callerid:19] NoOp(“Local/912@from-queue-ac5e,2”, “Using CallerID “test912” <912>”) in new stack
– Executing [s@macro-exten-vm:2] Set(“Local/912@from-queue-ac5e,2”, “RingGroupMethod=none”) in new stack
– Executing [s@macro-exten-vm:3] Set(“Local/912@from-queue-ac5e,2”, “VMBOX=novm”) in new stack
– Executing [s@macro-exten-vm:4] Set(“Local/912@from-queue-ac5e,2”, “EXTTOCALL=912”) in new stack
– Executing [s@macro-exten-vm:5] Set(“Local/912@from-queue-ac5e,2”, “CFUEXT=”) in new stack
– Executing [s@macro-exten-vm:6] Set(“Local/912@from-queue-ac5e,2”, “CFBEXT=”) in new stack
– Executing [s@macro-exten-vm:7] Set(“Local/912@from-queue-ac5e,2”, “RT=”"") in new stack
– Executing [s@macro-exten-vm:8] Macro(“Local/912@from-queue-ac5e,2”, “record-enable|912|IN”) in new stack
– Executing [s@macro-record-enable:1] GotoIf(“Local/912@from-queue-ac5e,2”, “1?check”) in new stack
– Goto (macro-record-enable,s,4)
– Executing [s@macro-record-enable:4] AGI(“Local/912@from-queue-ac5e,2”, “recordingcheck|20090927-013410|1253979250.6”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck
recordingcheck|20090927-013410|1253979250.2: Inbound recording enabled.
recordingcheck|20090927-013410|1253979250.2: CALLFILENAME=20090927-013410-1253979250.2
– AGI Script recordingcheck completed, returning 0
– Executing [s@macro-record-enable:999] MixMonitor(“Local/909@from-queue-3a63,2”, “20090927-013410-1253979250.2.wav||”) in new stack
== Begin MixMonitor Recording Local/909@from-queue-3a63,2
– Executing [s@macro-exten-vm:9] Macro(“Local/909@from-queue-3a63,2”, “dial||trM(auto-blkvm)|909”) in new stack
– Executing [s@macro-dial:1] GotoIf(“Local/909@from-queue-3a63,2”, “1?dial”) in new stack
– Goto (macro-dial,s,3)
– Executing [s@macro-dial:3] AGI(“Local/909@from-queue-3a63,2”, “dialparties.agi”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
recordingcheck|20090927-013410|1253979250.4: Inbound recording enabled.
recordingcheck|20090927-013410|1253979250.4: CALLFILENAME=20090927-013410-1253979250.4
– AGI Script recordingcheck completed, returning 0
– Executing [s@macro-record-enable:999] MixMonitor(“Local/910@from-queue-17cb,2”, “20090927-013410-1253979250.4.wav||”) in new stack
== Begin MixMonitor Recording Local/910@from-queue-17cb,2
– Executing [s@macro-exten-vm:9] Macro(“Local/910@from-queue-17cb,2”, “dial||trM(auto-blkvm)|910”) in new stack
– Executing [s@macro-dial:1] GotoIf(“Local/910@from-queue-17cb,2”, “1?dial”) in new stack
– Goto (macro-dial,s,3)
– Executing [s@macro-dial:3] AGI(“Local/910@from-queue-17cb,2”, “dialparties.agi”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
recordingcheck|20090927-013410|1253979250.6: Inbound recording enabled.
recordingcheck|20090927-013410|1253979250.6: CALLFILENAME=20090927-013410-1253979250.6
– AGI Script recordingcheck completed, returning 0
– Executing [s@macro-record-enable:999] MixMonitor(“Local/912@from-queue-ac5e,2”, “20090927-013410-1253979250.6.wav||”) in new stack
== Begin MixMonitor Recording Local/912@from-queue-ac5e,2
– Executing [s@macro-exten-vm:9] Macro(“Local/912@from-queue-ac5e,2”, “dial||trM(auto-blkvm)|912”) in new stack
– Executing [s@macro-dial:1] GotoIf(“Local/912@from-queue-ac5e,2”, “1?dial”) in new stack
– Goto (macro-dial,s,3)
– Executing [s@macro-dial:3] AGI(“Local/912@from-queue-ac5e,2”, “dialparties.agi”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
dialparties.agi: Starting New Dialparties.agi
dialparties.agi: Caller ID name is ‘test912’ number is '912’
dialparties.agi: Methodology of ring is ‘none’
– dialparties.agi: Added extension 909 to extension map
– dialparties.agi: Extension 909 cf is disabled
– dialparties.agi: Extension 909 do not disturb is disabled
dialparties.agi: ExtensionState: 0
dialparties.agi: Extension 909 has ExtensionState: 0
– dialparties.agi: Checking CW and CFB status for extension 909
dialparties.agi: Starting New Dialparties.agi
dialparties.agi: Caller ID name is ‘test912’ number is '912’
dialparties.agi: Methodology of ring is ‘none’
– dialparties.agi: Added extension 910 to extension map
– dialparties.agi: dbset CALLTRACE/909 to 912
– dialparties.agi: Filtered ARG3: 909
== Manager ‘admin’ logged off from 127.0.0.1
– AGI Script dialparties.agi completed, returning 0
– dialparties.agi: Extension 910 cf is disabled
– Executing [s@macro-dial:7] Dial(“Local/909@from-queue-3a63,2”, “SIP/909||trM(auto-blkvm)”) in new stack
– Called 909
– Local/909@from-queue-3a63,1 is ringing
– dialparties.agi: Extension 910 do not disturb is disabled
dialparties.agi: ExtensionState: 0
dialparties.agi: Extension 910 has ExtensionState: 0
– dialparties.agi: Checking CW and CFB status for extension 910
– dialparties.agi: dbset CALLTRACE/910 to 912
– dialparties.agi: Filtered ARG3: 910
== Manager ‘admin’ logged off from 127.0.0.1
– AGI Script dialparties.agi completed, returning 0
– Executing [s@macro-dial:7] Dial(“Local/910@from-queue-17cb,2”, “SIP/910||trM(auto-blkvm)”) in new stack
– Called 910
– Local/910@from-queue-17cb,1 is ringing
dialparties.agi: Starting New Dialparties.agi
dialparties.agi: Caller ID name is ‘test912’ number is '912’
dialparties.agi: Methodology of ring is ‘none’
– dialparties.agi: Added extension 912 to extension map
– dialparties.agi: Extension 912 cf is disabled
– dialparties.agi: Extension 912 do not disturb is disabled
dialparties.agi: ExtensionState: 1
dialparties.agi: Extension 912 has ExtensionState: 1
– dialparties.agi: Checking CW and CFB status for extension 912
dialparties.agi: Extension 912 is not available to be called
dialparties.agi: Extension 912 has call waiting disabled
– dialparties.agi: Filtered ARG3:
– AGI Script dialparties.agi completed, returning 0
– Executing [s@macro-dial:4] NoOp(“Local/912@from-queue-ac5e,2”, “Returned from dialparties with no extensions to call and DIALSTATUS: BUSY”) in new stack
– Executing [s@macro-exten-vm:10] GotoIf(“Local/912@from-queue-ac5e,2”, “0?exit|return”) in new stack
– Executing [s@macro-exten-vm:11] Set(“Local/912@from-queue-ac5e,2”, “SV_DIALSTATUS=BUSY”) in new stack
– Executing [s@macro-exten-vm:12] GosubIf(“Local/912@from-queue-ac5e,2”, “0?docfu|1”) in new stack
– Executing [s@macro-exten-vm:13] GosubIf(“Local/912@from-queue-ac5e,2”, “0?docfb|1”) in new stack
– Executing [s@macro-exten-vm:14] Set(“Local/912@from-queue-ac5e,2”, “DIALSTATUS=BUSY”) in new stack
– Executing [s@macro-exten-vm:15] NoOp(“Local/912@from-queue-ac5e,2”, “Voicemail is novm”) in new stack
– Executing [s@macro-exten-vm:16] GotoIf(“Local/912@from-queue-ac5e,2”, “1?s-BUSY|1”) in new stack
– Goto (macro-exten-vm,s-BUSY,1)
– Executing [s-BUSY@macro-exten-vm:1] NoOp(“Local/912@from-queue-ac5e,2”, “Extension is reporting BUSY and not passing to Voicemail”) in new stack
– Executing [s-BUSY@macro-exten-vm:2] GotoIf(“Local/912@from-queue-ac5e,2”, “0?exit|1”) in new stack
– Executing [s-BUSY@macro-exten-vm:3] PlayTones(“Local/912@from-queue-ac5e,2”, “busy”) in new stack
– Executing [s-BUSY@macro-exten-vm:4] Busy(“Local/912@from-queue-ac5e,2”, “20”) in new stack
– Local/912@from-queue-ac5e,1 is busy
== Spawn extension (macro-exten-vm, s-BUSY, 4) exited non-zero on ‘Local/912@from-queue-ac5e,2’ in macro ‘exten-vm’
== Spawn extension (from-internal, 912, 1) exited non-zero on ‘Local/912@from-queue-ac5e,2’
– Executing [h@from-internal:1] Macro(“Local/912@from-queue-ac5e,2”, “hangupcall”) in new stack
– Executing [s@macro-hangupcall:1] GotoIf(“Local/912@from-queue-ac5e,2”, “1?skiprg”) in new stack
– Goto (macro-hangupcall,s,4)
– Executing [s@macro-hangupcall:4] GotoIf(“Local/912@from-queue-ac5e,2”, “1?skipblkvm”) in new stack
– Goto (macro-hangupcall,s,7)
– Executing [s@macro-hangupcall:7] GotoIf(“Local/912@from-queue-ac5e,2”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,9)
– Executing [s@macro-hangupcall:9] Hangup(“Local/912@from-queue-ac5e,2”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 9) exited non-zero on ‘Local/912@from-queue-ac5e,2’ in macro ‘hangupcall’
== Spawn extension (from-internal, h, 1) exited non-zero on ‘Local/912@from-queue-ac5e,2’
== MixMonitor close filestream
== End MixMonitor Recording Local/912@from-queue-ac5e,2
– Nobody picked up in 1000 ms
– SIP/910-08745a08 is ringing
– SIP/909-08740ea0 is ringing
– SIP/909-08740ea0 is ringing

cat …/amportal.conf | grep -ve ^# -^$

AMPDBHOST=localhost
AMPDBENGINE=mysql
AMPENGINE=asterisk
AMPMGRUSER=admin
AMPMGRPASS=*****
AMPBIN=/var/lib/asterisk/bin
AMPSBIN=/usr/local/sbin
AMPWEBROOT=/var/www
AMPCGIBIN=/var/www/cgi-bin
FOPWEBROOT=/var/www/panel
FOPPASSWORD=*****
FOPSORT=extension
FOPRUN=true
AUTHTYPE=database
AMPADMINLOGO=logo.png
AMPEXTENSIONS=extensions
ENABLECW=yes
CWINUSEBUSY=yes
AMPBADNUMBER=true
XTNCONFLICTABORT=false
BADDESTABORT=false
SERVERINTITLE=false
USEDEVSTATE=true
MODULEADMINWGET=false
AMPDBUSER=asteriskuser
AMPDBPASS=*****
AMPDBNAME=asterisk
ASTETCDIR=/etc/asterisk
ASTMODDIR=/usr/lib/asterisk/modules
ASTVARLIBDIR=/var/lib/asterisk
ASTAGIDIR=/var/lib/asterisk/agi-bin
ASTSPOOLDIR=/var/spool/asterisk
ASTRUNDIR=/var/run/asterisk
ASTLOGDIR=/var/log/asterisk

cat queues_additional.conf
;--------------------------------------------------------------------------------;
; Do NOT edit this file as it is auto-generated by FreePBX. All modifications to ;
; this file must be done via the web gui. There are alternative files to make ;
; custom modifications, details at: http://freepbx.org/configuration_files ;
;--------------------------------------------------------------------------------;
;

[951]
announce-frequency=0
announce-holdtime=no
autofill=no
eventmemberstatus=yes
eventwhencalled=no
joinempty=yes
leavewhenempty=no
maxlen=0
periodic-announce-frequency=0
queue-callswaiting=silence/1
queue-thereare=silence/1
queue-youarenext=silence/1
retry=5
ringinuse=no
strategy=ringall
timeout=15
weight=0
wrapuptime=0
member=Local/909@from-queue/n,0
member=Local/910@from-queue/n,0
member=Local/912@from-queue/n,0

cat sip_additional.conf

;--------------------------------------------------------------------------------;
; Do NOT edit this file as it is auto-generated by FreePBX. All modifications to ;
; this file must be done via the web gui. There are alternative files to make ;
; custom modifications, details at: http://freepbx.org/configuration_files ;
;--------------------------------------------------------------------------------;
;

[909]
deny=0.0.0.0/0.0.0.0
secret=****
dtmfmode=rfc2833
canreinvite=no
context=from-internal
host=dynamic
type=friend
nat=yes
port=5060
qualify=yes
callgroup=
pickupgroup=
dial=SIP/909
accountcode=
mailbox=909@device
permit=0.0.0.0/0.0.0.0
callerid=device <909>
call-limit=50

<…>

The pre-forked trixbox systems are very easy to convert to genuine FreePBX and Asterisk. I do it all the time for my clients.

Essentially you can download all of the dependencies via yum and then the DAHDI, Asterisk and Asterisk Add-ons packages. Lastly the freePBX tarball is install via the install-amp script.

The key gotcha is to remove all the Zaptel config files, including the startup scripts from rc.d and the use the ‘make install’ command to build the DAHDI start/stop scripts.

as far as putting comments/patches here in hopes that they will be picked up by up by dev, that is not the best way to approach it.

Most things in the forums get lost very quick to devs and usually not seen.

If you think you have valuable information that should be picked up by devs, then the way to do it is to file a ticket. That is what the devs look at and track.

The issue with this type of patch is that it is a bandaid that ignores the true problem, even in your case. The problem here is probably two fold. First, what the default logging settings are. Second, why so many messages. The bandaid of not writing them still allows for significant overhead in the fact that the events are triggering in the first place that causes so many messages. This is what was fixed once it was brought to light.

As far as upgrading, if your trixbox installs are their forked version, then it will be more difficult. I they are genuine FreePBX it should be fairly straight forward even on hundreds of machines. As far as Asterisk is concerned, I would not upgrade to 1.6 from 1.4 as you are probably asking for problems. However, adding func_extstate.so to hundreds of machines is not hard and depending on what equipment you have installed, you can probably compile one copy of that file and install it on all the systems fairly easily. However, until you upgrade there is not point because FreePBX does not start using that function until 2.8 iirc (there may be some use in 2.7 in dialparties.agi).

I agree with all of your statements. I’ve occasionally posted my patches here just in case it helps somebody short term and points devs to the correct fix long term. And only in the case that I’ve discovered something new.

Anyone trying a patch should keep a backup copy of the original file to put back in case it causes worse problems. Also, note that I’m working with only a very specific version of the code, so if you’re trying on a different version understand it may not work the same.

I wish there was a simple way of upgrading 1.4 to 1.6 and TB2623 to FreePBX 2.8 - I’d do that for my hundreds of customer machines.

I have tested this on Trixbox 2.6.2.3, also back to 2.6.2.1. I don’t know about other versions currently. The modules are mostly version 2.5.

There is no other change I have done - this patch on a stock 2.6.2.3 takes the system from being very slow to get queue calls out to very fast. Still takes several seconds to get all the calls out, but it’s better than before.

To make sure you got the patch working, do a tail -f /var/log/messages and you shouldn’t see a lot of entries complaining about the timezone when a queue call is sent to ringall agents.

The only presumptions here is that you have the queue delivering to agents via the Local/# instead of SIP/# method, and that you have the follow me module installed. It’s not required that agents have follow me enabled, although that certainly does slow things down even further without this patch.

there are many different things that can create issues with queues and related to dialparties.agi cpu usage.

However, blindly following a patch that remove the error log statement out of phpagi-asmanger.php is a mistake plus the fact that it will get overwritten on updates.

There are other ways to control what gets logged if the error logging is one of the things that are creating issues.

Also - if you are running into these related issues, your first best bet is to upgrade to FreePBX 2.8 where there have been a lot of things done to queues in general and other parts to address performance. For more info on queues specifically, go look for the Technical Corner blog article on Queues which goes into quite some depth.

Also - if you are running Asterisk 1.4, in addition to the upgrades, install a back-port of the func_extstate.c which will be detected by FreePBX and used in dialparties.agi vs. opening a manager connection. You will also find that in 2.8 single extension dialing (thus how queues do it by default) does not even use dialplarties.agi but uses macro-dial-one instead which is 100% dialplan, no AGI scripts.(assuming you have func_extstate.c back ported to asterisk.

You will also find that in 2.8, events have been turned off on all calls to the manager, since they are not used. These events are one of the biggest sources of all the error logging from the manager and should never have been turned on and manifest themselves into bigger problems on very busy systems.

I have changed the phpagi-asmanager.php.But it doesn’t seem to work in my AS.So if it may not the key change.Could you tell me the other change you do?

I have experienced this problem myself on Trixbox 2.6.2.3 and have developed a solution.

The high load problem actually is caused by /var/lib/asterisk/agi-bin/phpagi-asmanager.php – in function log() the call to error_log(date(…) is spitting out an exceedingly large number of log entries to /var/log/messages.

Simply commenting out the error_log line does the trick. This may not be the best solution, since there could be valid reasons to log a message, but nobody pays attention to /var/log/messages anyway right? Somebody may wish to review why phpagi is generating a bunch of errors about timezone and fix that.

In a queue that has 10 agents each with follow me, this patch takes the response time down from 10+ seconds to get the last agent rung to 1-2 seconds max (although zero seconds with the direct sip method mentioned previously, if you don’t need the follow me’s to work).

Here is a sed patch that automates the fix:

sed -i ‘s/error_log.date.*/;/’ /var/lib/asterisk/agi-bin/phpagi-asmanager.php