[asterisk-users] Can asterisk record the duration of usersputting on hold?

Alexander Lopez Alex.Lopez at OpSys.com
Fri Apr 27 09:42:10 MST 2007


Cross posted from -users to -dev

I was looking at adding this functionality in last night.

I saw that in app_queue when a call is bridged it determines hold time.

Using the following:

holdtime = abs((now - qe->start) / 60);

and for queue.log the following:

(long) (callstart - qe->start)


My thoughts were that adding a timer to the hold in res_musiconhold
would allow us to calculate hold time while still being channel
agnostic.

Under the function of moh_alloc()

Do something like:
chan->holdtimestart = time_t


and under  moh_release()

chan->holdtimeend = time_t
chan->holdtimelast = (chan->holdtimeend - chan->holdtimestart)
chan->holdtime = chan->holdtime + chan->holdtimelast

chan->holdfreq = chan->holdfreq + 1


This would allow for a call to be placed on hold and have that time
addeded up as well as keep track of how many time a call was place on
hold.

It could then be reported as $CDR(callholdtime), this would be separate
from the value from app_queue or it could be inherited and then if an
agent placed a caller on hold it would add it in to the final number,
However being on hold 'waiting' to talk to an agent and being on hold
after an agent answers is two different values and should remain as
such.


Any thoughts

> -----Original Message-----
> From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-
> bounces at lists.digium.com] On Behalf Of Humberto Figuera
> Sent: Thursday, April 26, 2007 3:18 PM
> To: Asterisk Users Mailing List - Non-Commercial Discussion
> Subject: Re: [asterisk-users] Can asterisk record the duration of
> usersputting on hold?
> 
> Hi Xue Liangliang,
> 
> If you use queue's then look in queue_log
> 
> http://www.voip-info.org/wiki/index.php?page=Asterisk+log+queue_log
> 
> the COMPLETEAGENT and COMPLETECALLER events have this information.
> 
> COMPLETEAGENT(holdtime|calltime|origposition)
> The caller was connected to an agent, and the call was terminated
normally
> by the *agent*. The caller's hold time and the length of the call are
both
> recorded. The caller's original position in the queue is recorded in
> origposition.
> 
> COMPLETECALLER(holdtime|calltime|origposition)
> The caller was connected to an agent, and the call was terminated
normally
> by the *caller*. The caller's hold time and the length of the call are
> both
> recorded. The caller's original position in the queue is recorded in
> origposition.
> 
> 
> --
> Humberto Figuera - Using Linux 2.6.20
> Usuario GNU/Linux 369709
> Caracas - Venezuela
> GPG Key Fingerprint = 5AAC DF0C 00F4 2834 28BA  37AD 3364 01D1 74CA
0603
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
> 
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users


More information about the asterisk-users mailing list