protected void decodeMandatoryVariableBody(
     ISUPParameterFactory parameterFactory, byte[] parameterBody, int parameterIndex)
     throws ParameterException {
   switch (parameterIndex) {
     case _INDEX_V_RangeAndStatus:
       RangeAndStatus ras = parameterFactory.createRangeAndStatus();
       ((AbstractISUPParameter) ras).decode(parameterBody);
       this.setRangeAndStatus(ras);
       break;
     default:
       throw new ParameterException(
           "Unrecognized parameter index for mandatory variable part, index: " + parameterIndex);
   }
 }
 protected int decodeMandatoryParameters(
     ISUPParameterFactory parameterFactory, byte[] b, int index) throws ParameterException {
   int localIndex = index;
   index += super.decodeMandatoryParameters(parameterFactory, b, index);
   if (b.length - index > 1) {
     CircuitGroupSuperVisionMessageType cgsvmt =
         parameterFactory.createCircuitGroupSuperVisionMessageType();
     ((AbstractISUPParameter) cgsvmt).decode(new byte[] {b[index]});
     this.setSupervisionType(cgsvmt);
     index++;
     return index - localIndex;
   } else {
     throw new IllegalArgumentException("byte[] must have atleast one octets");
   }
 }
Exemplo n.º 3
0
  /*
   * (non-Javadoc)
   *
   * @see org.mobicents.protocols.ss7.isup.ISUPMessageImpl#decodeMandatoryParameters (byte[], int)
   */
  protected int decodeMandatoryParameters(
      ISUPParameterFactory parameterFactory, byte[] b, int index) throws ParameterException {
    int localIndex = index;
    index += super.decodeMandatoryParameters(parameterFactory, b, index);
    if (b.length - index > 1) {

      try {
        byte[] informationInd = new byte[2];
        informationInd[0] = b[index++];
        informationInd[1] = b[index++];
        InformationIndicators bci = parameterFactory.createInformationIndicators();
        ((AbstractISUPParameter) bci).decode(informationInd);
        this.setInformationIndicators(bci);
      } catch (Exception e) {
        // AIOOBE or IllegalArg
        throw new ParameterException("Failed to parse BackwardCallIndicators due to: ", e);
      }

      // return 3;
      return index - localIndex;
    } else {
      throw new IllegalArgumentException("byte[] must have atleast 2 octets");
    }
  }
Exemplo n.º 4
0
  protected void decodeOptionalBody(
      ISUPParameterFactory parameterFactory, byte[] parameterBody, byte parameterCode)
      throws ParameterException {
    switch (parameterCode & 0xFF) {
      case CallingPartyCategory._PARAMETER_CODE:
        CallingPartyCategory RS = parameterFactory.createCallingPartyCategory();
        ((AbstractISUPParameter) RS).decode(parameterBody);
        this.setCallingPartyCategory(RS);
        break;
      case CallingPartyNumber._PARAMETER_CODE:
        CallingPartyNumber x = parameterFactory.createCallingPartyNumber();
        ((AbstractISUPParameter) x).decode(parameterBody);
        this.setCallingPartyNumber(x);
        break;
      case CallReference._PARAMETER_CODE:
        CallReference cf = parameterFactory.createCallReference();
        ((AbstractISUPParameter) cf).decode(parameterBody);
        this.setCallReference(cf);
        break;
      case ConnectionRequest._PARAMETER_CODE:
        ConnectionRequest z = parameterFactory.createConnectionRequest();
        ((AbstractISUPParameter) z).decode(parameterBody);
        this.setConnectionRequest(z);
        break;
      case ParameterCompatibilityInformation._PARAMETER_CODE:
        ParameterCompatibilityInformation cc =
            parameterFactory.createParameterCompatibilityInformation();
        ((AbstractISUPParameter) cc).decode(parameterBody);
        this.setParameterCompatibilityInformation(cc);
        break;
      case NetworkSpecificFacility._PARAMETER_CODE:
        NetworkSpecificFacility v = parameterFactory.createNetworkSpecificFacility();
        ((AbstractISUPParameter) v).decode(parameterBody);
        this.setNetworkSpecificFacility(v);
        break;

      default:
        throw new ParameterException(
            "Unrecognized parameter code for optional part: " + parameterCode);
    }
  }