aboutsummaryrefslogtreecommitdiffstats
path: root/main/features.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2009-03-17 14:40:44 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2009-03-17 14:40:44 +0000
commit5fca5537305707415670af5ba7277353bd4a7e9f (patch)
treecb3260a83dc0ce644eafdbb8777bd60cb24ff136 /main/features.c
parentcb09365667c0bbaea57a84ef4803ee05c9e811fd (diff)
Merged revisions 182525 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r182525 | kpfleming | 2009-03-17 09:38:11 -0500 (Tue, 17 Mar 2009) | 11 lines Improve behavior of ast_answer() to not lose incoming frames ast_answer(), when supplied a delay before returning to the caller, use ast_safe_sleep() to implement the delay. Unfortunately during this time any incoming frames are discarded, which is problematic for T.38 re-INVITES and other sorts of channel operations. When a delay is not passed to ast_answer(), it still delays for up to 500 milliseconds, waiting for media to arrive. Again, though, it discards any control frames, or non-voice media frames. This patch rectifies this situation, by storing all incoming frames during the delay period on a list, and then requeuing them onto the channel before returning to the caller. http://reviewboard.digium.com/r/196/ ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@182528 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/features.c')
-rw-r--r--main/features.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/main/features.c b/main/features.c
index 4a8a3453a..91d90fe3a 100644
--- a/main/features.c
+++ b/main/features.c
@@ -2477,8 +2477,11 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast
config->firstpass = 1;
/* Answer if need be */
- if (ast_answer(chan))
- return -1;
+ if (chan->_state != AST_STATE_UP) {
+ if (ast_raw_answer(chan, 1)) {
+ return -1;
+ }
+ }
ast_copy_string(orig_channame,chan->name,sizeof(orig_channame));
ast_copy_string(orig_peername,peer->name,sizeof(orig_peername));