diff --git a/main/rtp.c b/main/rtp.c index 2ba7ee0de4861aebe670055296bb908c97cb4daa..8631a4d77ec82794b0f3674a4afbcc756c288302 100644 --- a/main/rtp.c +++ b/main/rtp.c @@ -2807,7 +2807,8 @@ static int p2p_callback_enable(struct ast_channel *chan, struct ast_rtp *rtp, in /* Now, fire up callback mode */ iod[0] = ast_io_add(rtp->io, fds[0], p2p_rtp_callback, AST_IO_IN, rtp); - iod[1] = ast_io_add(rtp->io, fds[1], p2p_rtp_callback, AST_IO_IN, rtp); + if (fds[1] >= 0) + iod[1] = ast_io_add(rtp->io, fds[1], p2p_rtp_callback, AST_IO_IN, rtp); return 1; }