aboutsummaryrefslogtreecommitdiffstats
path: root/main/rtp.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-10 16:06:59 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-10 16:06:59 +0000
commita51ab8f60cd6930a8178277657c4a55248239681 (patch)
treeb300957a2d76ca1d184d7621a640f57074846c0a /main/rtp.c
parent4a90fc41fd7859f847c93cb01514fcc9ab5f2de9 (diff)
Merged revisions 162653 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r162653 | file | 2008-12-10 12:05:29 -0400 (Wed, 10 Dec 2008) | 6 lines Increment the sequence number on the end packets for RFC2833. After reading the RFC some more and doing some testing I agree with this change. (closes issue #12983) Reported by: vt Patches: dtmf_inc_seqnum_on_end_pkts.diff uploaded by vt (license 520) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@162656 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/rtp.c')
-rw-r--r--main/rtp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/main/rtp.c b/main/rtp.c
index e5c4a7bef..c613aac17 100644
--- a/main/rtp.c
+++ b/main/rtp.c
@@ -3151,16 +3151,17 @@ int ast_rtp_senddigit_end(struct ast_rtp *rtp, char digit)
rtp->dtmfmute = ast_tvadd(ast_tvnow(), ast_tv(0, 500000));
rtpheader = (unsigned int *)data;
- 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));
/* Set end bit */
rtpheader[3] |= htonl((1 << 23));
- rtpheader[0] = htonl((2 << 30) | (rtp->send_payload << 16) | (rtp->seqno));
+
/* Send 3 termination packets */
for (i = 0; i < 3; i++) {
+ rtpheader[0] = htonl((2 << 30) | (rtp->send_payload << 16) | (rtp->seqno));
res = sendto(rtp->s, (void *) rtpheader, hdrlen + 4, 0, (struct sockaddr *) &rtp->them, sizeof(rtp->them));
+ rtp->seqno++;
if (res < 0)
ast_log(LOG_ERROR, "RTP Transmission error to %s:%d: %s\n",
ast_inet_ntoa(rtp->them.sin_addr),
@@ -3173,7 +3174,6 @@ int ast_rtp_senddigit_end(struct ast_rtp *rtp, char digit)
rtp->lastts += rtp->send_duration;
rtp->sending_digit = 0;
rtp->send_digit = 0;
- rtp->seqno++;
return res;
}