}
who = ast_waitfor_n(cs, 2, &toms);
if (!who) {
+ if (!toms) {
+ res = AST_BRIDGE_RETRY;
+ break;
+ }
ast_log(LOG_DEBUG, "Nobody there, continuing...\n");
if (c0->_softhangup == AST_SOFTHANGUP_UNBRIDGE || c1->_softhangup == AST_SOFTHANGUP_UNBRIDGE) {
if (c0->_softhangup == AST_SOFTHANGUP_UNBRIDGE)
- c0->_softhangup = 0;
- if (c1->_softhangup == AST_SOFTHANGUP_UNBRIDGE)
- c1->_softhangup = 0;
+ c0->_softhangup = 0;
+ if (c1->_softhangup == AST_SOFTHANGUP_UNBRIDGE)
+ c1->_softhangup = 0;
c0->_bridge = c1;
c1->_bridge = c0;
}
ast_clear_flag(c0, AST_FLAG_NBRIDGE);
ast_clear_flag(c1, AST_FLAG_NBRIDGE);
}
-
+ if (res == AST_BRIDGE_RETRY)
+ continue;
switch (res) {
case AST_BRIDGE_RETRY:
/* continue; */
timeoutms = 0;
}
if (!who) {
+ if (!timeoutms) {
+ res = AST_BRIDGE_RETRY;
+ break;
+ }
if (ast_check_hangup(c0) || ast_check_hangup(c1)) {
res = AST_BRIDGE_FAILED;
break;
/* Are we really ment to be doing nothing ?!?! */
who = ast_waitfor_n(cs, 2, &timeoutms);
if (!who) {
+ if (!timeoutms) {
+ res = AST_BRIDGE_RETRY;
+ break;
+ }
ast_log(LOG_DEBUG, "%s: vpb_bridge: Empty frame read...\n",p0->dev);
/* check for hangup / whentohangup */
if (ast_check_hangup(c0) || ast_check_hangup(c1))
ast_mutex_unlock(&c0->lock);
ast_mutex_unlock(&c1->lock);
- if ((op0 != p0) ||
+ if (!timeoutms ||
+ (op0 != p0) ||
(op1 != p1) ||
(ofd0 != c0->fds[0]) ||
(ofd1 != c1->fds[0]) ||
}
who = ast_waitfor_n(cs, 2, &timeoutms);
if (!who) {
+ if (!timeoutms)
+ return AST_BRIDGE_RETRY;
if (option_debug)
ast_log(LOG_DEBUG, "Ooh, empty read...\n");
/* check for hangup / whentohangup */