Don't hard code the RTP payload type to 101 (bug #2192)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3552 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
parent
096feeeddd
commit
cfcc58d96e
|
@ -158,7 +158,7 @@ void ast_unregister_atexit(void (*func)(void));
|
||||||
|
|
||||||
#define LOCAL_USER_ADD(u) { \
|
#define LOCAL_USER_ADD(u) { \
|
||||||
\
|
\
|
||||||
if (!(u=malloc(sizeof(struct localuser)))) { \
|
if (!(u=(struct localuser *)malloc(sizeof(struct localuser)))) { \
|
||||||
ast_log(LOG_WARNING, "Out of memory\n"); \
|
ast_log(LOG_WARNING, "Out of memory\n"); \
|
||||||
return -1; \
|
return -1; \
|
||||||
} \
|
} \
|
||||||
|
|
5
rtp.c
5
rtp.c
|
@ -965,6 +965,7 @@ int ast_rtp_senddigit(struct ast_rtp *rtp, char digit)
|
||||||
int res;
|
int res;
|
||||||
int ms;
|
int ms;
|
||||||
int x;
|
int x;
|
||||||
|
int payload;
|
||||||
char data[256];
|
char data[256];
|
||||||
char iabuf[INET_ADDRSTRLEN];
|
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);
|
ast_log(LOG_WARNING, "Don't know how to represent '%c'\n", digit);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
payload = ast_rtp_lookup_code(rtp, 0, AST_RTP_DTMF);
|
||||||
|
|
||||||
/* If we have no peer, return immediately */
|
/* If we have no peer, return immediately */
|
||||||
if (!rtp->them.sin_addr.s_addr)
|
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 */
|
/* Get a pointer to the header */
|
||||||
rtpheader = (unsigned int *)data;
|
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[1] = htonl(rtp->lastts);
|
||||||
rtpheader[2] = htonl(rtp->ssrc);
|
rtpheader[2] = htonl(rtp->ssrc);
|
||||||
rtpheader[3] = htonl((digit << 24) | (0xa << 16) | (0));
|
rtpheader[3] = htonl((digit << 24) | (0xa << 16) | (0));
|
||||||
|
|
Loading…
Reference in New Issue