diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c index fad313c2b6..57dd8a3066 100644 --- a/res/res_rtp_asterisk.c +++ b/res/res_rtp_asterisk.c @@ -1386,11 +1386,10 @@ static int ast_rtp_dtmf_continuation(struct ast_rtp_instance *instance) } /* Actually create the packet we will be sending */ - rtpheader[0] = htonl((2 << 30) | (1 << 23) | (rtp->send_payload << 16) | (rtp->seqno)); + rtpheader[0] = htonl((2 << 30) | (rtp->send_payload << 16) | (rtp->seqno)); rtpheader[1] = htonl(rtp->lastdigitts); rtpheader[2] = htonl(rtp->ssrc); rtpheader[3] = htonl((rtp->send_digit << 24) | (0xa << 16) | (rtp->send_duration)); - rtpheader[0] = htonl((2 << 30) | (rtp->send_payload << 16) | (rtp->seqno)); /* Boom, send it on out */ res = rtp_sendto(instance, (void *) rtpheader, hdrlen + 4, 0, &remote_address, &ice); @@ -1456,18 +1455,18 @@ static int ast_rtp_dtmf_end_with_duration(struct ast_rtp_instance *instance, cha } /* Construct the packet we are going to send */ - rtpheader[0] = htonl((2 << 30) | (1 << 23) | (rtp->send_payload << 16) | (rtp->seqno)); rtpheader[1] = htonl(rtp->lastdigitts); rtpheader[2] = htonl(rtp->ssrc); rtpheader[3] = htonl((digit << 24) | (0xa << 16) | (rtp->send_duration)); rtpheader[3] |= htonl((1 << 23)); - rtpheader[0] = htonl((2 << 30) | (rtp->send_payload << 16) | (rtp->seqno)); /* Send it 3 times, that's the magical number */ for (i = 0; i < 3; i++) { int ice; - res = rtp_sendto(instance, (void *) rtpheader, hdrlen + 4, 0, &remote_address, &ice); + rtpheader[0] = htonl((2 << 30) | (rtp->send_payload << 16) | (rtp->seqno)); + + res = rtp_sendto(instance, (void *) rtpheader, hdrlen + 4, 0, &remote_address); if (res < 0) { ast_log(LOG_ERROR, "RTP Transmission error to %s: %s\n", @@ -1483,6 +1482,8 @@ static int ast_rtp_dtmf_end_with_duration(struct ast_rtp_instance *instance, cha ice ? " (via ICE)" : "", rtp->send_payload, rtp->seqno, rtp->lastdigitts, res - hdrlen); } + + rtp->seqno++; } /* Oh and we can't forget to turn off the stuff that says we are sending DTMF */