mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-19 00:00:09 +00:00
Make masquerade compatible with timingfd
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1140 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
10
channel.c
10
channel.c
@@ -1041,11 +1041,15 @@ struct ast_frame *ast_read(struct ast_channel *chan)
|
|||||||
data = chan->timingdata;
|
data = chan->timingdata;
|
||||||
pthread_mutex_unlock(&chan->lock);
|
pthread_mutex_unlock(&chan->lock);
|
||||||
if (func) {
|
if (func) {
|
||||||
|
#if 0
|
||||||
|
ast_log(LOG_DEBUG, "Calling private function\n");
|
||||||
|
#endif
|
||||||
func(data);
|
func(data);
|
||||||
} else {
|
} else {
|
||||||
blah = 0;
|
blah = 0;
|
||||||
pthread_mutex_lock(&chan->lock);
|
pthread_mutex_lock(&chan->lock);
|
||||||
ioctl(chan->timingfd, ZT_TIMERCONFIG, &blah);
|
ioctl(chan->timingfd, ZT_TIMERCONFIG, &blah);
|
||||||
|
chan->timingdata = NULL;
|
||||||
pthread_mutex_unlock(&chan->lock);
|
pthread_mutex_unlock(&chan->lock);
|
||||||
}
|
}
|
||||||
f = &null_frame;
|
f = &null_frame;
|
||||||
@@ -1901,8 +1905,9 @@ static int ast_do_masquerade(struct ast_channel *original)
|
|||||||
/* Update the type. */
|
/* Update the type. */
|
||||||
original->type = clone->type;
|
original->type = clone->type;
|
||||||
/* Copy the FD's */
|
/* 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];
|
original->fds[x] = clone->fds[x];
|
||||||
|
}
|
||||||
/* Move the variables */
|
/* Move the variables */
|
||||||
tmpv = original->varshead.first;
|
tmpv = original->varshead.first;
|
||||||
original->varshead.first = clone->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;
|
original->callerid = clone->callerid;
|
||||||
clone->callerid = tmp;
|
clone->callerid = tmp;
|
||||||
|
|
||||||
|
/* Restore original timing file descriptor */
|
||||||
|
original->fds[AST_MAX_FDS - 2] = original->timingfd;
|
||||||
|
|
||||||
/* Our native formats are different now */
|
/* Our native formats are different now */
|
||||||
original->nativeformats = clone->nativeformats;
|
original->nativeformats = clone->nativeformats;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user