From daf2b65313488296bb1a563d6189a0e6774304af Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Fri, 23 Jun 2006 15:04:11 +0000 Subject: Fixed 1st response time not initialized for UAS call in pjsua git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@549 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip/src/pjsua-lib/pjsua_call.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c index 208cb97e..a745f76a 100644 --- a/pjsip/src/pjsua-lib/pjsua_call.c +++ b/pjsip/src/pjsua-lib/pjsua_call.c @@ -472,7 +472,6 @@ pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata) /* Must answer with some response to initial INVITE. - * If auto-answer flag is set, send 200 straight away, otherwise send 100. */ status = pjsip_inv_initial_answer(inv, rdata, 100, NULL, NULL, &response); @@ -713,6 +712,9 @@ PJ_DEF(pj_status_t) pjsua_call_answer( pjsua_call_id call_id, return PJSIP_ESESSIONTERMINATED; } + if (call->res_time.sec == 0) + pj_gettimeofday(&call->res_time); + /* Create response message */ status = pjsip_inv_answer(call->inv, code, reason, NULL, &tdata); if (status != PJ_SUCCESS) { @@ -1587,6 +1589,8 @@ static void pjsua_call_on_state_changed(pjsip_inv_session *inv, break; case PJSIP_INV_STATE_DISCONNECTED: pj_gettimeofday(&call->dis_time); + if (call->res_time.sec == 0) + pj_gettimeofday(&call->res_time); if (e->body.tsx_state.tsx->status_code > call->last_code) { call->last_code = e->body.tsx_state.tsx->status_code; pj_strncpy(&call->last_text, -- cgit v1.2.3