Index: addons/chan_ooh323.c =================================================================== --- addons/chan_ooh323.c (revision 398938) +++ addons/chan_ooh323.c (working copy) @@ -591,6 +591,10 @@ static struct ast_channel *ooh323_request(const ch char formats[FORMAT_STRING_SIZE]; int port = 0; + struct timeval tv; + struct timespec ts; + + if (gH323Debug) ast_verb(0, "--- ooh323_request - data %s format %s\n", data, ast_getformatname_multiple(formats,FORMAT_STRING_SIZE,cap)); @@ -748,13 +752,17 @@ static struct ast_channel *ooh323_request(const ch return NULL; } - ast_mutex_unlock(&p->lock); ast_mutex_lock(&ooh323c_cmd_lock); ast_cond_init(&p->rtpcond, NULL); - ooMakeCall(data, p->callToken, AST_MAX_EXTENSION, NULL); - ast_mutex_lock(&p->lock); - if (!p->rtp) { - ast_cond_wait(&p->rtpcond, &p->lock); + + tv = ast_tvnow(); + ts.tv_sec = tv.tv_sec + 3; + ts.tv_nsec = tv.tv_usec * 1000; + + if (ooMakeCall(data, p->callToken, AST_MAX_EXTENSION, NULL) == OO_STKCMD_SUCCESS) { + if (!p->rtp) { + ast_cond_timedwait(&p->rtpcond, &p->lock, &ts); + } } ast_mutex_unlock(&p->lock); ast_cond_destroy(&p->rtpcond);