Beispiel #1
0
        public void TestNumberInfo(string number, string expectedValue, PhoneFlags flags, NAIFlags naiFlags)
        {
            var cp = new CalledNumber {
                Number = number
            };

            cp.Flags          = flags;
            cp.NumberingFlags = naiFlags;

            Assert.AreEqual(expectedValue.ToUpperInvariant(), cp.ToHex());
        }
Beispiel #2
0
        public void TestCalledNumberIsNull()
        {
            var c = new CalledNumber();

            Assert.Throws <InvalidOperationException>(() => c.ToHex());

            var isupPhone = new IsupPhoneNumberParameter(IsupParameterType.CallingPartyNumber);

            Assert.Throws <InvalidOperationException>(() => isupPhone.ToHex());

            return;
        }
    public override int GetHashCode()
    {
        int hashcode = 157;

        unchecked {
            if (__isset.type)
            {
                hashcode = (hashcode * 397) + Type.GetHashCode();
            }
            if (__isset.dialedNumber)
            {
                hashcode = (hashcode * 397) + DialedNumber.GetHashCode();
            }
            if (__isset.serviceDomain)
            {
                hashcode = (hashcode * 397) + ServiceDomain.GetHashCode();
            }
            if (__isset.productType)
            {
                hashcode = (hashcode * 397) + ProductType.GetHashCode();
            }
            if (__isset.productName)
            {
                hashcode = (hashcode * 397) + ProductName.GetHashCode();
            }
            if (__isset.multipleProduct)
            {
                hashcode = (hashcode * 397) + MultipleProduct.GetHashCode();
            }
            if (__isset.callerIdStatus)
            {
                hashcode = (hashcode * 397) + CallerIdStatus.GetHashCode();
            }
            if (__isset.balance)
            {
                hashcode = (hashcode * 397) + Balance.GetHashCode();
            }
            if (__isset.unit)
            {
                hashcode = (hashcode * 397) + Unit.GetHashCode();
            }
            if (__isset.rate)
            {
                hashcode = (hashcode * 397) + Rate.GetHashCode();
            }
            if (__isset.displayCode)
            {
                hashcode = (hashcode * 397) + DisplayCode.GetHashCode();
            }
            if (__isset.calledNumber)
            {
                hashcode = (hashcode * 397) + CalledNumber.GetHashCode();
            }
            if (__isset.calleeNationalNumber)
            {
                hashcode = (hashcode * 397) + CalleeNationalNumber.GetHashCode();
            }
            if (__isset.calleeCallingCode)
            {
                hashcode = (hashcode * 397) + CalleeCallingCode.GetHashCode();
            }
            if (__isset.rateDivision)
            {
                hashcode = (hashcode * 397) + RateDivision.GetHashCode();
            }
            if (__isset.adMaxMin)
            {
                hashcode = (hashcode * 397) + AdMaxMin.GetHashCode();
            }
            if (__isset.adRemains)
            {
                hashcode = (hashcode * 397) + AdRemains.GetHashCode();
            }
            if (__isset.adSessionId)
            {
                hashcode = (hashcode * 397) + AdSessionId.GetHashCode();
            }
        }
        return(hashcode);
    }
Beispiel #4
0
    public override string ToString()
    {
        var  sb      = new StringBuilder("PaidCallHistory(");
        bool __first = true;

        if (__isset.seq)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Seq: ");
            Seq.ToString(sb);
        }
        if (__isset.type)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Type: ");
            Type.ToString(sb);
        }
        if (DialedNumber != null && __isset.dialedNumber)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("DialedNumber: ");
            DialedNumber.ToString(sb);
        }
        if (CalledNumber != null && __isset.calledNumber)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("CalledNumber: ");
            CalledNumber.ToString(sb);
        }
        if (ToMid != null && __isset.toMid)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("ToMid: ");
            ToMid.ToString(sb);
        }
        if (ToName != null && __isset.toName)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("ToName: ");
            ToName.ToString(sb);
        }
        if (__isset.setupTime)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("SetupTime: ");
            SetupTime.ToString(sb);
        }
        if (__isset.startTime)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("StartTime: ");
            StartTime.ToString(sb);
        }
        if (__isset.endTime)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("EndTime: ");
            EndTime.ToString(sb);
        }
        if (__isset.duration)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Duration: ");
            Duration.ToString(sb);
        }
        if (__isset.terminate)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Terminate: ");
            Terminate.ToString(sb);
        }
        if (__isset.productType)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("ProductType: ");
            ProductType.ToString(sb);
        }
        if (__isset.charge)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Charge: ");
            Charge.ToString(sb);
        }
        if (Unit != null && __isset.unit)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Unit: ");
            Unit.ToString(sb);
        }
        if (Result != null && __isset.result)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Result: ");
            Result.ToString(sb);
        }
        sb.Append(")");
        return(sb.ToString());
    }
