Exemplo n.º 1
0
        public bool Parse(string name, string value)
        {
            switch (name)
            {
                case "username":
                    UserName = value;
                    break;
                case "dialplan":
                    DialplanType = value;
                    break;
                case "caller-id-name":
                    _callerIdName = value;
                    CreateCallerId();
                    break;
                case "caller-id-number":
                    _callerIdNumber = value;
                    CreateCallerId();
                    break;
                case "callee-id-name":
                    _calleeIdName = value;
                    CreateCalleeId();
                    break;
                case "callee-id-number":
                    _calleeIdNumber = value;
                    CreateCalleeId();
                    break;
                case "network-addr":
                    IpAddress = value;
                    break;
                case "ani":
                    ANI = value;
                    break;
                case "destination-number":
                    DestinationNumber = value;
                    break;
                case "unique-id":
                    Id = new UniqueId(value);
                    break;
                case "context":
                    Context = value;
                    break;
                case "channel-name":
                    ChannelInfo = new ChannelName();
                    ChannelInfo.Parse(value);
                    break;
                case "profile-created-time":
                    ProfileCreatedAt = value.FromUnixTime();
                    break;
                case "channel-created-time":
                    CreatedAt = value.FromUnixTime();
                    break;
                case "channel-answered-time":
                    AnsweredAt = value.FromUnixTime();
                    break;
                case "channel-hangup-time":
                    HangupAt = value.FromUnixTime();
                    break;
                case "channel-transfer-time":
                    TransferredAt = value.FromUnixTime();
                    break;
                case "screen-bit":
                    ScreenBit = value == "yes";
                    break;
                case "privacy-hide-name":
                    PrivacyHideName = value == "yes";
                    break;
                case "privacy-hide-number":
                    PrivacyHideNumber = value == "yes";
                    break;

                case "direction":
                    Direction = Enumm.Parse<ChannelDirection>(value);
                    break;

                case "source":
                    EndpointSource = value;
                    break;

                case "profile-index":
                    ProfileIndex = int.Parse(value);
                    break;

                case "channel-progress-time":
                    ChannelProgressTime = long.Parse(value);
                    break;
                case "channel-progress-media-time":
                    ChannelProgressMediaTime = long.Parse(value);
                    break;

                default:
                    return false;
            }
            return true;
        }
Exemplo n.º 2
0
        public bool Parse(string name, string value)
        {
            switch (name)
            {
            case "username":
                UserName = value;
                break;

            case "dialplan":
                DialplanType = value;
                break;

            case "caller-id-name":
                _callerIdName = value;
                CreateCallerId();
                break;

            case "caller-id-number":
                _callerIdNumber = value;
                CreateCallerId();
                break;

            case "callee-id-name":
                _calleeIdName = value;
                CreateCalleeId();
                break;

            case "callee-id-number":
                _calleeIdNumber = value;
                CreateCalleeId();
                break;

            case "network-addr":
                IpAddress = value;
                break;

            case "ani":
                ANI = value;
                break;

            case "destination-number":
                DestinationNumber = value;
                break;

            case "unique-id":
                Id = new UniqueId(value);
                break;

            case "context":
                Context = value;
                break;

            case "channel-name":
                ChannelInfo = new ChannelName();
                ChannelInfo.Parse(value);
                break;

            case "profile-created-time":
                ProfileCreatedAt = value.FromUnixTime();
                break;

            case "channel-created-time":
                CreatedAt = value.FromUnixTime();
                break;

            case "channel-answered-time":
                AnsweredAt = value.FromUnixTime();
                break;

            case "channel-hangup-time":
                HangupAt = value.FromUnixTime();
                break;

            case "channel-transfer-time":
                TransferredAt = value.FromUnixTime();
                break;

            case "screen-bit":
                ScreenBit = value == "yes";
                break;

            case "privacy-hide-name":
                PrivacyHideName = value == "yes";
                break;

            case "privacy-hide-number":
                PrivacyHideNumber = value == "yes";
                break;

            case "direction":
                Direction = Enumm.Parse <ChannelDirection>(value);
                break;

            case "source":
                EndpointSource = value;
                break;

            case "profile-index":
                ProfileIndex = int.Parse(value);
                break;

            case "channel-progress-time":
                ChannelProgressTime = long.Parse(value);
                break;

            case "channel-progress-media-time":
                ChannelProgressMediaTime = long.Parse(value);
                break;

            default:
                return(false);
            }
            return(true);
        }