CallImpl call(
     String from,
     String to,
     boolean answerOnMedia,
     int timeout,
     String recordUri,
     String recordFormat)
     throws TropoException, SystemException {
   setLogContext(null);
   SipApplicationSession appSession = getSipFactory().createApplicationSession();
   SimpleCallFactory factory = new SimpleCallFactory(this, appSession);
   appSession.setAttribute(CALL_FACTORY, factory);
   CallImpl call = factory.call(from, to, answerOnMedia, timeout, recordUri, recordFormat);
   _calls.put(call.getId(), call);
   return call;
 }
 protected void _execute(SipServletRequest invite)
     throws TException, TropoException, SystemException, AuthenticationException {
   SipApplicationSession appSession = invite.getApplicationSession();
   SimpleCallFactory factory = new SimpleCallFactory(this, appSession);
   appSession.setAttribute(CALL_FACTORY, factory);
   CallImpl call = new SimpleIncomingCall(factory, invite, this);
   LOG.info("Alerting " + this + " for incoming " + call);
   AlertStruct alert =
       new AlertStruct(
           call.getId(),
           getApplicationID(),
           call.getCallerId(),
           call.getCallerName(),
           call.getCalledId(),
           call.getCalledName());
   if (LOG.isDebugEnabled()) {
     LOG.debug("Sending AlertStruct:" + alert.toString());
   }
   _calls.put(call.getId(), call);
   getNotifier().alert(_token, alert);
 }