cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
690
Views
0
Helpful
2
Replies

Outgoing Call Statistics

Hello everyone, I'm a newbie on the topic of script creation, the idea is to read a database, call contacts and touch a prompt, all that works correctly, but the question is how can I measure the duration of that call ?, since the user can listen to part of the prompt and cut the call before it ends, so I need to measure how much time he heard, this is the script, please help him, thanks.script.png

2 Accepted Solutions

Accepted Solutions

Anthony Holloway
Cisco Employee
Cisco Employee
The simple answer is to use the On Exception Go-to step, for the ContactInactiveException handler, to catch when the contact disconnects, and then get the time with T[now]. Provided you also captured the time when the script entered the Successful branch, then you could subtract the two times to get the duration.

Keep in mind that Time objects are millisecond precise, and so you may need to convert it to seconds.

Eg
Set duration = (int) (end.getTime() - start.getTime()) / 1000

View solution in original post

Thank you very much, it works flawlessly, regards.

View solution in original post

2 Replies 2

Anthony Holloway
Cisco Employee
Cisco Employee
The simple answer is to use the On Exception Go-to step, for the ContactInactiveException handler, to catch when the contact disconnects, and then get the time with T[now]. Provided you also captured the time when the script entered the Successful branch, then you could subtract the two times to get the duration.

Keep in mind that Time objects are millisecond precise, and so you may need to convert it to seconds.

Eg
Set duration = (int) (end.getTime() - start.getTime()) / 1000

Thank you very much, it works flawlessly, regards.