Changeset 476 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c
- Timestamp:
- May 26, 2006 12:17:46 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c
r424 r476 18 18 */ 19 19 #include <pjsua-lib/pjsua.h> 20 #include "pjsua_imp.h" 20 21 21 22 /* … … 81 82 { 82 83 int acc_index; 84 pjsua_acc_config *acc_config; 83 85 pjsip_method *req_method = &rdata->msg_info.msg->line.req.method; 84 86 pjsua_srv_pres *uapres; … … 97 99 /* Find which account for the incoming request. */ 98 100 acc_index = pjsua_find_account_for_incoming(rdata); 101 acc_config = &pjsua.config.acc_config[acc_index]; 99 102 100 103 /* Create UAS dialog: */ 101 status = pjsip_dlg_create_uas( 102 &pjsua.acc[acc_index].contact_uri,103 104 status = pjsip_dlg_create_uas(pjsip_ua_instance(), rdata, 105 &acc_config->contact, 106 &dlg); 104 107 if (status != PJ_SUCCESS) { 105 108 pjsua_perror(THIS_FILE, … … 307 310 { 308 311 int acc_index; 312 pjsua_acc_config *acc_config; 309 313 pjsip_dialog *dlg; 310 314 pjsip_tx_data *tdata; … … 312 316 313 317 acc_index = pjsua.buddies[index].acc_index; 318 acc_config = &pjsua.config.acc_config[acc_index]; 314 319 315 320 status = pjsip_dlg_create_uac( pjsip_ua_instance(), 316 & pjsua.acc[acc_index].local_uri,317 & pjsua.acc[acc_index].contact_uri,321 &acc_config->id, 322 &acc_config->contact, 318 323 &pjsua.buddies[index].uri, 319 324 NULL, &dlg); … … 324 329 } 325 330 326 pjsip_auth_clt_set_credentials( &dlg->auth_sess, pjsua.cred_count, 327 pjsua.cred_info); 331 if (acc_config->cred_count) { 332 pjsip_auth_clt_set_credentials( &dlg->auth_sess, 333 acc_config->cred_count, 334 acc_config->cred_info); 335 } 328 336 329 337 status = pjsip_pres_create_uac( dlg, &pres_callback, … … 427 435 * Refresh presence 428 436 */ 429 voidpjsua_pres_refresh(int acc_index)437 PJ_DEF(void) pjsua_pres_refresh(int acc_index) 430 438 { 431 439 refresh_client_subscription(); … … 442 450 int i; 443 451 444 for (acc_index=0; acc_index< pjsua.acc_cnt; ++acc_index) {452 for (acc_index=0; acc_index<(int)pjsua.config.acc_cnt; ++acc_index) { 445 453 pjsua.acc[acc_index].online_status = 0; 446 454 } … … 450 458 } 451 459 452 for (acc_index=0; acc_index< pjsua.acc_cnt; ++acc_index) {460 for (acc_index=0; acc_index<(int)pjsua.config.acc_cnt; ++acc_index) { 453 461 pjsua_pres_refresh(acc_index); 454 462 } … … 472 480 int count = 0; 473 481 474 for (acc_index=0; acc_index < pjsua.acc_cnt; ++acc_index) {482 for (acc_index=0; acc_index < (int)pjsua.config.acc_cnt; ++acc_index) { 475 483 476 484 if (!pj_list_empty(&pjsua.acc[acc_index].pres_srv_list)) { … … 507 515 PJ_LOG(3,(THIS_FILE, "Dumping pjsua server subscriptions:")); 508 516 509 for (acc_index=0; acc_index < pjsua.acc_cnt; ++acc_index) {517 for (acc_index=0; acc_index < (int)pjsua.config.acc_cnt; ++acc_index) { 510 518 511 519 PJ_LOG(3,(THIS_FILE, " %.*s", 512 (int)pjsua. acc[acc_index].local_uri.slen,513 pjsua. acc[acc_index].local_uri.ptr));520 (int)pjsua.config.acc_config[acc_index].id.slen, 521 pjsua.config.acc_config[acc_index].id.ptr)); 514 522 515 523 if (pj_list_empty(&pjsua.acc[acc_index].pres_srv_list)) {
Note: See TracChangeset
for help on using the changeset viewer.