Changeset 3849 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
- Timestamp:
- Oct 25, 2011 8:51:02 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r3841 r3849 465 465 466 466 on_error: 467 if (inv == NULL && call_id != -1 && pjsua_var.ua_cfg.cb.on_call_state) 468 (*pjsua_var.ua_cfg.cb.on_call_state)(call_id, NULL); 469 467 470 if (dlg) { 468 471 /* This may destroy the dialog */ … … 1402 1405 { 1403 1406 pjsua_call *call; 1407 pjsip_dialog *dlg; 1404 1408 unsigned mi; 1405 1409 … … 1415 1419 1416 1420 call = &pjsua_var.calls[call_id]; 1417 1418 if (! call->inv) {1421 dlg = (call->inv ? call->inv->dlg : call->async_call.dlg); 1422 if (!dlg) { 1419 1423 PJSUA_UNLOCK(); 1420 1424 return PJSIP_ESESSIONTERMINATED; … … 1423 1427 /* id and role */ 1424 1428 info->id = call_id; 1425 info->role = call->inv->role;1429 info->role = dlg->role; 1426 1430 info->acc_id = call->acc_id; 1427 1431 1428 1432 /* local info */ 1429 1433 info->local_info.ptr = info->buf_.local_info; 1430 pj_strncpy(&info->local_info, & call->inv->dlg->local.info_str,1434 pj_strncpy(&info->local_info, &dlg->local.info_str, 1431 1435 sizeof(info->buf_.local_info)); 1432 1436 … … 1434 1438 info->local_contact.ptr = info->buf_.local_contact; 1435 1439 info->local_contact.slen = pjsip_uri_print(PJSIP_URI_IN_CONTACT_HDR, 1436 call->inv->dlg->local.contact->uri,1440 dlg->local.contact->uri, 1437 1441 info->local_contact.ptr, 1438 1442 sizeof(info->buf_.local_contact)); … … 1440 1444 /* remote info */ 1441 1445 info->remote_info.ptr = info->buf_.remote_info; 1442 pj_strncpy(&info->remote_info, & call->inv->dlg->remote.info_str,1446 pj_strncpy(&info->remote_info, &dlg->remote.info_str, 1443 1447 sizeof(info->buf_.remote_info)); 1444 1448 1445 1449 /* remote contact */ 1446 if ( call->inv->dlg->remote.contact) {1450 if (dlg->remote.contact) { 1447 1451 int len; 1448 1452 info->remote_contact.ptr = info->buf_.remote_contact; 1449 1453 len = pjsip_uri_print(PJSIP_URI_IN_CONTACT_HDR, 1450 call->inv->dlg->remote.contact->uri,1454 dlg->remote.contact->uri, 1451 1455 info->remote_contact.ptr, 1452 1456 sizeof(info->buf_.remote_contact)); … … 1459 1463 /* call id */ 1460 1464 info->call_id.ptr = info->buf_.call_id; 1461 pj_strncpy(&info->call_id, & call->inv->dlg->call_id->id,1465 pj_strncpy(&info->call_id, &dlg->call_id->id, 1462 1466 sizeof(info->buf_.call_id)); 1463 1467 1464 1468 /* state, state_text */ 1465 info->state = call->inv->state;1469 info->state = (call->inv? call->inv->state: PJSIP_INV_STATE_DISCONNECTED); 1466 1470 info->state_text = pj_str((char*)pjsip_inv_state_name(info->state)); 1467 1471 1468 1472 /* If call is disconnected, set the last_status from the cause code */ 1469 if (call->inv ->state >= PJSIP_INV_STATE_DISCONNECTED) {1473 if (call->inv && call->inv->state >= PJSIP_INV_STATE_DISCONNECTED) { 1470 1474 /* last_status, last_status_text */ 1471 1475 info->last_status = call->inv->cause;
Note: See TracChangeset
for help on using the changeset viewer.