From 90bbdfb85e44e2be7a185a7f8288bd50371d735a Mon Sep 17 00:00:00 2001 From: Liong Sauw Ming Date: Wed, 28 Sep 2011 04:20:30 +0000 Subject: Re #1266: Fixed failed automated tests for ICE git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3775 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip/src/pjsua-lib/pjsua_media.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'pjsip/src/pjsua-lib/pjsua_media.c') diff --git a/pjsip/src/pjsua-lib/pjsua_media.c b/pjsip/src/pjsua-lib/pjsua_media.c index 626965b5..aee2f1f4 100644 --- a/pjsip/src/pjsua-lib/pjsua_media.c +++ b/pjsip/src/pjsua-lib/pjsua_media.c @@ -1414,16 +1414,24 @@ pj_status_t pjsua_call_media_init(pjsua_call_media *call_med, if (pjsua_var.media_cfg.enable_ice) { status = create_ice_media_transport(tcfg, call_med, async); + if (async && status == PJ_SUCCESS) { + /* Callback has been called. */ + call_med->med_init_cb = NULL; + /* We cannot return PJ_SUCCESS here since we already call + * the callback. + */ + return PJ_EPENDING; + } else if (async && status == PJ_EPENDING) { + /* We will resume call media initialization in the + * on_ice_complete() callback. + */ + return PJ_EPENDING; + } } else { status = create_udp_media_transport(tcfg, call_med); } - if (status == PJ_EPENDING) { - /* We will resume call media initialization in the - * on_ice_complete() callback. - */ - return PJ_EPENDING; - } else if (status != PJ_SUCCESS) { + if (status != PJ_SUCCESS) { PJ_PERROR(1,(THIS_FILE, status, "Error creating media transport")); return status; } -- cgit v1.2.3