acdcommon.h 23.2 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775
#ifndef _BIDL2SL_ACDCOMMON_H_
#define _BIDL2SL_ACDCOMMON_H_

#include <string>
#include <vector>
#include <set>
#include <map>
#include <bgcc.h>

namespace acd {

    class AcdResultT {
    public:
        enum {
            ArSuccess = 0,
            ArAgentIdIsEmpty = 1,
            ArAgentDnIsEmpty = 2,
            ArSkillIsEmpty = 3,
            ArCallerIdIsEmpty = 4,
            ArDestIdIsEmpty = 5,
            ArDestDnIsEmpty = 6,
            ArKeyIsEmpty = 7,
            ArValueIsEmpty = 8,
            ArDigitalsIsEmpty = 9,
            ArFilenameIsEmpty = 10,
            ArAgentIdNotExist = 11,
            ArAgentPasswordError = 12,
            ArAgentSkillError = 13,
            ArNotMaster = 14,
            ArAgentDnBeOccupied = 15,
            ArHasSigned = 16,
            ArNoSignin = 17,
            ArDestAgentIdNotExist = 18,
            ArDestAgentDnNotExist = 19,
            ArSkillNotExist = 20,
            ArRouteRequestNotExist = 21,
            ArAgentStatusIsWrong = 22,
            ArImsError = 23,
            ArPasswordError = 24,
            ArFailed = 25,
            ArApFailed = 26,
            ArConnAcdFail = 27
        };

        AcdResultT();
        AcdResultT(int32_t value);

        int32_t get_value() const;
        std::string get_desc() const;

        bool operator==(int32_t value) const;
        bool operator!=(int32_t value) const;
        bool operator< (int32_t value) const;
        bool operator!=(const AcdResultT& rhs) const;
        bool operator==(const AcdResultT& rhs) const;
        bool operator< (const AcdResultT& rhs) const;

    private:
        int32_t _value;

        static const struct desc_t {
            int32_t value;
            const char* desc;
        } descs[];
    };
    bool operator==(int32_t value, const AcdResultT&);
    bool operator!=(int32_t value, const AcdResultT&);
    bool operator< (int32_t value, const AcdResultT&);
    std::ostream& operator<<(std::ostream& o, const AcdResultT&);


    class StatusChangeT {
    public:
        enum {
            ScReady = 0,
            ScBusy = 1
        };

        StatusChangeT();
        StatusChangeT(int32_t value);

        int32_t get_value() const;
        std::string get_desc() const;

        bool operator==(int32_t value) const;
        bool operator!=(int32_t value) const;
        bool operator< (int32_t value) const;
        bool operator!=(const StatusChangeT& rhs) const;
        bool operator==(const StatusChangeT& rhs) const;
        bool operator< (const StatusChangeT& rhs) const;

    private:
        int32_t _value;

        static const struct desc_t {
            int32_t value;
            const char* desc;
        } descs[];
    };
    bool operator==(int32_t value, const StatusChangeT&);
    bool operator!=(int32_t value, const StatusChangeT&);
    bool operator< (int32_t value, const StatusChangeT&);
    std::ostream& operator<<(std::ostream& o, const StatusChangeT&);


    class AgentStatusT {
    public:
        enum {
            AsUnknownState = 0,
            AsUnLoginState = 1,
            AsReadyState = 2,
            AsBusyState = 3,
            AsRestState = 4,
            AsLockState = 5,
            AsAlertingState = 6,
            AsHalfAlertingState = 7,
            AsConnectingState = 8,
            AsConnectedState = 9,
            AsHalfConnectedState = 10,
            AsInternalConnectedState = 11,
            AsSuspendedState = 12,
            AsConsultConnectingState = 13,
            AsConsultConnectedState = 14,
            AsConferenceState = 15,
            AsMonitorState = 16,
            AsInsertState = 17,
            AsMonitoredState = 18,
            AsInsertedState = 19
        };

        AgentStatusT();
        AgentStatusT(int32_t value);

        int32_t get_value() const;
        std::string get_desc() const;

