Changeset 831


Ignore:
Timestamp:
Nov 25, 2006 2:50:25 PM (17 years ago)
Author:
bennylp
Message:

Print media statistic when call is disconnected in pjsua, to assist tracing media problems

Location:
pjproject/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/config.c

    r798 r831  
    2222 
    2323static const char *id = "config.c"; 
    24 const char *PJ_VERSION = "0.5.8.5"; 
     24const char *PJ_VERSION = "0.5.8.9"; 
    2525 
    2626PJ_DEF(void) pj_dump_config(void) 
  • pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c

    r798 r831  
    13281328        } 
    13291329 
     1330        /* Dump media state upon disconnected */ 
     1331        if (1) { 
     1332            char buf[1024]; 
     1333            pjsua_call_dump(call_id, PJ_TRUE, buf,  
     1334                            sizeof(buf), "  "); 
     1335            PJ_LOG(5,(THIS_FILE,  
     1336                      "Call %d disconnected, dumping media stats\n%s",  
     1337                      call_id, buf)); 
     1338        } 
     1339 
    13301340    } else { 
    13311341 
     
    13441354        } 
    13451355 
    1346         PJ_LOG(3,(THIS_FILE, "Call %d state changed to %s",  
    1347                   call_id, 
    1348                   call_info.state_text.ptr)); 
     1356        if (call_info.state == PJSIP_INV_STATE_EARLY) { 
     1357            int code; 
     1358            pj_str_t reason; 
     1359            pjsip_msg *msg; 
     1360 
     1361            /* This can only occur because of TX or RX message */ 
     1362            pj_assert(e->type == PJSIP_EVENT_TSX_STATE); 
     1363 
     1364            if (e->body.tsx_state.type == PJSIP_EVENT_RX_MSG) { 
     1365                msg = e->body.tsx_state.src.rdata->msg_info.msg; 
     1366            } else { 
     1367                msg = e->body.tsx_state.src.tdata->msg; 
     1368            } 
     1369 
     1370            code = msg->line.status.code; 
     1371            reason = msg->line.status.reason; 
     1372 
     1373            PJ_LOG(3,(THIS_FILE, "Call %d state changed to %s (%d %.*s)",  
     1374                      call_id, call_info.state_text.ptr, 
     1375                      code, (int)reason.slen, reason.ptr)); 
     1376        } else { 
     1377            PJ_LOG(3,(THIS_FILE, "Call %d state changed to %s",  
     1378                      call_id, 
     1379                      call_info.state_text.ptr)); 
     1380        } 
    13491381 
    13501382        if (current_call==PJSUA_INVALID_ID) 
  • pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c

    r797 r831  
    3636static const char *inv_state_names[] = 
    3737{ 
    38     "NULL      ", 
    39     "CALLING   ", 
    40     "INCOMING  ", 
    41     "EARLY     ", 
     38    "NULL", 
     39    "CALLING", 
     40    "INCOMING", 
     41    "EARLY", 
    4242    "CONNECTING", 
    4343    "CONFIRMED ", 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c

    r813 r831  
    9191    call->last_text.ptr = call->last_text_buf_; 
    9292    call->last_text.slen = 0; 
     93    call->conn_time.sec = 0; 
     94    call->conn_time.msec = 0; 
     95    call->res_time.sec = 0; 
     96    call->res_time.msec = 0; 
    9397} 
    9498 
     
    17771781 
    17781782    /* Calculate call duration */ 
    1779     if (call->inv->state >= PJSIP_INV_STATE_CONFIRMED) { 
     1783    if (call->conn_time.sec != 0) { 
    17801784        pj_gettimeofday(&duration); 
    17811785        PJ_TIME_VAL_SUB(duration, call->conn_time); 
     
    17881792 
    17891793    /* Calculate first response delay */ 
    1790     if (call->inv->state >= PJSIP_INV_STATE_EARLY) { 
     1794    if (call->res_time.sec != 0) { 
    17911795        res_delay = call->res_time; 
    17921796        PJ_TIME_VAL_SUB(res_delay, call->start_time); 
     
    19771981        call->inv = NULL; 
    19781982        --pjsua_var.call_cnt; 
     1983 
     1984        /* Reset call */ 
     1985        reset_call(call->index); 
     1986 
    19791987    } 
    19801988 
Note: See TracChangeset for help on using the changeset viewer.