Beispiel #5
0
    public override int GetHashCode()
    {
        int hashcode = 157;

        unchecked {
            if (__isset.seq)
            {
                hashcode = (hashcode * 397) + Seq.GetHashCode();
            }
            if (__isset.type)
            {
                hashcode = (hashcode * 397) + Type.GetHashCode();
            }
            if (__isset.dialedNumber)
            {
                hashcode = (hashcode * 397) + DialedNumber.GetHashCode();
            }
            if (__isset.calledNumber)
            {
                hashcode = (hashcode * 397) + CalledNumber.GetHashCode();
            }
            if (__isset.toMid)
            {
                hashcode = (hashcode * 397) + ToMid.GetHashCode();
            }
            if (__isset.toName)
            {
                hashcode = (hashcode * 397) + ToName.GetHashCode();
            }
            if (__isset.setupTime)
            {
                hashcode = (hashcode * 397) + SetupTime.GetHashCode();
            }
            if (__isset.startTime)
            {
                hashcode = (hashcode * 397) + StartTime.GetHashCode();
            }
            if (__isset.endTime)
            {
                hashcode = (hashcode * 397) + EndTime.GetHashCode();
            }
            if (__isset.duration)
            {
                hashcode = (hashcode * 397) + Duration.GetHashCode();
            }
            if (__isset.terminate)
            {
                hashcode = (hashcode * 397) + Terminate.GetHashCode();
            }
            if (__isset.productType)
            {
                hashcode = (hashcode * 397) + ProductType.GetHashCode();
            }
            if (__isset.charge)
            {
                hashcode = (hashcode * 397) + Charge.GetHashCode();
            }
            if (__isset.unit)
            {
                hashcode = (hashcode * 397) + Unit.GetHashCode();
            }
            if (__isset.result)
            {
                hashcode = (hashcode * 397) + Result.GetHashCode();
            }
        }
        return(hashcode);
    }
Beispiel #6
0
    public override string ToString()
    {
        var  sb      = new StringBuilder("PaidCallDialing(");
        bool __first = true;

        if (__isset.type)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Type: ");
            Type.ToString(sb);
        }
        if (DialedNumber != null && __isset.dialedNumber)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("DialedNumber: ");
            DialedNumber.ToString(sb);
        }
        if (ServiceDomain != null && __isset.serviceDomain)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("ServiceDomain: ");
            ServiceDomain.ToString(sb);
        }
        if (__isset.productType)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("ProductType: ");
            ProductType.ToString(sb);
        }
        if (ProductName != null && __isset.productName)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("ProductName: ");
            ProductName.ToString(sb);
        }
        if (__isset.multipleProduct)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("MultipleProduct: ");
            MultipleProduct.ToString(sb);
        }
        if (__isset.callerIdStatus)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("CallerIdStatus: ");
            CallerIdStatus.ToString(sb);
        }
        if (__isset.balance)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Balance: ");
            Balance.ToString(sb);
        }
        if (Unit != null && __isset.unit)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Unit: ");
            Unit.ToString(sb);
        }
        if (__isset.rate)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Rate: ");
            Rate.ToString(sb);
        }
        if (DisplayCode != null && __isset.displayCode)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("DisplayCode: ");
            DisplayCode.ToString(sb);
        }
        if (CalledNumber != null && __isset.calledNumber)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("CalledNumber: ");
            CalledNumber.ToString(sb);
        }
        if (CalleeNationalNumber != null && __isset.calleeNationalNumber)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("CalleeNationalNumber: ");
            CalleeNationalNumber.ToString(sb);
        }
        if (CalleeCallingCode != null && __isset.calleeCallingCode)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("CalleeCallingCode: ");
            CalleeCallingCode.ToString(sb);
        }
        if (RateDivision != null && __isset.rateDivision)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("RateDivision: ");
            RateDivision.ToString(sb);
        }
        if (__isset.adMaxMin)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("AdMaxMin: ");
            AdMaxMin.ToString(sb);
        }
        if (__isset.adRemains)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("AdRemains: ");
            AdRemains.ToString(sb);
        }
        if (AdSessionId != null && __isset.adSessionId)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("AdSessionId: ");
            AdSessionId.ToString(sb);
        }
        sb.Append(")");
        return(sb.ToString());
    }