コード例 #1
0
 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());
   }
 }
コード例 #2
0
 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());
   }
 }
コード例 #3
0
 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());
   }
 }
コード例 #4
0
 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());
   }
 }
コード例 #5
0
 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());
   }
 }
コード例 #6
0
 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());
   }
 }
コード例 #7
0
 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());
   }
 }
コード例 #8
0
 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());
   }
 }