From bb660e1ca59d104bcc981c57f5662bf5e5479678 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Mon, 27 Feb 2006 23:54:23 +0000 Subject: Fixed bug in conference instantiation when max-ports is not properly set git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@247 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip/src/pjsua-lib/pjsua_core.c | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) (limited to 'pjsip') diff --git a/pjsip/src/pjsua-lib/pjsua_core.c b/pjsip/src/pjsua-lib/pjsua_core.c index b09a7c59..c468f85b 100644 --- a/pjsip/src/pjsua-lib/pjsua_core.c +++ b/pjsip/src/pjsua-lib/pjsua_core.c @@ -419,11 +419,19 @@ on_error: static int PJ_THREAD_FUNC pjsua_poll(void *arg) { + pj_status_t last_err = 0; + PJ_UNUSED_ARG(arg); do { pj_time_val timeout = { 0, 10 }; - pjsip_endpt_handle_events (pjsua.endpt, &timeout); + pj_status_t status; + + status = pjsip_endpt_handle_events (pjsua.endpt, &timeout); + if (status != last_err) { + last_err = status; + pjsua_perror(THIS_FILE, "handle_events() returned error", status); + } } while (!pjsua.quit_flag); return 0; @@ -508,19 +516,6 @@ pj_status_t pjsua_init(void) return status; } - /* Init conference bridge. */ - - status = pjmedia_conf_create(pjsua.pool, - pjsua.max_calls+PJSUA_CONF_MORE_PORTS, - 8000, 160, 16, &pjsua.mconf); - if (status != PJ_SUCCESS) { - pj_caching_pool_destroy(&pjsua.cp); - pjsua_perror(THIS_FILE, - "Media stack initialization has returned error", - status); - return status; - } - /* Init pjmedia-codecs: */ status = pjmedia_codec_init(pjsua.med_endpt); @@ -610,6 +605,19 @@ pj_status_t pjsua_start(void) pjsip_transport *udp_transport; pj_status_t status = PJ_SUCCESS; + /* Init conference bridge. */ + + status = pjmedia_conf_create(pjsua.pool, + pjsua.max_calls+PJSUA_CONF_MORE_PORTS, + 8000, 160, 16, &pjsua.mconf); + if (status != PJ_SUCCESS) { + pj_caching_pool_destroy(&pjsua.cp); + pjsua_perror(THIS_FILE, + "Media stack initialization has returned error", + status); + return status; + } + /* Create WAV file player if required: */ if (pjsua.wav_file) { -- cgit v1.2.3