Map<String, String> prompt(String id, PromptStruct prompt)
     throws TropoException, SystemException {
   setLogContext(null);
   Call call = getCall(id);
   try {
     Map<String, String> result =
         call.prompt(
             prompt.getTtsOrUrl(),
             prompt.isBargein(),
             prompt.getGrammar(),
             prompt.getConfidence(),
             prompt.getMode(),
             prompt.getWait());
     // System.out.println(result);
     if (LOG.isDebugEnabled()) {
       LOG.debug(result.toString());
     }
     return result;
   } catch (ErrorException e) {
     System.out.println(e.toString());
     throw new TropoException(e.toString());
   } catch (FatalException e) {
     throw new SystemException(e.toString());
   }
 }
 void block(String id, int timeout) throws TropoException, SystemException {
   setLogContext(null);
   Call call = getCall(id);
   try {
     call.block(timeout);
   } catch (ErrorException e) {
     throw new TropoException(e.toString());
   } catch (FatalException e) {
     throw new SystemException(e.toString());
   }
 }
 void log(String id, String msg) throws TropoException, SystemException {
   setLogContext(null);
   Call call = getCall(id);
   try {
     call.log(msg);
   } catch (ErrorException e) {
     throw new TropoException(e.toString());
   } catch (FatalException e) {
     throw new SystemException(e.toString());
   }
 }
 HangupStruct hangup(String id) throws TropoException, SystemException {
   setLogContext(null);
   Call call = getCall(id);
   try {
     call.hangup();
     return new HangupStruct(); // TODO:
   } catch (ErrorException e) {
     throw new TropoException(e.toString());
   } catch (FatalException e) {
     throw new SystemException(e.toString());
   }
 }
 void redirect(String id, String number) throws TropoException, SystemException {
   setLogContext(null);
   Call call = getCall(id);
   try {
     ((IncomingCall) call).redirect(number);
   } catch (ClassCastException e) {
     throw new TropoException(call + " can not be answered.");
   } catch (ErrorException e) {
     throw new TropoException(e.toString());
   } catch (FatalException e) {
     throw new SystemException(e.toString());
   }
 }
 void stopCallRecording(String id) throws TropoException, SystemException {
   setLogContext(null);
   Call call = getCall(id);
   try {
     ((IncomingCall) call).stopCallRecording();
   } catch (ClassCastException e) {
     throw new TropoException(call + " can not be stopCallRecording.");
   } catch (ErrorException e) {
     throw new TropoException(e.toString());
   } catch (FatalException e) {
     throw new SystemException(e.toString());
   }
 }
 void startCallRecording(
     String id, String filenameOrUrl, String format, String publicKey, String publicKeyUri)
     throws TropoException, SystemException {
   setLogContext(null);
   Call call = getCall(id);
   try {
     ((IncomingCall) call).startCallRecording(filenameOrUrl, format, publicKey, publicKeyUri);
   } catch (ClassCastException e) {
     throw new TropoException(call + " can not be startCallRecording.");
   } catch (ErrorException e) {
     throw new TropoException(e.toString());
   } catch (FatalException e) {
     throw new SystemException(e.toString());
   }
 }
 CallImpl transfer(String id, TransferStruct t) throws TropoException, SystemException {
   setLogContext(null);
   Call call = getCall(id);
   try {
     return (CallImpl)
         call.transfer(
             t.getTo(),
             t.getFrom(),
             t.isAnswerOnMedia(),
             t.getTimeout(),
             t.getTtsOrUrl(),
             t.getRepeat(),
             t.getGrammar());
   } catch (ErrorException e) {
     throw new TropoException(e.toString());
   } catch (FatalException e) {
     throw new SystemException(e.toString());
   }
 }