        bool operator==(int32_t value) const;
        bool operator!=(int32_t value) const;
        bool operator< (int32_t value) const;
        bool operator!=(const AgentStatusT& rhs) const;
        bool operator==(const AgentStatusT& rhs) const;
        bool operator< (const AgentStatusT& rhs) const;

    private:
        int32_t _value;

        static const struct desc_t {
            int32_t value;
            const char* desc;
        } descs[];
    };
    bool operator==(int32_t value, const AgentStatusT&);
    bool operator!=(int32_t value, const AgentStatusT&);
    bool operator< (int32_t value, const AgentStatusT&);
    std::ostream& operator<<(std::ostream& o, const AgentStatusT&);


    class CallModeT {
    public:
        enum {
            CmNormal = 0,
            CmOffhook = 1
        };

        CallModeT();
        CallModeT(int32_t value);

        int32_t get_value() const;
        std::string get_desc() const;

        bool operator==(int32_t value) const;
        bool operator!=(int32_t value) const;
        bool operator< (int32_t value) const;
        bool operator!=(const CallModeT& rhs) const;
        bool operator==(const CallModeT& rhs) const;
        bool operator< (const CallModeT& rhs) const;

    private:
        int32_t _value;

        static const struct desc_t {
            int32_t value;
            const char* desc;
        } descs[];
    };
    bool operator==(int32_t value, const CallModeT&);
    bool operator!=(int32_t value, const CallModeT&);
    bool operator< (int32_t value, const CallModeT&);
    std::ostream& operator<<(std::ostream& o, const CallModeT&);


    class CallTypeT {
    public:
        enum {
            CtAgent = 0,
            CtOut = 1
        };

        CallTypeT();
        CallTypeT(int32_t value);

        int32_t get_value() const;
        std::string get_desc() const;

        bool operator==(int32_t value) const;
        bool operator!=(int32_t value) const;
        bool operator< (int32_t value) const;
        bool operator!=(const CallTypeT& rhs) const;
        bool operator==(const CallTypeT& rhs) const;
        bool operator< (const CallTypeT& rhs) const;

    private:
        int32_t _value;

        static const struct desc_t {
            int32_t value;
            const char* desc;
        } descs[];
    };
    bool operator==(int32_t value, const CallTypeT&);
    bool operator!=(int32_t value, const CallTypeT&);
    bool operator< (int32_t value, const CallTypeT&);
    std::ostream& operator<<(std::ostream& o, const CallTypeT&);


    class ConferenceT {
    public:
        enum {
            ConferenceMute = 0,
            ConferenceSpeak = 1,
            ConferenceAll = 2
        };

        ConferenceT();
        ConferenceT(int32_t value);

        int32_t get_value() const;
        std::string get_desc() const;

        bool operator==(int32_t value) const;
        bool operator!=(int32_t value) const;
        bool operator< (int32_t value) const;
        bool operator!=(const ConferenceT& rhs) const;
        bool operator==(const ConferenceT& rhs) const;
        bool operator< (const ConferenceT& rhs) const;

    private:
        int32_t _value;

        static const struct desc_t {
            int32_t value;
            const char* desc;
        } descs[];
    };
    bool operator==(int32_t value, const ConferenceT&);
    bool operator!=(int32_t value, const ConferenceT&);
    bool operator< (int32_t value, const ConferenceT&);
    std::ostream& operator<<(std::ostream& o, const ConferenceT&);

    class AgentInfoT {
    public:
        AgentInfoT();
        ~AgentInfoT();

        std::string agentId;
        std::string agentDn;
        int64_t loginTime;
        AgentStatusT currStatus;
        int64_t currStatusTime;
        int64_t answerTime;
        int64_t currTime;
        std::string origCaller;
        std::string origCallee;
        int32_t privQueueNum;
        int32_t callTimes;
        int32_t answerTimes;
        int64_t freeTotalTime;
        int64_t busyTotalTime;
        int64_t resetTotalTime;
        int64_t callTotalTime;
        int64_t answerTotalTime;
        std::string agentIP;

