@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);
     }
   }
 }
  @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);
      }
    }
  }
 @Override
 public void receivedResult(IqRequest iqRequest) {
   if (iqRequest.getOriginalPacket() instanceof JingleIQ) {
     prepareStatesManager.prepareCall((JingleIQ) iqRequest.getOriginalPacket(), null);
   }
 }