From 3cff5c33e4120cbf4319a19bf54d0d6fe55e6ce1 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Wed, 5 Apr 2006 19:08:16 +0000 Subject: Added detection/protection against inaccurate timestamp in RTCP git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@388 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip-apps/src/samples/siprtp.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'pjsip-apps/src/samples/siprtp.c') diff --git a/pjsip-apps/src/samples/siprtp.c b/pjsip-apps/src/samples/siprtp.c index 75b89a25..03fb279f 100644 --- a/pjsip-apps/src/samples/siprtp.c +++ b/pjsip-apps/src/samples/siprtp.c @@ -175,7 +175,8 @@ static void destroy_call_media(unsigned call_index); static void app_perror(const char *sender, const char *title, pj_status_t status); - +/* Print call */ +static void print_call(int call_index); /* This is a PJSIP module to be registered by application to handle @@ -675,6 +676,13 @@ static void call_on_state_changed( pjsip_inv_session *inv, pj_time_val null_time = {0, 0}; + PJ_LOG(3,(THIS_FILE, "Call #%d disconnected. Reason=%s", + call->index, + pjsip_get_status_text(inv->cause)->ptr)); + PJ_LOG(3,(THIS_FILE, "Call #%d statistics:", call->index)); + print_call(call->index); + + call->inv = NULL; inv->mod_data[mod_siprtp.id] = NULL; @@ -684,9 +692,6 @@ static void call_on_state_changed( pjsip_inv_session *inv, call->response_time = null_time; call->connect_time = null_time; - PJ_LOG(3,(THIS_FILE, "Call #%d disconnected. Reason=%s", - call->index, - pjsip_get_status_text(inv->cause)->ptr)); } else if (inv->state == PJSIP_INV_STATE_CONFIRMED) { @@ -1471,7 +1476,7 @@ static void print_call(int call_index) } - if (call->media[0].thread == NULL) { + if (call->inv == NULL || call->inv->state < PJSIP_INV_STATE_CONFIRMED) { return; } -- cgit v1.2.3