]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
don't drop any voice frames when checking for T.38 during early media
authorMatthew Nicholson <mnicholson@digium.com>
Thu, 9 Jun 2011 17:37:07 +0000 (17:37 +0000)
committerMatthew Nicholson <mnicholson@digium.com>
Thu, 9 Jun 2011 17:37:07 +0000 (17:37 +0000)
(closes issue ASTERISK-17705)
Review: https://reviewboard.asterisk.org/r/1186/
patch by oej
reported by oej

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@322807 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index ad8997e8bf3afb4412bc744f7a5148172437a4e3..b673fb091df9bb2fb64b85fd34ba49cf38d74085 100644 (file)
@@ -6294,7 +6294,11 @@ static int sip_write(struct ast_channel *ast, struct ast_frame *frame)
                }
                if (p) {
                        sip_pvt_lock(p);
-                       if (p->rtp) {
+                       if (p->t38.state == T38_ENABLED) {
+                               /* drop frame, can't sent VOICE frames while in T.38 mode */
+                               sip_pvt_unlock(p);
+                               break;
+                       } else if (p->rtp) {
                                /* If channel is not up, activate early media session */
                                if ((ast->_state != AST_STATE_UP) &&
                                    !ast_test_flag(&p->flags[0], SIP_PROGRESS_SENT) &&
@@ -6305,12 +6309,9 @@ static int sip_write(struct ast_channel *ast, struct ast_frame *frame)
                                                transmit_provisional_response(p, "183 Session Progress", &p->initreq, TRUE);
                                                ast_set_flag(&p->flags[0], SIP_PROGRESS_SENT);
                                        }
-                               } else if (p->t38.state == T38_ENABLED) {
-                                       /* drop frame, can't sent VOICE frames while in T.38 mode */
-                               } else {
-                                       p->lastrtptx = time(NULL);
-                                       res = ast_rtp_instance_write(p->rtp, frame);
                                }
+                               p->lastrtptx = time(NULL);
+                               res = ast_rtp_instance_write(p->rtp, frame);
                        }
                        sip_pvt_unlock(p);
                }