aboutsummaryrefslogtreecommitdiffstats
path: root/channel.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-06-29 23:23:54 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-06-29 23:23:54 +0000
commita85e25348119219e90ca3ec3895653dc80b0dc42 (patch)
tree5f94c1a50d4d05bc3945751cd23d8b8ece546687 /channel.c
parent4331044ea6ba886f62d4d6d168abeb90903c198e (diff)
Make masquerade compatible with timingfd
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1140 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channel.c')
-rwxr-xr-xchannel.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/channel.c b/channel.c
index fb7d502bc..8d5e9d8c7 100755
--- a/channel.c
+++ b/channel.c
@@ -1041,11 +1041,15 @@ struct ast_frame *ast_read(struct ast_channel *chan)
data = chan->timingdata;
pthread_mutex_unlock(&chan->lock);
if (func) {
+#if 0
+ ast_log(LOG_DEBUG, "Calling private function\n");
+#endif
func(data);
} else {
blah = 0;
pthread_mutex_lock(&chan->lock);
ioctl(chan->timingfd, ZT_TIMERCONFIG, &blah);
+ chan->timingdata = NULL;
pthread_mutex_unlock(&chan->lock);
}
f = &null_frame;
@@ -1901,8 +1905,9 @@ static int ast_do_masquerade(struct ast_channel *original)
/* Update the type. */
original->type = clone->type;
/* Copy the FD's */
- for (x=0;x<AST_MAX_FDS;x++)
+ for (x=0;x<AST_MAX_FDS;x++) {
original->fds[x] = clone->fds[x];
+ }
/* Move the variables */
tmpv = original->varshead.first;
original->varshead.first = clone->varshead.first;
@@ -1931,6 +1936,9 @@ static int ast_do_masquerade(struct ast_channel *original)
original->callerid = clone->callerid;
clone->callerid = tmp;
+ /* Restore original timing file descriptor */
+ original->fds[AST_MAX_FDS - 2] = original->timingfd;
+
/* Our native formats are different now */
original->nativeformats = clone->nativeformats;