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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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) 
Note: See TracChangeset for help on using the changeset viewer.