aboutsummaryrefslogtreecommitdiffstats
path: root/rtp.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-07-31 20:31:11 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-07-31 20:31:11 +0000
commitf6cbd1f4fe8440a22997e62eeedcfdb907dd9859 (patch)
tree6a11d81ed59ecf88a72cded0c8dfbc9d22482ca4 /rtp.c
parentf377485e3f6bb2b422bc828a349e52b4680e1793 (diff)
Don't hard code the RTP payload type to 101 (bug #2192)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3552 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'rtp.c')
-rwxr-xr-xrtp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/rtp.c b/rtp.c
index 3d0c51388..55a4e3578 100755
--- a/rtp.c
+++ b/rtp.c
@@ -965,6 +965,7 @@ int ast_rtp_senddigit(struct ast_rtp *rtp, char digit)
int res;
int ms;
int x;
+ int payload;
char data[256];
char iabuf[INET_ADDRSTRLEN];
@@ -982,7 +983,7 @@ int ast_rtp_senddigit(struct ast_rtp *rtp, char digit)
ast_log(LOG_WARNING, "Don't know how to represent '%c'\n", digit);
return -1;
}
-
+ payload = ast_rtp_lookup_code(rtp, 0, AST_RTP_DTMF);
/* If we have no peer, return immediately */
if (!rtp->them.sin_addr.s_addr)
@@ -1001,7 +1002,7 @@ int ast_rtp_senddigit(struct ast_rtp *rtp, char digit)
/* Get a pointer to the header */
rtpheader = (unsigned int *)data;
- rtpheader[0] = htonl((2 << 30) | (1 << 23) | (101 << 16) | (rtp->seqno++));
+ rtpheader[0] = htonl((2 << 30) | (1 << 23) | (payload << 16) | (rtp->seqno++));
rtpheader[1] = htonl(rtp->lastts);
rtpheader[2] = htonl(rtp->ssrc);
rtpheader[3] = htonl((digit << 24) | (0xa << 16) | (0));