since v11.27
The CallBacklogHandler can be used to access calls within the backlog in the novomind iAGENT routing process. This handler is only available in the novomind iAGENT routing process.
An example usage of a CallBacklogHandler would look like this:
import javax.inject.Inject;
import com.novomind.ecom.api.iagent.backlog.TicketBacklogHandler;
import com.novomind.ecom.api.iagent.model.Category;
import com.novomind.ecom.api.imail.model.Ticket;
@Inject
private CallBacklogHandler callBacklogHandler;
public int getCallsQueuedCount(Category category, Location location, String language) {
return (int) callBacklogHandler.stream()
.filter(call -> category == null || category.equals(call.getCategory()))
.filter(call -> location == null || location.equals(call.getLocation().orElse(null)))
.filter(call -> language == null || language.equalsIgnoreCase(call.getLocale().map(Locale::getLanguage).orElse(null)))
.filter(callBacklogHandler.isRoutable())
.count();
}
public Optional<Call> getCall(String callId) {
return callBacklogHandler.getCall(callId);
}
public CallState getCallState(Call call) {
return callBacklogHandler.getCallState(call);
}