From eedb95190afc53d91552a22088e7ccd7f1d4ee3e Mon Sep 17 00:00:00 2001 From: Nanang Izzuddin Date: Mon, 21 Apr 2014 05:40:32 +0000 Subject: Fix #1759: Added check for call disconnection in ICE media transport creation. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4820 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip/src/pjsua-lib/pjsua_media.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pjsip/src/pjsua-lib/pjsua_media.c b/pjsip/src/pjsua-lib/pjsua_media.c index 4beb821c..791126a0 100644 --- a/pjsip/src/pjsua-lib/pjsua_media.c +++ b/pjsip/src/pjsua-lib/pjsua_media.c @@ -851,7 +851,15 @@ static pj_status_t create_ice_media_transport( PJSUA_LOCK(); } - if (async && call_med->tp_ready == PJ_EPENDING) { + if (!call_med->tp) { + /* Call has been disconnected, and media transports have been cleared + * (see ticket #1759). + */ + PJ_LOG(4,(THIS_FILE, "Media transport initialization cancelled " + "because call has been disconnected")); + status = PJ_ECANCELLED; + goto on_error; + } else if (async && call_med->tp_ready == PJ_EPENDING) { return PJ_EPENDING; } else if (call_med->tp_ready != PJ_SUCCESS) { pjsua_perror(THIS_FILE, "Error initializing ICE media transport", -- cgit v1.2.3