static int worker_thread_timer(void *arg)
{
    pj_timer_heap_t *th;

    PJ_UNUSED_ARG(arg);

    th = pjsip_endpt_get_timer_heap(pjsua_var.endpt);
    while (!pjsua_var.thread_quit_flag) {
	pj_time_val timeout = {0, 0};
	int c;

	c = pj_timer_heap_poll(th, &timeout);
	if (c == 0) {
	    /* Sleep if no event */
	    enum { MAX_SLEEP_MS = 100 };
	    if (PJ_TIME_VAL_MSEC(timeout) < MAX_SLEEP_MS)
		pj_thread_sleep(PJ_TIME_VAL_MSEC(timeout));
	    else
		pj_thread_sleep(MAX_SLEEP_MS);
	}
    }
    return 0;
}
static int worker_thread_timer(void *arg)
{
    pj_timer_heap_t *th;

    PJ_UNUSED_ARG(arg);

    th = pjsip_endpt_get_timer_heap(pjsua_var.endpt);
    while (!pjsua_var.thread_quit_flag) {
	pj_time_val timeout = {0, 0};
	int c;

	c = pj_timer_heap_poll(th, &timeout);
	if (c == 0) {
	     
	    enum { MAX_SLEEP_MS = 100 };
	    if (PJ_TIME_VAL_MSEC(timeout) < MAX_SLEEP_MS)
		pj_thread_sleep(PJ_TIME_VAL_MSEC(timeout));
	    else
		pj_thread_sleep(MAX_SLEEP_MS);
	}
    }
    return 0;
}