- Timestamp:
- Nov 29, 2013 5:56:02 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/pjsua2/pjsip/include/pjsua2/siptypes.hpp
r4658 r4663 394 394 unsigned usageCount; 395 395 396 public: 396 397 /** Construct from pjsua_transport_info */ 397 398 void fromPj(const pjsua_transport_info &info); … … 419 420 420 421 /** 421 * Source IP address of the message. 422 */ 423 string srcIp; 424 425 /** 426 * Source port number of the message. 427 */ 428 unsigned srcPort; 429 422 * Source address of the message. 423 */ 424 SocketAddress srcAddress; 425 426 /** 427 * Pointer to original pjsip_rx_data. Only valid when the struct 428 * is constructed from PJSIP's pjsip_rx_data. 429 */ 430 void *pjRxData; 431 432 public: 430 433 /** 431 434 * Construct from PJSIP's pjsip_rx_data … … 434 437 }; 435 438 439 /** 440 * This structure describes an outgoing SIP message. It corresponds to the 441 * pjsip_tx_data structure in PJSIP library. 442 */ 443 struct SipTxData 444 { 445 /** 446 * A short info string describing the request, which normally contains 447 * the request method and its CSeq. 448 */ 449 string info; 450 451 /** 452 * The whole message data as a string, containing both the header section 453 * and message body section. 454 */ 455 string wholeMsg; 456 457 /** 458 * Destination address of the message. 459 */ 460 SocketAddress dstAddress; 461 462 /** 463 * Pointer to original pjsip_tx_data. Only valid when the struct 464 * is constructed from PJSIP's pjsip_tx_data. 465 */ 466 void *pjTxData; 467 468 public: 469 /** 470 * Construct from PJSIP's pjsip_tx_data 471 */ 472 void fromPj(pjsip_tx_data &tdata); 473 }; 474 475 /** 476 * This structure describes SIP transaction object. It corresponds to the 477 * pjsip_transaction structure in PJSIP library. 478 */ 479 struct SipTransaction 480 { 481 /* Transaction identification. */ 482 pjsip_role_e role; /**< Role (UAS or UAC) */ 483 string method; /**< The method. */ 484 485 /* State and status. */ 486 int statusCode; /**< Last status code seen. */ 487 string statusText; /**< Last reason phrase. */ 488 pjsip_tsx_state_e state; /**< State. */ 489 490 /* Messages and timer. */ 491 SipTxData lastTx; /**< Msg kept for retrans. */ 492 493 /* Original pjsip_transaction. */ 494 void *pjTransaction; /**< pjsip_transaction. */ 495 496 public: 497 /** 498 * Construct from PJSIP's pjsip_transaction 499 */ 500 void fromPj(pjsip_transaction &tsx); 501 }; 502 503 /** 504 * This structure describes timer event. 505 */ 506 struct TimerEvent 507 { 508 TimerEntry entry; /**< The timer entry. */ 509 }; 510 511 /** 512 * This structure describes transaction state changed event. 513 */ 514 struct TsxStateEvent 515 { 516 struct 517 { 518 SipRxData rdata; /**< The incoming message. */ 519 SipTxData tdata; /**< The outgoing message. */ 520 TimerEntry timer; /**< The timer. */ 521 pj_status_t status; /**< Transport error status. */ 522 GenericData data; /**< Generic data. */ 523 } src; /**< Event source. */ 524 SipTransaction tsx; /**< The transaction. */ 525 pjsip_tsx_state_e prevState; /**< Previous state. */ 526 pjsip_event_id_e type; /**< Type of event source: 527 * - PJSIP_EVENT_TX_MSG 528 * - PJSIP_EVENT_RX_MSG, 529 * - PJSIP_EVENT_TRANSPORT_ERROR 530 * - PJSIP_EVENT_TIMER 531 * - PJSIP_EVENT_USER 532 */ 533 }; 534 535 /** 536 * This structure describes message transmission event. 537 */ 538 struct TxMsgEvent 539 { 540 SipTxData tdata; /**< The transmit data buffer. */ 541 }; 542 543 /** 544 * This structure describes transmission error event. 545 */ 546 struct TxErrorEvent 547 { 548 SipTxData tdata; /**< The transmit data. */ 549 SipTransaction tsx; /**< The transaction. */ 550 }; 551 552 /** 553 * This structure describes message arrival event. 554 */ 555 struct RxMsgEvent 556 { 557 SipRxData rdata; /**< The receive data buffer. */ 558 }; 559 560 /** 561 * This structure describes user event. 562 */ 563 struct UserEvent 564 { 565 GenericData user1; /**< User data 1. */ 566 GenericData user2; /**< User data 2. */ 567 GenericData user3; /**< User data 3. */ 568 GenericData user4; /**< User data 4. */ 569 }; 570 571 /** 572 * This structure describe event descriptor to fully identify a SIP event. It 573 * corresponds to the pjsip_event structure in PJSIP library. 574 */ 575 struct SipEvent 576 { 577 /** 578 * The event type, can be any value of \b pjsip_event_id_e. 579 */ 580 pjsip_event_id_e type; 581 582 /** 583 * The event body, which fields depends on the event type. 584 */ 585 struct 586 { 587 /** 588 * Timer event. 589 */ 590 TimerEvent timer; 591 592 /** 593 * Transaction state has changed event. 594 */ 595 TsxStateEvent tsxState; 596 597 /** 598 * Message transmission event. 599 */ 600 TxMsgEvent txMsg; 601 602 /** 603 * Transmission error event. 604 */ 605 TxErrorEvent txError; 606 607 /** 608 * Message arrival event. 609 */ 610 RxMsgEvent rxMsg; 611 612 /** 613 * User event. 614 */ 615 UserEvent user; 616 617 } body; 618 619 /** 620 * Pointer to its original pjsip_event. Only valid when the struct is 621 * constructed from PJSIP's pjsip_event. 622 */ 623 void *pjEvent; 624 625 public: 626 /** 627 * Construct from PJSIP's pjsip_event 628 */ 629 void fromPj(const pjsip_event &ev); 630 }; 436 631 437 632 ////////////////////////////////////////////////////////////////////////////// … … 449 644 string subType; 450 645 646 public: 451 647 /** 452 648 * Construct from PJSIP's pjsip_media_type … … 475 671 string hValue; 476 672 673 public: 477 674 /** 478 675 * Initiaize from PJSIP header. … … 514 711 string body; 515 712 713 public: 516 714 /** 517 715 * Initiaize from PJSIP's pjsip_multipart_part. … … 540 738 { 541 739 /** 542 * Optional remote target URI (i.e. Target header). If NULL, the target543 * will be set to the remote URI (To header). At the moment this field544 * is only used when sending initial INVITE and MESSAGE requests.545 */ 546 string 740 * Optional remote target URI (i.e. Target header). If empty (""), the 741 * target will be set to the remote URI (To header). At the moment this 742 * field is only used when sending initial INVITE and MESSAGE requests. 743 */ 744 string targetUri; 547 745 548 746 /** 549 747 * Additional message headers to be included in the outgoing message. 550 748 */ 551 SipHeaderVector 749 SipHeaderVector headers; 552 750 553 751 /** … … 555 753 * in this structure. 556 754 */ 557 string 755 string contentType; 558 756 559 757 /** … … 561 759 * message doesn't have a body. 562 760 */ 563 string 761 string msgBody; 564 762 565 763 /** … … 569 767 * contains a body, the body will be added to the multipart bodies. 570 768 */ 571 SipMediaType 769 SipMediaType multipartContentType; 572 770 573 771 /** … … 577 775 * the body will be added to the multipart bodies. 578 776 */ 579 SipMultipartPartVector multipartParts; 580 777 SipMultipartPartVector multipartParts; 778 779 public: 780 /** 781 * Check if the options are empty. If the options are set with empty 782 * values, there will be no additional information sent with outgoing 783 * SIP message. 784 * 785 * @return True if the options are empty. 786 */ 787 bool isEmpty() const; 788 581 789 /** 582 790 * Initiaize from PJSUA's pjsua_msg_data. … … 590 798 }; 591 799 800 ////////////////////////////////////////////////////////////////////////////// 592 801 593 802 /** … … 600 809 * MIME type. Default is "text/plain". 601 810 */ 602 string contentType;811 string contentType; 603 812 604 813 /** 605 814 * The message content. 606 815 */ 607 string content;816 string content; 608 817 609 818 /** … … 611 820 */ 612 821 SipTxOption txOption; 613 822 614 823 /** 615 824 * User data, which will be given back when the IM callback is called. 616 825 */ 617 Token userData; 826 Token userData; 827 828 public: 829 /** 830 * Default constructor initializes with zero/empty values. 831 */ 832 SendInstantMessageParam(); 618 833 }; 619 834 … … 628 843 * True to indicate to remote that local person is currently typing an IM. 629 844 */ 630 bool isTyping;845 bool isTyping; 631 846 632 847 /** 633 848 * List of headers etc to be included in outgoing request. 634 849 */ 635 SipTxOption txOption; 850 SipTxOption txOption; 851 852 public: 853 /** 854 * Default constructor initializes with zero/empty values. 855 */ 856 SendTypingIndicationParam(); 636 857 }; 637 858
Note: See TracChangeset
for help on using the changeset viewer.