- Timestamp:
- Apr 9, 2006 4:46:05 PM (19 years ago)
- Location:
- pjproject/trunk/pjsip
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
r350 r398 93 93 unsigned index; /**< Index in pjsua array. */ 94 94 pjsip_inv_session *inv; /**< The invite session. */ 95 pj_time_val start_time;/**< First INVITE sent/received. */ 96 pj_time_val res_time; /**< First response sent/received. */ 97 pj_time_val conn_time; /**< Connected/confirmed time. */ 98 pj_time_val dis_time; /**< Disconnect time. */ 95 99 int acc_index; /**< Account index being used. */ 96 100 pjmedia_session *session; /**< The media session. */ -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r376 r398 193 193 } 194 194 195 /* Mark call start time. */ 196 pj_gettimeofday(&pjsua.calls[call_index].start_time); 197 198 /* Reset first response time */ 199 pjsua.calls[call_index].res_time.sec = 0; 200 195 201 /* Create outgoing dialog: */ 196 197 202 status = pjsip_dlg_create_uac( pjsip_ua_instance(), 198 203 &pjsua.acc[acc_index].local_uri, … … 359 364 } 360 365 366 /* Mark call start time. */ 367 pj_gettimeofday(&pjsua.calls[call_index].start_time); 368 369 /* Reset first response time */ 370 pjsua.calls[call_index].res_time.sec = 0; 361 371 362 372 /* Get media capability from media endpoint: */ … … 498 508 pjsua_call *call = inv->dlg->mod_data[pjsua.mod.id]; 499 509 510 if (!call) 511 return; 512 513 /* Get call times */ 514 switch (inv->state) { 515 case PJSIP_INV_STATE_EARLY: 516 case PJSIP_INV_STATE_CONNECTING: 517 if (call->res_time.sec == 0) 518 pj_gettimeofday(&call->res_time); 519 break; 520 case PJSIP_INV_STATE_CONFIRMED: 521 pj_gettimeofday(&call->conn_time); 522 break; 523 case PJSIP_INV_STATE_DISCONNECTED: 524 pj_gettimeofday(&call->dis_time); 525 break; 526 } 527 500 528 /* If this is an outgoing INVITE that was created because of 501 529 * REFER/transfer, send NOTIFY to transferer. 502 530 */ 503 if (call && call->xfer_sub && e->type==PJSIP_EVENT_TSX_STATE) {531 if (call->xfer_sub && e->type==PJSIP_EVENT_TSX_STATE) { 504 532 int st_code = -1; 505 533 pjsip_evsub_state ev_state = PJSIP_EVSUB_STATE_ACTIVE; -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_settings.c
r393 r398 694 694 PJ_LOG(3,(THIS_FILE, 695 695 " RX pt=%d, stat last update: %s\n" 696 " total %s packets %sB received(%sB +IP hdr)%s\n"696 " total %spkt %sB (%sB +IP hdr)%s\n" 697 697 " pkt loss=%d (%3.1f%%), dup=%d (%3.1f%%), reorder=%d (%3.1f%%)%s\n" 698 698 " (msec) min avg max last\n" … … 739 739 PJ_LOG(3,(THIS_FILE, 740 740 " TX pt=%d, stat last update: %s\n" 741 " total %s packets %sB received(%sB +IP hdr)%s\n"741 " total %spkt %sB (%sB +IP hdr)%s\n" 742 742 " pkt loss=%d (%3.1f%%), dup=%d (%3.1f%%), reorder=%d (%3.1f%%)%s\n" 743 743 " (msec) min avg max last\n" … … 816 816 for (i=0; i<pjsua.max_calls; ++i) { 817 817 818 if (pjsua.calls[i].inv == NULL) 818 pjsua_call *call = &pjsua.calls[i]; 819 pj_time_val duration, res_delay, con_delay; 820 821 if (call->inv == NULL) 819 822 continue; 820 823 … … 822 825 PJ_LOG(3,(THIS_FILE, "%s", buf)); 823 826 824 if (pjsua.calls[i].session) 825 dump_media_session(pjsua.calls[i].session); 827 /* Calculate call duration */ 828 if (call->inv->state >= PJSIP_INV_STATE_CONFIRMED) { 829 pj_gettimeofday(&duration); 830 PJ_TIME_VAL_SUB(duration, call->conn_time); 831 con_delay = call->conn_time; 832 PJ_TIME_VAL_SUB(con_delay, call->start_time); 833 } else { 834 duration.sec = duration.msec = 0; 835 con_delay.sec = con_delay.msec = 0; 836 } 837 838 /* Calculate first response delay */ 839 if (call->inv->state >= PJSIP_INV_STATE_EARLY) { 840 res_delay = call->res_time; 841 PJ_TIME_VAL_SUB(res_delay, call->start_time); 842 } else { 843 res_delay.sec = res_delay.msec = 0; 844 } 845 846 /* Print duration */ 847 PJ_LOG(3,(THIS_FILE, 848 " Call time: %02dh:%02dm:%02ds, " 849 "1st res in %d ms, conn in %dms", 850 (duration.sec / 3600), 851 ((duration.sec % 3600)/60), 852 (duration.sec % 60), 853 PJ_TIME_VAL_MSEC(res_delay), 854 PJ_TIME_VAL_MSEC(con_delay))); 855 856 /* Dump session statistics */ 857 if (call->session) 858 dump_media_session(call->session); 826 859 } 827 860 }
Note: See TracChangeset
for help on using the changeset viewer.