Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 362425) +++ channels/chan_sip.c (working copy) @@ -6611,8 +6611,13 @@ ast_set_flag(&p->flags[0], SIP_PROGRESS_SENT); } } - p->lastrtptx = time(NULL); - res = ast_rtp_instance_write(p->rtp, frame); + /* If this media is not too premature, pass it on */ + if (p->invitestate > INV_EARLY_MEDIA || + ((!global_prematuremediafilter || ast_test_flag(&p->flags[0], SIP_PROG_INBAND) == SIP_PROG_INBAND_YES) && + p->invitestate == INV_EARLY_MEDIA)) { + p->lastrtptx = time(NULL); + res = ast_rtp_instance_write(p->rtp, frame); + } } sip_pvt_unlock(p); } @@ -6629,8 +6634,13 @@ transmit_provisional_response(p, "183 Session Progress", &p->initreq, TRUE); ast_set_flag(&p->flags[0], SIP_PROGRESS_SENT); } - p->lastrtptx = time(NULL); - res = ast_rtp_instance_write(p->vrtp, frame); + /* If this media is not too premature, pass it on */ + if (p->invitestate > INV_EARLY_MEDIA || + ((!global_prematuremediafilter || ast_test_flag(&p->flags[0], SIP_PROG_INBAND) == SIP_PROG_INBAND_YES) && + p->invitestate == INV_EARLY_MEDIA)) { + p->lastrtptx = time(NULL); + res = ast_rtp_instance_write(p->vrtp, frame); + } } sip_pvt_unlock(p); } @@ -6650,8 +6660,13 @@ transmit_provisional_response(p, "183 Session Progress", &p->initreq, TRUE); ast_set_flag(&p->flags[0], SIP_PROGRESS_SENT); } - p->lastrtptx = time(NULL); - res = ast_rtp_instance_write(p->trtp, frame); + /* If this media is not too premature, pass it on */ + if (p->invitestate > INV_EARLY_MEDIA || + ((!global_prematuremediafilter || ast_test_flag(&p->flags[0], SIP_PROG_INBAND) == SIP_PROG_INBAND_YES) && + p->invitestate == INV_EARLY_MEDIA)) { + p->lastrtptx = time(NULL); + res = ast_rtp_instance_write(p->trtp, frame); + } } } sip_pvt_unlock(p);