diff options
-rw-r--r-- | main/channel.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/main/channel.c b/main/channel.c index b3aec0e36..303c42317 100644 --- a/main/channel.c +++ b/main/channel.c @@ -2243,7 +2243,10 @@ int ast_settimeout(struct ast_channel *c, unsigned int rate, int (*func)(const v int res; unsigned int real_rate = rate, max_rate; + ast_channel_lock(c); + if (c->timingfd == -1) { + ast_channel_unlock(c); return -1; } @@ -2263,6 +2266,8 @@ int ast_settimeout(struct ast_channel *c, unsigned int rate, int (*func)(const v c->timingfunc = func; c->timingdata = data; + ast_channel_unlock(c); + return res; } |