- Timestamp:
- Oct 25, 2011 8:51:02 AM (13 years ago)
- Location:
- pjproject/trunk/pjsip
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
r3841 r3849 564 564 { 565 565 /** 566 * Notify application when invitestate has changed.566 * Notify application when call state has changed. 567 567 * Application may then query the call info to get the 568 568 * detail call states by calling pjsua_call_get_info() function. -
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; -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r3841 r3849 778 778 switch (op) { 779 779 case PJ_ICE_STRANS_OP_INIT: 780 PJSUA_LOCK(); 780 781 call_med->tp_ready = result; 781 782 if (call_med->med_create_cb) 782 783 (*call_med->med_create_cb)(call_med, result, 783 784 call_med->call->secure_level, NULL); 785 PJSUA_UNLOCK(); 784 786 break; 785 787 case PJ_ICE_STRANS_OP_NEGOTIATION: … … 1420 1422 set_media_tp_state(call_med, PJSUA_MED_TP_CREATING); 1421 1423 1422 if (async) {1423 call_med->med_create_cb = &call_media_init_cb;1424 call_med->med_init_cb = cb;1425 }1426 1427 1424 if (pjsua_var.media_cfg.enable_ice) { 1428 1425 status = create_ice_media_transport(tcfg, call_med, async); 1429 if (async && status == PJ_SUCCESS) { 1430 /* Callback has been called. */ 1431 call_med->med_init_cb = NULL; 1432 /* We cannot return PJ_SUCCESS here since we already call 1433 * the callback. 1434 */ 1435 return PJ_EPENDING; 1436 } else if (async && status == PJ_EPENDING) { 1426 if (async && status == PJ_EPENDING) { 1437 1427 /* We will resume call media initialization in the 1438 1428 * on_ice_complete() callback. 1439 1429 */ 1430 call_med->med_create_cb = &call_media_init_cb; 1431 call_med->med_init_cb = cb; 1432 1440 1433 return PJ_EPENDING; 1441 1434 }
Note: See TracChangeset
for help on using the changeset viewer.