public class ActiveCallsFunction extends ScriptableFunction {
public static final String NAME = "activeCalls";
/* override */
public Object invoke(final Object thiz, final Object[] args) throws Exception {
PhoneCall activeCall = null;
// If active calls hash is empty and there is an active call
// probably it happen when
// the app wasn't running so add this call to the hash
if (_activeCalls.isEmpty() && (activeCall = Phone.getActiveCall()) != null) {
addActiveCall(activeCall.getCallId());
}
final Object[] activeCalls = new Object[_activeCalls.size()];
final Enumeration e = _activeCalls.elements();