summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2006-02-27 23:54:23 +0000
committerBenny Prijono <bennylp@teluu.com>2006-02-27 23:54:23 +0000
commitbb660e1ca59d104bcc981c57f5662bf5e5479678 (patch)
treee64710e3622962063583848a3ee69e35b66e1e2c
parentcd020559b176946aae94d92a1c3e8e36890022e0 (diff)
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
-rw-r--r--pjsip/src/pjsua-lib/pjsua_core.c36
1 files changed, 22 insertions, 14 deletions
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) {