free_call(*callp);
return(NULL);
}
+ fcntl((*callp)->pipe[0], F_SETFL, O_NONBLOCK);
CDEBUG(*callp, NULL, "Call instance allocated.\n");
return(*callp);
}
bchannel_pipeline(call->bchannel, call->pipeline);
break;
case 'r':
- if (opt[1] == '\0') {
+ if (opt[1] != '\0') {
CERROR(call, call->ast, "Option 'r' (re-buffer 160 bytes) expects no parameter.\n", opt);
break;
}
}
call->pbx_started = 1;
// if (call->state == CHAN_LCR_STATE_IN_DIALING)
-// ast_setstate(ast, AST_STATE_DIALING);
+ ast_setstate(ast, AST_STATE_RINGING);
// else
-// ast_setstate(ast, AST_STATE_OFFHOOK);
- return;
+// ast_setstate(ast, AST_STATE_RINGING);
+// return;
}
/*
} else {
len = read(call->pipe[0], call->read_buff, sizeof(call->read_buff));
}
+ if (len < 0 && errno == EAGAIN) {
+ ast_mutex_unlock(&chan_lock);
+ return &ast_null_frame;
+ }
if (len <= 0) {
close(call->pipe[0]);
call->pipe[0] = -1;
+ ast_mutex_unlock(&chan_lock);
return NULL;
}
}