diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-05-15 04:06:16 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-05-15 04:06:16 +0000 |
commit | 3a611c8419f65e0aab12ba9f2dcf10a5766580c9 (patch) | |
tree | 6ea5f7e76896e5fffa130c799b1b36e0e2f3271e /rtp.c | |
parent | 85fff2e01dc0428285e89dac3364a88f0b82eefc (diff) |
fix RTP DTMF for Sipura SPA-3000 (bug #3675, yet again)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5666 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'rtp.c')
-rwxr-xr-x | rtp.c | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -1077,21 +1077,25 @@ int ast_rtp_senddigit(struct ast_rtp *rtp, char digit) rtpheader[3] = htonl((digit << 24) | (0xa << 16) | (0)); for (x=0;x<6;x++) { if (rtp->them.sin_port && rtp->them.sin_addr.s_addr) { - res = sendto(rtp->s, (void *)rtpheader, hdrlen + 4, 0, (struct sockaddr *)&rtp->them, sizeof(rtp->them)); + res = sendto(rtp->s, (void *) rtpheader, hdrlen + 4, 0, (struct sockaddr *) &rtp->them, sizeof(rtp->them)); if (res < 0) - ast_log(LOG_ERROR, "RTP Transmission error to %s:%d: %s\n", ast_inet_ntoa(iabuf, sizeof(iabuf), rtp->them.sin_addr), ntohs(rtp->them.sin_port), strerror(errno)); - if(rtp_debug_test_addr(&rtp->them)) - ast_verbose("Sent RTP packet to %s:%d (type %d, seq %d, ts %d, len %d)\n" - , ast_inet_ntoa(iabuf, sizeof(iabuf), rtp->them.sin_addr), ntohs(rtp->them.sin_port), payload, rtp->seqno, rtp->lastdigitts, res - hdrlen); - + ast_log(LOG_ERROR, "RTP Transmission error to %s:%d: %s\n", + ast_inet_ntoa(iabuf, sizeof(iabuf), rtp->them.sin_addr), + ntohs(rtp->them.sin_port), strerror(errno)); + if (rtp_debug_test_addr(&rtp->them)) + ast_verbose("Sent RTP packet to %s:%d (type %d, seq %d, ts %d, len %d)\n", + ast_inet_ntoa(iabuf, sizeof(iabuf), rtp->them.sin_addr), + ntohs(rtp->them.sin_port), payload, rtp->seqno, rtp->lastdigitts, res - hdrlen); } /* Clear marker bit and increment seqno */ - rtpheader[0] = htonl((2 << 30) | (payload << 16) | (rtp->seqno++)); + rtpheader[0] = htonl((2 << 30) | (payload << 16) | (rtp->seqno++)); /* For the last three packets, set the duration and the end bit */ if (x == 2) { + rtp->lastdigitts++; /* or else the SPA3000 will click instead of beeping... */ + rtpheader[1] = htonl(rtp->lastdigitts); /* Make duration 800 (100ms) */ rtpheader[3] |= htonl((800)); - /* Set the End bit for the last 3 */ + /* Set the End bit */ rtpheader[3] |= htonl((1 << 23)); } } |