Exemplo n.º 1
0
 @Override
 protected void handleResult(IqRequest iq) {
   final SessionCredit sessionCredit = getSessionCredit(iq.getResult());
   if (iq.getOriginalPacket() instanceof JingleIQ) {
     log.debug("Credit Value Received: " + iq.getResult().toXML());
     final CallSession session = sessionMapper.getSession((JingleIQ) iq.getOriginalPacket());
     if (session != null) {
       session.setSessionCredit(sessionCredit);
     }
   }
 }
Exemplo n.º 2
0
  @Override
  protected void handleError(IqRequest iqRequest) {
    log.error("Failed to Lock Credits: " + iqRequest.getResult().toXML());

    if (iqRequest.getOriginalPacket() instanceof JingleIQ) {
      final CallSession session =
          sessionMapper.getSession((JingleIQ) iqRequest.getOriginalPacket());
      if (session != null && session.getSessionCredit() != null) {
        log.warn("Forcing Call Credit for: " + iqRequest.getResult().toXML());
        final SessionCredit sessionCredit = new SessionCredit(SessionCredit.RouteType.pstn);
        session.setSessionCredit(sessionCredit);
      }
    }
  }
Exemplo n.º 3
0
 @Override
 public void receivedResult(IqRequest iqRequest) {
   if (iqRequest.getOriginalPacket() instanceof JingleIQ) {
     prepareStatesManager.prepareCall((JingleIQ) iqRequest.getOriginalPacket(), null);
   }
 }