[Freeswitch-users] How long did the phone ring?

Fraser Redmond fraserredmond at gmail.com
Tue Mar 16 15:21:45 PDT 2010

I'm converting a call-center app from Asterisk to FreeSwitch (using xml and
javascript dialplans) and I think I've worked out how to do nearly
everything, except for tracking one important metric: How long the phone
rang before an agent picked it up.

I'm not even entirely sure what to call it in FreeSwitch lingo - so that
would be a good starting point :-)  (Media-duration maybe?)

I can work out the length of ringing for calls that didn't connect, by
logging when the bridge is attempted, and after it fails and comparing the
time. But if the person being called picks up, then all I know from that is
the total length of the call including the ringing/media time, not the media
time and connected time as 2 separate values

The info application gives several useful looking variables like:
...but they're still set to zero.

I thought I might be able to subtract  Caller-Channel-Created-Time  from
Caller-Channel-Answered-Time  to get the milliseconds of how long the phone
rang for - but there's no reliable correlation between the difference and
how long the phone rang.

In asterisk I achieved this by logging when I was about to make a call, then
running a macro when the Dial() connected, like so:
    exten => s,n,Macro(Dial_Attempted)
    exten => s,n,Dial(SIP/1001,20,M(Dial_Succeeded))
    exten => s,n,Macro(Dial_Failed)  ;Only gets here if the Dial didn't

Is there any way to do this in FreeSwitch?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20100316/613af644/attachment-0002.html 

More information about the FreeSWITCH-users mailing list