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.<br>
<br>I'm not even entirely sure what to call it in FreeSwitch lingo - so that would be a good starting point :-) (Media-duration maybe?)<br>
<br>
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<br><br>The info application gives several useful looking variables like:<br>Caller-Channel-Progress-Media-Time<br>
Caller-Channel-Transfer-Time<br>...but they're still set to zero.<br><br>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.<br>
<br>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:<br> exten => s,n,Macro(Dial_Attempted)<br> exten => s,n,Dial(SIP/1001,20,M(Dial_Succeeded)) <br>
exten => s,n,Macro(Dial_Failed) ;Only gets here if the Dial didn't connect.<br><br>Is there any way to do this in FreeSwitch?<br><br clear="all">Cheers,<br>Fraser<br><br><br>