FreePBX and queues problem on Asterisk 1.4.19/21


I am currently using FreePBX to run a Callcenter with multiple queues and agents and queue module version

I have migrated from Asterisk 1.2.x to 1.4.x. (moving from Trixbox to Elastix 1.2 distro) First I started with 1.4.19 from the Elastix 1.2 distro. Then I upgraded via yum to latest Elastix which updated asterisk to 1.4.21.

The problem I have (with both versions) is that agents log into the queues and they receive calls normally but after some time (5 days, 2 weeks, ans now hours), the system starts to behave erratically in which it reports agents on call that are not on call, agents that show logged in when they are logged off, agents logged in not receiving calls. Some of this can be fixed with “agent logoff” commands and sometime performing a “soft hangup”.

Since I upgraded from Asterisk 2.4.19 to 2.4.21, the system started to fail after several hours of being resetted (restart of asterisk). I have found that when Asterisk starts to fail, you can not complete commands on with the tab key on the CLI (command line interface). Some times, if you enter for example “sip show peers” after pressing enter, nothing is being showed and it return to the CLI command line prompt. At this time, external AMI applications can’t connect to Asterisk (sometimes) and even FreePBX won’t load it’s web interface due to the fact it can’t connect to the manager interface. The only solution, reboot which will drop calls in progress and customers currently on queue.

The only thing possible is to kill and restart. Some time, doing a ps axu you will find a defunct asterisk process.

Following, I will show you the code I have written in dial plan and other useful info that my users use to log in/log out of the queues to see if this has something that can cause problems.

Other questions:
Should we try to upgrade to version 2.5 of FreePBX ? Will this fix and/or possibly improve things with the updated queue module ?

I understand that the AgentCallBackLogin is deprecated in Asterisk 1.4 and will be removed in 1.6 in favor of dialplan logic in (AEL) that can handle the functionality of queues.

My question is if AgentCallBackLogin broken on Asterisk 1.4 ? Can this version cause this kind of trouble ? Should we fix our dialplan and implement the AEL stuff eliminating the AgentCallBackLogin so that crash and/or hanged calls, failure to login, etc, could be prevented ?

One other important thing to mention is that I have a webpage that uses the AMI events to show which agents are taking calls, which agents are online/off line, the amount of customers waiting on each queue, etc. This is being refreshed every 5 seconds through a PHP script and I normally have between 2 to 5 users hitting this application directly to Asterisk AMI without a AMI proxy. Could this simultaneous connection to AMI be able t break Asterisk due to the amount of requests being served over standard AMI ?

My queues are numbered from 600 to 605 and I have overriden the 60X* and 60X** login/logout script provided by FreePBX so our users could login as agents and onto a queue at the same time. All our agents are defined without passwords so dialing 601* will log them onto queue 601 and at the same time log them as agent/xxxx. After dialing 601*, the system will prompt for agent num and after login in the agent, will logged him in the dial queue.

An example from agents.conf

agent => 001,Jeanine Araujo
agent => 002,Jesus Velasquez

En of Example from agents.conf


persistentmembers = yes


#include queues_custom.conf
#include queues_additional.conf
#include queues_post_custom.conf

end of queues.conf

queues_additional.conf example of queue 601




exten => 600*,1,Macro(login-agent-queue,600)
exten => 600**,1,Macro(logout-agent-queue,600)
exten => 601*,1,Macro(login-agent-queue,601)
exten => 601**,1,Macro(logout-agent-queue,601)


; ARG1 queue number to log into, agent number will be asked by IVR, see below.
exten => s,1,Answer
exten => s,n,set(play=1) ;Inicialmente hacemos play del mensaje final
exten => s,n,Read(agentNum|agent-user|5||3|5) ; get callback number from user
exten => s,n,NoOp(Logeando a agentNum=[${agentNum}] callerid=[${CALLERID(NUM)}] status agente=[${AGENT(${agentNum})}])
;Asterisk 1.2 exten => s,n,AgentCallbackLogin(${agentNum}||${CALLERID(NUM)}@local)
exten => s,n,GotoIf($["${AGENT(${agentNum})}" = “LOGGEDOUT”]?agentLogin:addQueue)
exten => s,n(agentLogin),set(play=0)
exten => s,n,AgentCallbackLogin(${agentNum}||${CALLERID(NUM)})
exten => s,n(addQueue),AddQueueMember(${ARG1},Agent/${agentNum})
exten => s,n,UserEvent(Agentlogin,Agent: Agent/${agentNum}))
exten => s,n,GotoIf($[${play} = 1]?play)
exten => s,n,Hangup()
exten => s,n(play),playback(agent-loginok)
exten => s,n,hangup

exten => s,1,Answer
exten => s,n,Read(agentNum|agent-user|5||3|5) ; get callback number from user
exten => s,n,RemoveQueueMember(${ARG1},Agent/${agentNum})
exten => s,n,AgentCallbackLogin(${agentNum}||)
exten => s,n,UserEvent(RefreshQueue)
exten => s,n,Hangup()

Any comment or help is greatly appreciated.

Best regards.
Andres Maduro

Hello Andres,

“The problem I have (with both versions) is that agents log into the queues and they receive calls normally but after some time (5 days, 2 weeks, ans now hours), the system starts to behave erratically in which …agents logged in not receiving calls.”

I do have exactly the same problem with Asterisk 1.4.22-rc5 and FreePBX 2.5.1.
Did you find any solution ?

Thanks a lot for any feedback !


Hi Fabianus,

I am trying to enable agent login with Asterisk-1.4.18 but having only these warnings and following log-out procedure only.

– Executing [[email protected]:1] AgentCallbackLogin(“SIP/225-097bd918”, “||225”) in new stack
[Apr 16 13:43:10] WARNING[7831]: chan_agent.c:2313 callback_deprecated: AgentCallbackLogin is deprecated and will be removed in a future release.
[Apr 16 13:43:10] WARNING[7831]: chan_agent.c:2314 callback_deprecated: See doc/queues-with-callback-members.txt for an example of how to achieve
[Apr 16 13:43:10] WARNING[7831]: chan_agent.c:2315 callback_deprecated: the same functionality using only dialplan logic

Where this ext file mentioned in these logs are too messy and not giving any good information.

Please Suggest, how to implement agent callback login with Asterisk-1.4.x