- Timestamp:
- Oct 25, 2013 10:34:38 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/pjsua2/pjsip/src/pjsua2/account.cpp
r4631 r4638 351 351 /////////////////////////////////////////////////////////////////////////////// 352 352 353 Account::Account(AccountCallback *param_cb, Token user_data) 354 : id(PJSUA_INVALID_ID), cb(param_cb), userData(user_data) 355 { 356 cb->setAccount(this); 353 Account::Account() 354 : id(PJSUA_INVALID_ID) 355 { 357 356 } 358 357 359 358 Account::~Account() 360 359 { 361 delete cb; 360 /* If this instance is deleted, also delete the corresponding account in 361 * PJSUA library. 362 */ 363 if (isValid() && pjsua_get_state() < PJSUA_STATE_CLOSING) { 364 PJSUA2_CHECK_EXPR( pjsua_acc_set_user_data(id, NULL) ); 365 PJSUA2_CHECK_EXPR( pjsua_acc_del(id) ); 366 } 362 367 } 363 368 … … 367 372 pjsua_acc_config pj_acc_cfg = acc_cfg.toPj(); 368 373 374 pj_acc_cfg.user_data = (void*)this; 369 375 PJSUA2_CHECK_EXPR( pjsua_acc_add(&pj_acc_cfg, make_default, &id) ); 370 376 } … … 392 398 } 393 399 394 int Account::getI ndex() const400 int Account::getId() const 395 401 { 396 402 return id; 397 403 } 398 404 399 void Account::setUserData(Token user_data) 400 { 401 userData = user_data; 402 } 403 404 Token Account::getUserData() const 405 { 406 return userData; 405 Account *Account::lookup(int acc_id) 406 { 407 return (Account*)pjsua_acc_get_user_data(acc_id); 407 408 } 408 409
Note: See TracChangeset
for help on using the changeset viewer.