public boolean onEvent(Event event) {
   System.out.println(event.toString());
   if (event.getEventType() == EventType.CALL
       && event.getCallHandle().equals(waitingForCallHandle)
       && event.getEventCode() == waitingForCallCode
       && event.getEventReason() == waitingForCallReason) {
     callSignal.notifyResponseEvent();
   }
   return false;
 }
  private boolean waitForCallEvent(
      String callHandle, EventCode code, EventReason reason, long timeout) {
    callSignal = new Signal();
    boolean ret = false;

    waitingForCallHandle = callHandle;
    waitingForCallCode = code;
    waitingForCallReason = reason;
    ret = callSignal.waitForSignal(timeout);
    return ret;
  }