        bool operator==(const AgentInfoT& rhs) const;
        bool operator!=(const AgentInfoT& rhs) const;
        bool operator< (const AgentInfoT& rhs) const;
        int32_t read(char *request, int32_t request_len, bgcc::SharedPointer<bgcc::IProtocol> proto);
        int32_t write(bgcc::SharedPointer<bgcc::IProtocol> proto) const;
    };

    typedef std::vector<std::string>  StringListT;
    typedef std::vector<AgentInfoT>  AgentInfoListT;
    class QueueInfoT {
    public:
        QueueInfoT();
        ~QueueInfoT();

        std::string callId;
        int64_t contactId;
        int64_t requestId;
        std::string origCaller;
        std::string origCallee;
        int64_t startTime;
        int64_t currTime;
        int64_t changeTime;

        bool operator==(const QueueInfoT& rhs) const;
        bool operator!=(const QueueInfoT& rhs) const;
        bool operator< (const QueueInfoT& rhs) const;
        int32_t read(char *request, int32_t request_len, bgcc::SharedPointer<bgcc::IProtocol> proto);
        int32_t write(bgcc::SharedPointer<bgcc::IProtocol> proto) const;
    };

    typedef std::vector<QueueInfoT>  QueueInfoListT;
    class SysInfoT {
    public:
        SysInfoT();
        ~SysInfoT();

        int32_t totalAgents;
        int32_t totalCalls;
        int32_t ivrCalls;
        int32_t agentCalls;
        int32_t queueCalls;
        int32_t privQueueCalls;

        bool operator==(const SysInfoT& rhs) const;
        bool operator!=(const SysInfoT& rhs) const;
        bool operator< (const SysInfoT& rhs) const;
        int32_t read(char *request, int32_t request_len, bgcc::SharedPointer<bgcc::IProtocol> proto);
        int32_t write(bgcc::SharedPointer<bgcc::IProtocol> proto) const;
    };


    class CallEventTypeT {
    public:
        enum {
            CeUnKnownEvent = 0,
            CeInboundCallInternalCall = 1,
            CeDestSeizedInternalCall = 2,
            CeThisPartyAnsweredInternalCall = 3,
            CeOtherPartyAnsweredInternalCall = 4,
            CeThisPartyDisconnectedInternalCall = 5,
            CeOtherPartyDisconnectedInternalCall = 6,
            CeInboundCallNormalCall = 7,
            CeDestSeizedNormalCall = 8,
            CeThisPartyAnsweredNormalCall = 9,
            CeOtherPartyAnsweredNormalCall = 10,
            CeThisPartyDisconnectedNormalCall = 11,
            CeOtherPartyDisconnectedNormalCall = 12,
            CeThisPartySuspendedNormalCall = 13,
            CeThisPartyRetrievedNormalCall = 14,
            CeThisPartyTransferredNormalCall = 15,
            CeDestSeizedConsultCall = 16,
            CeOtherPartyAnsweredConsultCall = 17,
            CeThisPartyDisconnectedConsultCall = 18,
            CeOtherPartyDisconnectedConsultCall = 19,
            CeThisPartyTransferredConsultCall = 20,
            CeOtherPartyTransferredConsultCall = 21,
            CeThisPartyConferencedConferenceCall = 22,
            CeOtherPartyConferencedConferenceCall = 23,
            CeThisPartyDisconnectConferenceCall = 24,
            CeOtherPartyDisconnectConferenceCall = 25,
            CeThisPartyConferencedMonitorCall = 26,
            CeOtherPartyConferencedMonitorCall = 27,
            CeThisPartyDisconnectMonitorCall = 28,
            CeOtherPartyDisconnectMonitorCall = 29,
            CeThisPartyConferencedIntrudeCall = 30,
            CeOtherPartyConferencedIntrudeCall = 31,
            CeThisPartyDisconnectIntrudeCall = 32,
            CeOtherPartyDisconnectIntrudeCall = 33
        };

        CallEventTypeT();
        CallEventTypeT(int32_t value);

        int32_t get_value() const;
        std::string get_desc() const;

