Fix "duplicate answer" issue (bug #2342)
authorMark Spencer <markster@digium.com>
Thu, 2 Sep 2004 13:48:11 +0000 (13:48 +0000)
committerMark Spencer <markster@digium.com>
Thu, 2 Sep 2004 13:48:11 +0000 (13:48 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3710 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channel.c
channels/chan_sip.c

index 5c3b4a1..dd5a800 100755 (executable)
--- a/channel.c
+++ b/channel.c
@@ -1359,6 +1359,10 @@ struct ast_frame *ast_read(struct ast_channel *chan)
                        ast_log(LOG_WARNING, "Dropping deferred DTMF digits on %s\n", chan->name);
                f = &null_frame;
        } else if ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_ANSWER)) {
                        ast_log(LOG_WARNING, "Dropping deferred DTMF digits on %s\n", chan->name);
                f = &null_frame;
        } else if ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_ANSWER)) {
+               if (chan->_state == AST_STATE_UP) {
+                       ast_log(LOG_DEBUG, "Dropping duplicate answer!\n");
+                       f = &null_frame;
+               }
                /* Answer the CDR */
                ast_setstate(chan, AST_STATE_UP);
                ast_cdr_answer(chan->cdr);
                /* Answer the CDR */
                ast_setstate(chan, AST_STATE_UP);
                ast_cdr_answer(chan->cdr);
index 95802c7..cd0fb4c 100755 (executable)
@@ -6580,7 +6580,6 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_
 #ifdef OSP_SUPPORT     
                                                time(&p->ospstart);
 #endif
 #ifdef OSP_SUPPORT     
                                                time(&p->ospstart);
 #endif
-                                               ast_setstate(p->owner, AST_STATE_UP);
                                                ast_queue_control(p->owner, AST_CONTROL_ANSWER);
                                        } else {
                                                struct ast_frame af = { AST_FRAME_NULL, };
                                                ast_queue_control(p->owner, AST_CONTROL_ANSWER);
                                        } else {
                                                struct ast_frame af = { AST_FRAME_NULL, };