diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-04-08 21:53:46 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-04-08 21:53:46 +0000 |
commit | 7a4c90b23662de39d0c1d5f69d3db6f9cb81da26 (patch) | |
tree | 5442a7217a2498722e8d5b06d35b28c942a2e698 /rtp.c | |
parent | 3152503cf71a272a63cf9c755222ab823eec1075 (diff) |
Don't send empty RTP frames
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@788 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'rtp.c')
-rwxr-xr-x | rtp.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -749,6 +749,10 @@ int ast_rtp_write(struct ast_rtp *rtp, struct ast_frame *_f) /* If we have no peer, return immediately */ if (!rtp->them.sin_addr.s_addr) return 0; + + /* If there is no data length, return immediately */ + if (!_f->datalen) + return 0; /* Make sure we have enough space for RTP header */ if (_f->frametype != AST_FRAME_VOICE) { @@ -756,6 +760,7 @@ int ast_rtp_write(struct ast_rtp *rtp, struct ast_frame *_f) return -1; } + codec = ast_rtp_lookup_code(rtp, 1, _f->subclass); if (codec < 0) { ast_log(LOG_WARNING, "Don't know how to send format %d packets with RTP\n", _f->subclass); |