summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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) {