예제 #1
0
        public CallVariable(CiscoParser parser)
        {
            while (parser.Read())
            {
                if (parser.state == CiscoParser.ParserState.Begin)
                {
                    switch (parser.name)
                    {
                    case "name":
                    case "value":
                        parser.Read(this, parser.name);
                        break;

                    default:
                        throw new Exception("parser error");
                    }
                }
                else if (parser.state == CiscoParser.ParserState.End)
                {
                    if (parser.name == this.GetType().Name)
                    {
                        return;
                    }
                }
                else
                {
                    throw new Exception("parser error");
                }
            }
        }
예제 #2
0
        public CiscoDialog(CiscoParser parser)
        {
            while (parser.Read())
            {
                if (parser.state == CiscoParser.ParserState.Begin)
                {
                    switch (parser.name)
                    {
                    case "associatedDialogUri":
                    case "fromAddress":
                    case "id":
                    case "mediaType":
                    case "state":
                    case "toAddress":
                    case "uri":
                        parser.Read(this, parser.name);
                        break;

                    case "mediaProperties":
                        mediaProperties = new mediaProperties(parser);
                        break;

                    case "participants":
                        participants = new List <Participant>();
                        break;

                    case "Participant":
                        participants.Add(new Participant(parser));
                        break;

                    default:
                        throw new Exception("parser error");
                    }
                }
                else if (parser.state == CiscoParser.ParserState.End)
                {
                    if (parser.name == "Dialog") //this.GetType().Name)
                    {
                        return;
                    }
                }
                else
                {
                    throw new Exception("parser error");
                }
            }
        }
예제 #3
0
        public Participant(CiscoParser parser)
        {
            while (parser.Read())
            {
                if (parser.state == CiscoParser.ParserState.Begin)
                {
                    switch (parser.name)
                    {
                    case "actions":
                        actions = new List <string>();
                        break;

                    case "action":
                        actions.Add(parser.ReadSimple(this));
                        break;

                    case "mediaAddress":
                    case "mediaAddressType":
                    case "startTime":
                    case "state":
                    case "stateCause":
                    case "stateChangeTime":
                        parser.Read(this, parser.name);
                        break;

                    default:
                        throw new Exception("parser error");
                    }
                }
                else if (parser.state == CiscoParser.ParserState.End)
                {
                    if (parser.name == this.GetType().Name)
                    {
                        return;
                    }
                }
                else
                {
                    throw new Exception("parser error");
                }
            }
        }
예제 #4
0
        public mediaProperties(CiscoParser parser)
        {
            while (parser.Read())
            {
                if (parser.state == CiscoParser.ParserState.Begin)
                {
                    switch (parser.name)
                    {
                    case "DNIS":
                    case "callType":
                    case "dialedNumber":
                    case "outboundClassification":
                        parser.Read(this, parser.name);
                        break;

                    case "callvariables":
                        callvariables = new List <CallVariable>();
                        break;

                    case "CallVariable":
                        callvariables.Add(new CallVariable(parser));
                        break;

                    default:
                        throw new Exception("parser error");
                    }
                }
                else if (parser.state == CiscoParser.ParserState.End)
                {
                    if (parser.name == this.GetType().Name)
                    {
                        return;
                    }
                }
                else
                {
                    throw new Exception("parser error");
                }
            }
        }
예제 #5
0
        public CiscoDialogs(string xml)
        {
            CiscoParser _parser = new CiscoParser(xml);

            while (_parser.Read())
            {
                if (_parser.state == CiscoParser.ParserState.Begin)
                {
                    switch (_parser.name)
                    {
                    case "dialogs":
                        Items = new List <CiscoDialog>();
                        break;

                    case "Dialog":
                        Items.Add(new CiscoDialog(_parser));
                        break;

                    default:
                        throw new Exception("parse dialogs error");
                    }
                }
            }
        }