diff options
author | root <root@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-06-12 16:04:02 +0000 |
---|---|---|
committer | root <root@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-06-12 16:04:02 +0000 |
commit | cff9b3e158d46f3ee5bcf6c996178bf2486658be (patch) | |
tree | a11489ab4a2faeb5ea264621508150cca9d9e95b | |
parent | afb2f1a385132c3b0b8297c3be12e1e2adac20a3 (diff) |
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@33642 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | channels/chan_local.c | 14 | ||||
-rw-r--r-- | res/res_agi.c | 6 |
2 files changed, 16 insertions, 4 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c index 14ef083f6..8dc46033c 100644 --- a/channels/chan_local.c +++ b/channels/chan_local.c @@ -186,7 +186,13 @@ static void check_bridge(struct local_pvt *p, int isoutbound) return; if (!p->chan || !p->owner) return; - if (isoutbound&& p->chan->_bridge /* Not ast_bridged_channel! Only go one step! */ && !p->owner->readq) { + + /* only do the masquerade if we are being called on the outbound channel, + if it has been bridged to another channel and if there are no pending + frames on the owner channel (because they would be transferred to the + outbound channel during the masquerade) + */ + if (isoutbound && p->chan->_bridge /* Not ast_bridged_channel! Only go one step! */ && !p->owner->readq) { /* Masquerade bridged channel into owner */ /* Lock everything we need, one by one, and give up if we can't get everything. Remember, we'll get another @@ -203,6 +209,11 @@ static void check_bridge(struct local_pvt *p, int isoutbound) ast_mutex_unlock(&(p->chan->_bridge)->lock); } } + /* We only allow masquerading in one 'direction'... it's important to preserve the state + (group variables, etc.) that live on p->chan->_bridge (and were put there by the dialplan) + when the local channels go away. + */ +#if 0 } else if (!isoutbound && p->owner && p->owner->_bridge && p->chan && !p->chan->readq) { /* Masquerade bridged channel into chan */ if (!ast_mutex_trylock(&(p->owner->_bridge)->lock)) { @@ -217,6 +228,7 @@ static void check_bridge(struct local_pvt *p, int isoutbound) } ast_mutex_unlock(&(p->owner->_bridge)->lock); } +#endif } } diff --git a/res/res_agi.c b/res/res_agi.c index ddfabb357..5d2a029e1 100644 --- a/res/res_agi.c +++ b/res/res_agi.c @@ -282,6 +282,9 @@ static int launch_script(char *script, char *argv[], int *fds, int *efd, int *op return -1; } if (!pid) { + /* Don't run AGI scripts with realtime priority -- it causes audio stutter */ + ast_set_priority(0); + /* Redirect stdin and out, provide enhanced audio channel if desired */ dup2(fromast[0], STDIN_FILENO); dup2(toast[1], STDOUT_FILENO); @@ -301,9 +304,6 @@ static int launch_script(char *script, char *argv[], int *fds, int *efd, int *op for (x=STDERR_FILENO + 2;x<1024;x++) close(x); - /* Don't run AGI scripts with realtime priority -- it causes audio stutter */ - ast_set_priority(0); - /* Execute script */ execv(script, argv); /* Can't use ast_log since FD's are closed */ |