Exemple #1
0
        public override string ToString()
        {
            var _strBuilder = new StringBuilder();

            //field[0]: Connected Call length
            var _length = leg2End.Subtract(leg2Start.ToLocalTime());

            _strBuilder.Append(_length.TotalSeconds.ToString("0"));
            _strBuilder.Append("|");

            //field[1]: Start Time
            var _w3CDateTime = new W3CDateTime(callStart.ToLocalTime());

            _strBuilder.Append(_w3CDateTime.ToString("X"));
            _strBuilder.Append("|");

            //field[2]: Stop Time
            _w3CDateTime = new W3CDateTime(callEnd.ToLocalTime());
            _strBuilder.Append(_w3CDateTime.ToString("X"));
            _strBuilder.Append("|");

            //field[3]: OrigIPAddress
            _strBuilder.Append(origIPAddress);
            _strBuilder.Append(":5070");             //TODO: add real orig port
            _strBuilder.Append("|");

            //field[4]: empty field: usually SIP user ID
            _strBuilder.Append("|");

            //field[5]: DestIPAddress
            _strBuilder.Append(destIPAddress);
            _strBuilder.Append("|");

            //field[6]: usually caller ID, we put SerialNumber
            _strBuilder.Append(string.Format("{0}{1}", SERIAL_NUMBER_PREFIX, SerialNumber));
            _strBuilder.Append("|");

            //field[7]: DestNumber
            _strBuilder.Append(DestNumber);
            _strBuilder.Append("|");

            //field[8]: ANI
            _strBuilder.Append(string.Format("{0}{1}", ANI, ANI_SUFIX));
            _strBuilder.Append("|");

            //field[9]: empty field: usually GkID, we put DNIS
            _strBuilder.Append(string.Format("{0}{1}", DNIS_PREFIX, AccessNumber));
            _strBuilder.Append("|");

            //field[10]: RetailAccId
            _strBuilder.Append(RetailAcctId.ToString());
            _strBuilder.Append("|");

            //field[11]: CustomerId
            _strBuilder.Append(CustomerAcctId.ToString());
            _strBuilder.Append("|");

            //field[12]: CarrierId
            _strBuilder.Append(carrierAcctId.ToString());
            _strBuilder.Append("|");

            //field[13]: RouteId
            _strBuilder.Append(customerBaseRouteId.ToString());
            _strBuilder.Append("|");

            //field[14]: CarrierRouteID
            _strBuilder.Append(carrierBaseRouteId.ToString());
            _strBuilder.Append("|");

            //field[15]: DisconnectCause
            _strBuilder.Append(disconnectCause.ToString());
            _strBuilder.Append("|");

            //field[16]: DisconnectSource
            _strBuilder.Append(disconnectSource.ToString());
            _strBuilder.Append("|");

            //field[17]: RbrResult
            _strBuilder.Append(rbrResult.ToString());
            _strBuilder.Append("|");

            //field[18]: MappedDisconnectCause
            _strBuilder.Append(mappedDisconnectCause.ToString());
            _strBuilder.Append("|");

            //field[19]: InfoDigits
            _strBuilder.Append(InfoDigits.ToString("D2"));
            _strBuilder.Append(";");

            return(_strBuilder.ToString());
        }
Exemple #2
0
 public override int GetHashCode()
 {
     //TODO: finish it, get hashes for all fields
     return(CustomerAcctId.GetHashCode());
 }