mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
Don't send empty RTP frames
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@788 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
5
rtp.c
5
rtp.c
@@ -750,12 +750,17 @@ int ast_rtp_write(struct ast_rtp *rtp, struct ast_frame *_f)
|
|||||||
if (!rtp->them.sin_addr.s_addr)
|
if (!rtp->them.sin_addr.s_addr)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
/* If there is no data length, return immediately */
|
||||||
|
if (!_f->datalen)
|
||||||
|
return 0;
|
||||||
|
|
||||||
/* Make sure we have enough space for RTP header */
|
/* Make sure we have enough space for RTP header */
|
||||||
if (_f->frametype != AST_FRAME_VOICE) {
|
if (_f->frametype != AST_FRAME_VOICE) {
|
||||||
ast_log(LOG_WARNING, "RTP can only send voice\n");
|
ast_log(LOG_WARNING, "RTP can only send voice\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
codec = ast_rtp_lookup_code(rtp, 1, _f->subclass);
|
codec = ast_rtp_lookup_code(rtp, 1, _f->subclass);
|
||||||
if (codec < 0) {
|
if (codec < 0) {
|
||||||
ast_log(LOG_WARNING, "Don't know how to send format %d packets with RTP\n", _f->subclass);
|
ast_log(LOG_WARNING, "Don't know how to send format %d packets with RTP\n", _f->subclass);
|
||||||
|
Reference in New Issue
Block a user