1
General Asterisk configuration / Re: Everything works fine except "Real Time monitoring" (live works)
« on: September 29, 2009, 20:32:03 »Hello again!!
After what you asked me in the last post, I though: ok, so Realtime search the data in the queue_log file or mysql from the data in the queue_log file.
Then I googled I found that in Asterisk 1.2 the addmember function doesn't write in the queue_log when the agent logged in/off.
So I debugged for a while I found that the file: extensions.conf had the 900* function. Then based on the following website: http://astrecipes.net/index.php?from=100&q=astrecipes/managing+agents+that+dynamically+log-on , I added one extra line to the extensions.conf as follows:
[macro-agent-add]
exten => s,1,Wait(1)
exten => s,2,Macro(user-callerid,SKIPTTL)
exten => s,3,Read(CALLBACKNUM,agent-user) ; get callback number from user
exten => s,4,GotoIf($["${CALLBACKNUM}" = ""]?5:7) ; if user just pressed # or timed out, use cidnum
exten => s,5,Set(CALLBACKNUM=${CALLERID(number)})
exten => s,6,GotoIf($["${CALLBACKNUM}" = ""]?2) ; if still no number, start over
exten => s,7,GotoIf($["${ARG2}" = ""]?9:8 ) ; arg2 is queue password
exten => s,8,Authenticate(${ARG2})
exten => s,9,AddQueueMember(${ARG1}|Local/${CALLBACKNUM}@from-internal/n) ; using chan_local allows us to have agents over trunks
exten => s,10,UserEvent(Agentlogin|Agent: ${CALLBACKNUM})
exten => s,11,System( echo "${EPOCH}|${UNIQUEID}|${ARG1}|Agent/${CALLBACKNUM}|ADDMEMBER|-" >> /var/log/asterisk/queue_log ) <<<<---- I added this one
exten => s,12,Wait(1)
exten => s,13,Playback(agent-loginok)
exten => s,14,Hangup()
[macro-agent-del]
exten => s,1,Wait(1)
exten => s,2,Macro(user-callerid,SKIPTTL)
exten => s,3,Read(CALLBACKNUM,agent-user) ; get callback number from user
exten => s,4,GotoIf($["${CALLBACKNUM}" = ""]?5:7) ; if user just pressed # or timed out, use cidnum
exten => s,5,Set(CALLBACKNUM=${CALLERID(number)})
exten => s,6,GotoIf($["${CALLBACKNUM}" = ""]?2) ; if still no number, start over
exten => s,7,RemoveQueueMember(${ARG1}|Local/${CALLBACKNUM}@from-internal/n)
exten => s,8,UserEvent(RefreshQueue)
exten => s,9,Wait(1)
exten => s,10,Playback(agent-loggedoff)
exten => s,11,System( echo "${EPOCH}|${UNIQUEID}|${ARG1}|Agent/${CALLBACKNUM}|REMOVEMEMBER|-|${RV}" >> /var/log/asterisk/queue_log ) <<<---- And this one too
exten => s,12,Hangup()
Reloaded the configuration and it now shows info!!! Great!! Thanks a lot!!
So now, the things to resolve are, the queue doesn't appear as active in the queue list, it only appears when I press "Show all Queues", later some info missing from the agent list:
http://img210.imageshack.us/img210/1503/47845534.png
I really appreciate your help!
Thanks a lot in advance! Best Regards,
Teo