There is always one colleague in the group who is never answering group calls! Does this sound familiar to you?
When connecting a call to a group it depends on the group configuration, how the call will be signaled to the group members:
- Parallel - all phones of all members ring simultaneously
- Random - one member is picked randomly from the group
- Rotary - the first call goes to member 1, the second call to member 2, a.s.o.
- Sequential - the call goes to member 1, if member one is not available (timeout, busy, not logged in) it goes to member 2, if member 2 is not available it goes to member 3, a.s.o. The next new call will go first to member one
In many cases these hunt group selections are sufficient, but there is one selection missing in the list which is getting asked for every once in a while: Longest Waiting/Idle
The call routing of the SwyxWare wouldn't be the call rouging if this problem couldn't be fixed in there
What is needed is a reliable source of information when a certain user had is latest call (disconnect time). This information can be taken from the call detail records. For the ease of usage, they need to be written into a database instead of a text file (refer to KB article Write Call Details Records into a database (kb2491)). Without going too much into details, we will add a small trigger onto this table. This trigger will be called for every newly added record, takes user name and disconnect time from it and stores it also into an additional table "LongestWaiting" into the database. When it is necessary to know when a certain user had his latest disconnect, one only needs to look into "LongestWaiting" table.
We use a small GSE Action (comparable with a function in any programming language, it is just "written" with the GSE).
This GSE Action takes the group the call should be connected to as parameter (refer to my blog article #6: Make it easy!). It uses the GetUserByAddress method of the PBXConfig Server Script API to resolve all users from the given group. With the list of users the database (LongestWaiting" table will be queried to get a list of all users in the order of old disconnect time first. The GSE Action tries now to connect the call to the users in the list, starting with the first one. If this user is not available (timeout, busy, not logged in) it goes on with the second in the list, a.s.o.. It goes on until the call is either connected or the call wasn't taken by any user.
The usage of this GSE Action is actually quite simple, it replaces the standard "Connect To" block
The GSE action takes a few parameters, with the "Destination" being the most important one. This is the group which the call should be delivered to with the new "longest waiting/idle" hunt group type.
PS: don't miss to take a look into the ECR Useful Link Collection