        bool operator==(int32_t value) const;
        bool operator!=(int32_t value) const;
        bool operator< (int32_t value) const;
        bool operator!=(const CallEventTypeT& rhs) const;
        bool operator==(const CallEventTypeT& rhs) const;
        bool operator< (const CallEventTypeT& rhs) const;

    private:
        int32_t _value;

        static const struct desc_t {
            int32_t value;
            const char* desc;
        } descs[];
    };
    bool operator==(int32_t value, const CallEventTypeT&);
    bool operator!=(int32_t value, const CallEventTypeT&);
    bool operator< (int32_t value, const CallEventTypeT&);
    std::ostream& operator<<(std::ostream& o, const CallEventTypeT&);


    class PartyAttributeT {
    public:
        enum {
            PaUnknown = 0,
            PaInternal = 1,
            PaNormal = 2
        };

        PartyAttributeT();
        PartyAttributeT(int32_t value);

        int32_t get_value() const;
        std::string get_desc() const;

        bool operator==(int32_t value) const;
        bool operator!=(int32_t value) const;
        bool operator< (int32_t value) const;
        bool operator!=(const PartyAttributeT& rhs) const;
        bool operator==(const PartyAttributeT& rhs) const;
        bool operator< (const PartyAttributeT& rhs) const;

    private:
        int32_t _value;

        static const struct desc_t {
            int32_t value;
            const char* desc;
        } descs[];
    };
    bool operator==(int32_t value, const PartyAttributeT&);
    bool operator!=(int32_t value, const PartyAttributeT&);
    bool operator< (int32_t value, const PartyAttributeT&);
    std::ostream& operator<<(std::ostream& o, const PartyAttributeT&);


    class CallEventReasonT {
    public:
        enum {
            CerSuccess = 0,
            CerInvokeComplete = 1,
            CerCallDestBusy = 2,
            CerCallNoAnswer = 3,
            CerCallDestUnknown = 4,
            CerCallDestInvalid = 5,
            CerCallTimeout = 6,
            CerUnloginInitial = 7,
            CerUnloginLogout = 8,
            CerUnloginSelfForceout = 9,
            CerUnloginOtherForceout = 10,
            CerUnloginBackup = 11,
            CerUnloginResignin = 12,
            CerUnloginElse = 13,
            CerIdleSelfLogin = 14,
            CerIdleOtherLogin = 15,
            CerIdleNormalSelfHangup = 16,
            CerIdleNormalOtherHangup = 17,
            CerIdleErrorSelfHangup = 18,
            CerIdleErrorOtherHangup = 19,
            CerIdleUnlock = 20,
            CerIdleIdle = 21,
            CerIdleSelfSet = 22,
            CerIdleOtherSet = 23,
            CerIdleElse = 24,
            CerTalkSelfCreat = 25,
            CerTalkOtherCreat = 26,
            CerTalkSelfRetrieve = 27,
            CerTalkOtherRetrieve = 28,
            CerTalkElse = 29
        };

        CallEventReasonT();
        CallEventReasonT(int32_t value);

        int32_t get_value() const;
        std::string get_desc() const;

        bool operator==(int32_t value) const;
        bool operator!=(int32_t value) const;
        bool operator< (int32_t value) const;
        bool operator!=(const CallEventReasonT& rhs) const;
        bool operator==(const CallEventReasonT& rhs) const;
        bool operator< (const CallEventReasonT& rhs) const;

    private:
        int32_t _value;

        static const struct desc_t {
            int32_t value;
            const char* desc;
        } descs[];
    };
    bool operator==(int32_t value, const CallEventReasonT&);
    bool operator!=(int32_t value, const CallEventReasonT&);
    bool operator< (int32_t value, const CallEventReasonT&);
    std::ostream& operator<<(std::ostream& o, const CallEventReasonT&);

    class AgentEventT {
    public:
        AgentEventT();
        ~AgentEventT();

