Changeset 5801
- Timestamp:
- May 31, 2018 9:58:00 AM (6 years ago)
- Location:
- pjproject/trunk/pjsip
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/include/pjsua2/account.hpp
r5800 r5801 1510 1510 * Destructor. Note that if the account is deleted, it will also delete 1511 1511 * the corresponding account in the PJSUA-LIB. 1512 * 1513 * If application implements a derived class, the derived class should 1514 * call shutdown() in the beginning stage in its destructor, or 1515 * alternatively application should call shutdown() before deleting 1516 * the derived class instance. This is to avoid race condition between 1517 * the derived class destructor and Account callbacks. 1512 1518 */ 1513 1519 virtual ~Account(); … … 1515 1521 /** 1516 1522 * Create the account. 1523 * 1524 * If application implements a derived class, the derived class should 1525 * call shutdown() in the beginning stage in its destructor, or 1526 * alternatively application should call shutdown() before deleting 1527 * the derived class instance. This is to avoid race condition between 1528 * the derived class destructor and Account callbacks. 1517 1529 * 1518 1530 * @param cfg The account config. … … 1521 1533 void create(const AccountConfig &cfg, 1522 1534 bool make_default=false) throw(Error); 1535 1536 /** 1537 * Shutdown the account. This will initiate unregistration if needed, 1538 * and delete the corresponding account in the PJSUA-LIB. 1539 * 1540 * If application implements a derived class, the derived class should 1541 * call this method in the beginning stage in its destructor, or 1542 * alternatively application should call this method before deleting 1543 * the derived class instance. This is to avoid race condition between 1544 * the derived class destructor and Account callbacks. 1545 */ 1546 void shutdown(); 1523 1547 1524 1548 /** … … 1542 1566 * Set this as default account to be used when incoming and outgoing 1543 1567 * requests don't match any accounts. 1544 *1545 * @return PJ_SUCCESS on success.1546 1568 */ 1547 1569 void setDefault() throw(Error); … … 1645 1667 Buddy* findBuddy(string uri, FindBuddyMatch *buddy_match = NULL) const 1646 1668 throw(Error); 1647 1648 /**1649 * An internal function to add a Buddy to Account buddy list.1650 * This function must never be used by application.1651 */1652 void addBuddy(Buddy *buddy);1653 1654 /**1655 * An internal function to remove a Buddy from Account buddy list.1656 * This function must never be used by application.1657 */1658 void removeBuddy(Buddy *buddy);1659 1669 1660 1670 public: … … 1763 1773 { PJ_UNUSED_ARG(prm); } 1764 1774 1765 protected: 1775 1776 private: 1766 1777 friend class Endpoint; 1778 friend class Buddy; 1779 1780 /** 1781 * An internal function to add a Buddy to Account buddy list. 1782 * This method is used by Buddy::create(). 1783 */ 1784 void addBuddy(Buddy *buddy); 1785 1786 /** 1787 * An internal function to remove a Buddy from Account buddy list. 1788 * This method is used by Buddy::~Buddy(). 1789 */ 1790 void removeBuddy(Buddy *buddy); 1791 1767 1792 1768 1793 private: -
pjproject/trunk/pjsip/src/pjsua2/account.cpp
r5800 r5801 820 820 * PJSUA library. 821 821 */ 822 shutdown(); 823 } 824 825 void Account::create(const AccountConfig &acc_cfg, 826 bool make_default) throw(Error) 827 { 828 pjsua_acc_config pj_acc_cfg; 829 830 acc_cfg.toPj(pj_acc_cfg); 831 pj_acc_cfg.user_data = (void*)this; 832 PJSUA2_CHECK_EXPR( pjsua_acc_add(&pj_acc_cfg, make_default, &id) ); 833 } 834 835 void Account::shutdown() 836 { 822 837 if (isValid() && pjsua_get_state() < PJSUA_STATE_CLOSING) { 823 838 // Cleanup buddies in the buddy list … … 835 850 } 836 851 837 void Account::create(const AccountConfig &acc_cfg,838 bool make_default) throw(Error)839 {840 pjsua_acc_config pj_acc_cfg;841 842 acc_cfg.toPj(pj_acc_cfg);843 pj_acc_cfg.user_data = (void*)this;844 PJSUA2_CHECK_EXPR( pjsua_acc_add(&pj_acc_cfg, make_default, &id) );845 }846 847 852 void Account::modify(const AccountConfig &acc_cfg) throw(Error) 848 853 {
Note: See TracChangeset
for help on using the changeset viewer.