Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - jf647

Pages: [1]
1
I am having a problem where my agent sessions are being doubled up in reports.

I am using QM 1.4.0

This is from my agent session detail for yesterday for agent #1405:

1405 -    08/13 - 8:33:21   08/13 - 9:51:54   1:18:33             12   13:13     
1405 -  08/13 - 8:33:21   08/13 - 9:51:54   1:18:33             0   0:00     
1405 -  08/13 - 9:55:37   08/13 - 14:50:41   4:55:04             28   1:07:54     
1405 -  08/13 - 9:55:37   08/13 - 14:50:41   4:55:04             0   0:00     
1405 -    08/13 - 14:50:41   08/13 - 16:24:34   1:33:53             7   35:39     
1405 -  08/13 - 14:50:41   08/13 - 16:24:34   1:33:53             0   0:00     

In my queue log, there are only three sessions for this agent (I've translated the epoch times for convenience):

Mon Aug 13 08:33:21 2007|NONE|NONE|SIP/1405|AGENTLOGIN|-
Mon Aug 13 09:51:54 2007|NONE|NONE|SIP/1405|AGENTLOGOFF|-|4713
Mon Aug 13 09:55:37 2007|NONE|NONE|SIP/1405|AGENTLOGIN|-
Mon Aug 13 14:50:41 2007|NONE|NONE|SIP/1405|AGENTLOGOFF|-|17704
Mon Aug 13 14:50:41 2007|NONE|NONE|SIP/1405|AGENTLOGIN|-
Mon Aug 13 16:24:34 2007|NONE|NONE|SIP/1405|AGENTLOGOFF|-|5633

I am using agent log on and log off from the QM agent control page.  I am not using AgentCallbackLogin - we use dynamic members here.  When an agent logs on/off or pauses/unpauses, an AGI script is run.

On agent login, I:

$agi->exec("QueueLog", "NONE|NONE|SIP/$agent_id|AGENTLOGIN|-");

Then for each queue they are supposed to be answering, I:

$agi->exec("AddQueueMember", "$queue|SIP/$agent_id|$penalty||SIP/$agent_id");

On logoff, I:

$agi->exec("RemoveQueueMember", $queue->queue_name."|SIP/$agent_id");

for each queue they are a member of, then:

$agi->exec("QueueLog", "NONE|NONE|SIP/$agent_id|AGENTLOGOFF|-|$duration");

For pause, I:

$agi->exec("PauseQueueMember", "|SIP/".$agent->id);

then

$agi->exec("QueueLog", "NONE|NONE|SIP/".$agent->id."|PAUSEREASON|$opts{pausereason}");

and for unpause, I:

$agi->exec("UnpauseQueueMember", "|SIP/".$agent->id);

A snippet of a pause/unpause cycle for this agent is:

Mon Aug 13 09:55:37 2007|NONE|NONE|SIP/1405|AGENTLOGIN|-
Mon Aug 13 09:55:37 2007|1187013337.32126|cs_billing|SIP/1405|ADDMEMBER|
Mon Aug 13 09:55:37 2007|1187013337.32126|cs_ld|SIP/1405|ADDMEMBER|
Mon Aug 13 09:55:37 2007|1187013337.32126|cs_inquiries|SIP/1405|ADDMEMBER|
Mon Aug 13 09:55:49 2007|1187013295.32116|cs_inquiries|SIP/1405|CONNECT|30|1187013343.32133
Mon Aug 13 09:56:41 2007|1187013295.32116|cs_inquiries|SIP/1405|TRANSFER|7205|from-internal-nccc|30|52
Mon Aug 13 09:56:42 2007|NONE|NONE|SIP/1405|PAUSEALL|
Mon Aug 13 09:56:42 2007|NONE|cs_ld|SIP/1405|PAUSE|
Mon Aug 13 09:56:42 2007|NONE|cs_billing|SIP/1405|PAUSE|
Mon Aug 13 09:56:42 2007|NONE|cs_inquiries|SIP/1405|PAUSE|
Mon Aug 13 09:56:42 2007|NONE|NONE|SIP/1405|PAUSEREASON|30
Mon Aug 13 09:57:27 2007|NONE|NONE|SIP/1405|UNPAUSEALL|
Mon Aug 13 09:57:27 2007|NONE|cs_ld|SIP/1405|UNPAUSE|
Mon Aug 13 09:57:27 2007|NONE|cs_billing|SIP/1405|UNPAUSE|
Mon Aug 13 09:57:27 2007|NONE|cs_inquiries|SIP/1405|UNPAUSE|
[...]
Mon Aug 13 14:50:41 2007|1187031040.37406|cs_inquiries|SIP/1405|REMOVEMEMBER|
Mon Aug 13 14:50:41 2007|1187031040.37406|cs_ld|SIP/1405|REMOVEMEMBER|
Mon Aug 13 14:50:41 2007|1187031040.37406|cs_billing|SIP/1405|REMOVEMEMBER|
Mon Aug 13 14:50:41 2007|NONE|NONE|SIP/1405|AGENTLOGOFF|-|17704
Mon Aug 13 09:57:27 2007|NONE|cs_ld|SIP/1405|UNPAUSE|
Mon Aug 13 09:57:27 2007|NONE|cs_billing|SIP/1405|UNPAUSE|
Mon Aug 13 09:57:27 2007|NONE|cs_inquiries|SIP/1405|UNPAUSE|

(the section with the ellipsis consists of calls, then pauseall, pausereason, unpauseall)

I've scrutinized the extension examples that come with QM 1.4.0, and the only thing I seem to be doing differently is that my PAUSEREASON lines do not have a uniqueid in them.  But I can't see how this would cause sessions to be completely duplicated.

I do notice that when each session gets duplicated, one shows the correct number of pauses, whereas the other one shows zero pauses.

Can you suggest how to diagnose this?  It's making my reports useless, as the agent availability time and total agent time (which are important metrics for my users) is nearly double what it should be.

Thanks

2
Improving QueueMetrics / Show Pause Reason on Realtime page
« on: August 14, 2007, 16:55:46 »
Several of my users have remarked that it would be helpful if the pause reason were displayed on the realtime page in addition to the time that the user went on pause.

3
Ok, here's my reimplementation of queueDial.agi in AEL:

Code: [Select]
macro qmoutqdial( clid, dialstring, queue, agent )
{

        start_dial_time = ${EPOCH};
        QueueLog(${queue}|${UNIQUEID}|NONE|ENTERQUEUE||${clid});
        Dial(${dialstring},,gtWM(queuelog_connect_event^${queue}^${UNIQUEID}^${agent}^${start_dial_time}));
        end_dial_time = ${EPOCH};
        verb = COMPLETECALLER;
        Hangup;
        catch h {
                if( ${ISNULL(${end_dial_time})} ) {
                        end_dial_time = ${EPOCH};
                }
                switch(${DIALSTATUS}) {
                        case BUSY:
                        case NOANSWER:
                        case CHANUNAVAIL:
                        case CONGESTION:
                        case CANCEL:
                                wait_time = ${end_dial_time} - ${start_dial_time};
                                verb = ABANDON;
                                QueueLog(${queue}|${UNIQUEID}|NONE|ABANDON|1|1|${wait_time});
                                break;
                        case ANSWER:
                                wait_time = ${end_dial_time} - ${start_dial_time} - ${ANSWEREDTIME};
                                if( ${ISNULL(${verb})} ) {
                                        verb = COMPLETEAGENT;
                                }
                                QueueLog(${queue}|${UNIQUEID}|${agent}|${verb}|${wait_time}|${ANSWEREDTIME});
                                break;
                        default:
                                NoOp(don't know how to handle ${DIALSTATUS});
                                break;
                }
        }

}

macro queuelog_connect_event( queue, uniqueid, agent, start_dial_time )
{

        wait_time = ${EPOCH} - ${start_dial_time};
        QueueLog(${queue}|${uniqueid}|${agent}|CONNECT|${wait_time});

}

I have tested this with three types of calls typically made via the AGI script:

- agent hangs up before call connects
- call connects and agent hangs up
- call connects and caller hangs up

and it seems to work.

For those of you running 1.2 without the AEL2 patch, this is what it compiles to in extensions.conf format.  This is the functional equivalent, but as it's the deparsed output from what the above AEL compiles to, it's not meant to be pretty:

Code: [Select]
[macro-qmoutqdial]
exten => s,1,Set(clid=${ARG1})
exten => s,2,Set(dialstring=${ARG2})
exten => s,3,Set(queue=${ARG3})
exten => s,4,Set(agent=${ARG4})
exten => s,5,Set(start_dial_time=$[${EPOCH}])
exten => s,6,QueueLog(${queue}|${UNIQUEID}|NONE|ENTERQUEUE||${clid})
exten => s,7,Dial(${dialstring}||gtWM(queuelog_connect_event^${queue}^${UNIQUEID}^${agent}^${start_dial_time}))
exten => s,8,Set(end_dial_time=$[${EPOCH}])
exten => s,9,Set(verb=$[COMPLETECALLER])
exten => s,10,Hangup()
exten => h,1,GotoIf($[${ISNULL(${end_dial_time})} ]?2:3)
exten => h,2,Set(end_dial_time=$[${EPOCH}])
exten => h,3,NoOp(Finish if-catch-h-1-2)
exten => h,4,Goto(sw-3-${DIALSTATUS}|10)
exten => h,5,NoOp(Finish switch-catch-h-1-3)
exten => _sw-3-.,10,NoOp(don't know how to handle ${DIALSTATUS})
exten => _sw-3-.,11,Goto(h|5)
exten => sw-3-ANSWER,10,Set(wait_time=$[${end_dial_time} - ${start_dial_time} - ${ANSWEREDTIME}])
exten => sw-3-ANSWER,11,GotoIf($[${ISNULL(${verb})} ]?12:13)
exten => sw-3-ANSWER,12,Set(verb=$[COMPLETEAGENT])
exten => sw-3-ANSWER,13,NoOp(Finish if-sw-catch-h-1-ANSWER-3-4)
exten => sw-3-ANSWER,14,QueueLog(${queue}|${UNIQUEID}|${agent}|${verb}|${wait_time}|${ANSWEREDTIME})
exten => sw-3-ANSWER,15,Goto(h|5)
exten => sw-3-CANCEL,10,Set(wait_time=$[${end_dial_time} - ${start_dial_time}])
exten => sw-3-CANCEL,11,Set(verb=$[ABANDON])
exten => sw-3-CANCEL,12,QueueLog(${queue}|${UNIQUEID}|NONE|ABANDON|1|1|${wait_time})
exten => sw-3-CANCEL,13,Goto(h|5)
exten => sw-3-CONGESTION,10,Goto(sw-3-CANCEL|10)
exten => sw-3-CHANUNAVAIL,10,Goto(sw-3-CONGESTION|10)
exten => sw-3-NOANSWER,10,Goto(sw-3-CHANUNAVAIL|10)
exten => sw-3-BUSY,10,Goto(sw-3-NOANSWER|10)


[macro-queuelog_connect_event]
exten => s,1,Set(queue=${ARG1})
exten => s,2,Set(uniqueid=${ARG2})
exten => s,3,Set(agent=${ARG3})
exten => s,4,Set(start_dial_time=${ARG4})
exten => s,5,Set(wait_time=$[${EPOCH} - ${start_dial_time}])
exten => s,6,QueueLog(${queue}|${uniqueid}|${agent}|CONNECT|${wait_time})

I hope others find this useful and that it maybe makes it into QM as an alternative to queueDial.agi.  I must admit that I was never a fan of forking a process for every outbound call.

Regards

4
I've re-implemented queueDial.agi using AEL.  I need to clean it up a bit, then I'll post it here.

5
The QM docs indicate to run queueDial.agi like this:

exten   => s,n,DeadAGI(queueDial.agi|${ARG3}|${ARG2}|${QMOUTQDIAL}|${CUT(CHANNEL,,1)})

Asterisk 1.4.8 came out yesterday, and the changelog indicates that this is not recommended:

2007-07-17 20:33 +0000 [r75437]  Russell Bryant <russell@digium.com>

        * res/res_agi.c: (issue #10210) Reported by: juggie Patches:
          10210-1.4-grr.patch uploaded by juggie (license #24) Tested by:
          juggie, blitzrage Log a warning if someone uses DeadAGI on a live
          channel.

And now this appears on my console and in my logs when I use the above dialplan snippet:

    -- Executing [s@macro-dialout:21] DeadAGI("SIP/491-98cc7860", "queueDial.agi|416XXXXXXX|Zap/R3/416XXXXXXX|cs_out|SIP/491") in new stack
[Jul 18 08:04:01] WARNING[29182]: res_agi.c:2086 deadagi_exec: Running DeadAGI on a live channel will cause problems, please use AGI
    -- Launched AGI Script /var/lib/asterisk/agi-bin/queueDial.agi

So what should I change?  If I switch to AGI, then nothing gets logged after the CONNECT event - if I hang up while the other end is ringing, I see no ABANDON event, and if I hang up after talking with the other end, no COMPLETEAGENT event is seen.

This means that I'm now going to have outbound calls that never end, right?

1.4.8 is required due to four critical security advisories that were posted to asterisk-users yesterday, so not upgrading isn't viable.

This is the change that seemed to prompt them to add the warning:

2007-07-17 20:01 +0000 [r75401-75403]  Russell Bryant <russell@digium.com>

        * main/pbx.c: (closes issue #10209) Reported by: juggie Patches:
          10209-trunk-2.patch uploaded by juggie Tested by: juggie,
          blitzrage In ast_pbx_run(), mark a channel as hung up after an
          application returned -1, or when it runs out of extensions to
          execute. This is so that code can detect that this channel has
          been hung up for things like making sure DeadAGI is used on
          actual dead channels, and is beneficial for other things, like
          making sure someone doesn't try to start spying on a channel that
          is about to go away.

Here's a link to the bug that this change fixed: http://bugs.digium.com/view.php?id=10209


6
QM is on a different server from *, so I can't use spool files.

And yes, the context is set up, but I can't see how that would make any difference as QueueMetrics is not giving me an icon to start the monitoring process.  If the context was missing or misconfigured, I'd be seeing an icon that failed to do what I expected when I clicked on it.

To be clear: if I use wireshark to capture traffic on port 5038 between the QM server and Asterisk, I get *nothing* from the time I log into QM to the time I log out.

7
I can't seem to get QM to show any icon to click on to make the live call montoring feature work.  (The instructions in the manual are pretty vague - a screenshot would do wonders here)

My user is in the ADMIN class, which has the MON_AUDIO key (unchanged from installation)

A snippet from configuration.properties:

callfile.dir=tcp:queuemetrics:password@serverhostname
callfile.monitoring.enabled=true
callfile.monitoring.channel=Local/$EM@queuemetrics/n
callfile.monitoring.extension=11
callfile.monitoring.context=queuemetrics

I see no icon or anything to click on on the realtime page to start monitoring.  I've restarted QueueMetrics several times.

Is there a more verbose guide explaining how to get this working?

Thanks

Pages: [1]