        std::string agentId;
        CallEventTypeT eventId;
        std::string agentDn;
        std::string callId;
        int64_t sessionId;
        AgentStatusT agentStatus;
        std::string originalCallid;
        int32_t partyNum;
        std::string otherParty;
        PartyAttributeT otherAttr;
        std::string originatingParty;
        std::string originalAni;
        std::string originalDnis;
        CallEventReasonT reason;
        int64_t timestamp;

        bool operator==(const AgentEventT& rhs) const;
        bool operator!=(const AgentEventT& rhs) const;
        bool operator< (const AgentEventT& rhs) const;
        int32_t read(char *request, int32_t request_len, bgcc::SharedPointer<bgcc::IProtocol> proto);
        int32_t write(bgcc::SharedPointer<bgcc::IProtocol> proto) const;
    };


    class MediaEventTypeT {
    public:
        enum {
            MeUnKownEvent = 0,
            MeTpRecordStarted = 1,
            MeOpRecordStarted = 2,
            MeTpRecordDone = 3,
            MeOpRecordDone = 4
        };

        MediaEventTypeT();
        MediaEventTypeT(int32_t value);

        int32_t get_value() const;
        std::string get_desc() const;

        bool operator==(int32_t value) const;
        bool operator!=(int32_t value) const;
        bool operator< (int32_t value) const;
        bool operator!=(const MediaEventTypeT& rhs) const;
        bool operator==(const MediaEventTypeT& rhs) const;
        bool operator< (const MediaEventTypeT& rhs) const;

    private:
        int32_t _value;

        static const struct desc_t {
            int32_t value;
            const char* desc;
        } descs[];
    };
    bool operator==(int32_t value, const MediaEventTypeT&);
    bool operator!=(int32_t value, const MediaEventTypeT&);
    bool operator< (int32_t value, const MediaEventTypeT&);
    std::ostream& operator<<(std::ostream& o, const MediaEventTypeT&);


    class MediaStateT {
    public:
        enum {
            MsUnknownState = 0,
            MsIdleState = 1,
            MsRecordingState = 2
        };

        MediaStateT();
        MediaStateT(int32_t value);

        int32_t get_value() const;
        std::string get_desc() const;

        bool operator==(int32_t value) const;
        bool operator!=(int32_t value) const;
        bool operator< (int32_t value) const;
        bool operator!=(const MediaStateT& rhs) const;
        bool operator==(const MediaStateT& rhs) const;
        bool operator< (const MediaStateT& rhs) const;

    private:
        int32_t _value;

        static const struct desc_t {
            int32_t value;
            const char* desc;
        } descs[];
    };
    bool operator==(int32_t value, const MediaStateT&);
    bool operator!=(int32_t value, const MediaStateT&);
    bool operator< (int32_t value, const MediaStateT&);
    std::ostream& operator<<(std::ostream& o, const MediaStateT&);


    class MediaEventReasonT {
    public:
        enum {
            MerMediaUnknown = 0,
            MerMediaEnd = 1,
            MerMediaOther = 2
        };

        MediaEventReasonT();
        MediaEventReasonT(int32_t value);

        int32_t get_value() const;
        std::string get_desc() const;

        bool operator==(int32_t value) const;
        bool operator!=(int32_t value) const;
        bool operator< (int32_t value) const;
        bool operator!=(const MediaEventReasonT& rhs) const;
        bool operator==(const MediaEventReasonT& rhs) const;
        bool operator< (const MediaEventReasonT& rhs) const;

    private:
        int32_t _value;

        static const struct desc_t {
            int32_t value;
            const char* desc;
        } descs[];
    };
    bool operator==(int32_t value, const MediaEventReasonT&);
    bool operator!=(int32_t value, const MediaEventReasonT&);
    bool operator< (int32_t value, const MediaEventReasonT&);
    std::ostream& operator<<(std::ostream& o, const MediaEventReasonT&);

    class MediaEventT {
    public:
        MediaEventT();
        ~MediaEventT();

        std::string agentId;
        MediaEventTypeT eventType;
        std::string agentDn;
        std::string callId;
        int64_t sessionId;
        MediaStateT state;
        MediaEventReasonT reason;
        std::string otherParty;
        std::string buffer;
        int64_t timestamp;

        bool operator==(const MediaEventT& rhs) const;
        bool operator!=(const MediaEventT& rhs) const;
        bool operator< (const MediaEventT& rhs) const;
        int32_t read(char *request, int32_t request_len, bgcc::SharedPointer<bgcc::IProtocol> proto);
        int32_t write(bgcc::SharedPointer<bgcc::IProtocol> proto) const;
    };


    class RouteEventTypeT {
    public:
        enum {
            ReInQueue = 0,
            ReOutQueue = 1
        };

        RouteEventTypeT();
        RouteEventTypeT(int32_t value);

        int32_t get_value() const;
        std::string get_desc() const;

        bool operator==(int32_t value) const;
        bool operator!=(int32_t value) const;
        bool operator< (int32_t value) const;
        bool operator!=(const RouteEventTypeT& rhs) const;
        bool operator==(const RouteEventTypeT& rhs) const;
        bool operator< (const RouteEventTypeT& rhs) const;

    private:
        int32_t _value;

        static const struct desc_t {
            int32_t value;
            const char* desc;
        } descs[];
    };
    bool operator==(int32_t value, const RouteEventTypeT&);
    bool operator!=(int32_t value, const RouteEventTypeT&);
    bool operator< (int32_t value, const RouteEventTypeT&);
    std::ostream& operator<<(std::ostream& o, const RouteEventTypeT&);

    class RouteEventT {
    public:
        RouteEventT();
        ~RouteEventT();

        std::string agentId;
        RouteEventTypeT eventType;
        std::string agentDn;
        std::string callId;
        int64_t sessionId;
        int64_t requestId;
        std::string originalAni;
        std::string originalDnis;
        int64_t timestamp;

        bool operator==(const RouteEventT& rhs) const;
        bool operator!=(const RouteEventT& rhs) const;
        bool operator< (const RouteEventT& rhs) const;
        int32_t read(char *request, int32_t request_len, bgcc::SharedPointer<bgcc::IProtocol> proto);
        int32_t write(bgcc::SharedPointer<bgcc::IProtocol> proto) const;
    };


    class OtherEventTypeT {
    public:
        enum {
            IMSDisconnect = 0,
            IMSMasterChange = 1,
            IMSOperationFailed = 2,
            ACDDisconnect = 3,
            ACDMasterChange = 4,
            ACDOperationFailed = 5,
            ACDReLoginSuccess = 6,
            ACDReLoginFailed = 7
        };

        OtherEventTypeT();
        OtherEventTypeT(int32_t value);

        int32_t get_value() const;
        std::string get_desc() const;

        bool operator==(int32_t value) const;
        bool operator!=(int32_t value) const;
        bool operator< (int32_t value) const;
        bool operator!=(const OtherEventTypeT& rhs) const;
        bool operator==(const OtherEventTypeT& rhs) const;
        bool operator< (const OtherEventTypeT& rhs) const;

    private:
        int32_t _value;

        static const struct desc_t {
            int32_t value;
            const char* desc;
        } descs[];
    };
    bool operator==(int32_t value, const OtherEventTypeT&);
    bool operator!=(int32_t value, const OtherEventTypeT&);
    bool operator< (int32_t value, const OtherEventTypeT&);
    std::ostream& operator<<(std::ostream& o, const OtherEventTypeT&);

    class OtherEventT {
    public:
        OtherEventT();
        ~OtherEventT();

        std::string agentId;
        OtherEventTypeT eventType;
        std::string agentDn;
        std::string callId;
        int64_t sessionId;
        std::string originalAni;
        std::string originalDnis;
        int64_t timestamp;

        bool operator==(const OtherEventT& rhs) const;
        bool operator!=(const OtherEventT& rhs) const;
        bool operator< (const OtherEventT& rhs) const;
        int32_t read(char *request, int32_t request_len, bgcc::SharedPointer<bgcc::IProtocol> proto);
        int32_t write(bgcc::SharedPointer<bgcc::IProtocol> proto) const;
    };

}


#endif