aboutsummaryrefslogtreecommitdiffstats
path: root/main/rtp.c
diff options
context:
space:
mode:
authorpcadach <pcadach@f38db490-d61c-443f-a65b-d21fe96a405b>2006-09-30 19:20:38 +0000
committerpcadach <pcadach@f38db490-d61c-443f-a65b-d21fe96a405b>2006-09-30 19:20:38 +0000
commit44711a738d0deb0f078e01e05295edb0af588c47 (patch)
tree1f34823b996ec274838d70f92ab330f8f37b9e84 /main/rtp.c
parent86655671f5c48bb126774388c16929720d073ea4 (diff)
Allow one-way RTP streams (device->Asterisk)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@44090 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/rtp.c')
-rw-r--r--main/rtp.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/main/rtp.c b/main/rtp.c
index deef1e3be..dc8b90368 100644
--- a/main/rtp.c
+++ b/main/rtp.c
@@ -1087,9 +1087,11 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp)
return &ast_null_frame;
}
+#if 0 /* Allow to receive RTP stream with closed transmission path */
/* If we don't have the other side's address, then ignore this */
if (!rtp->them.sin_addr.s_addr || !rtp->them.sin_port)
return &ast_null_frame;
+#endif
/* Send to whoever send to us if NAT is turned on */
if (rtp->nat) {
@@ -1155,7 +1157,8 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp)
rtp->seedrxseqno = seqno;
}
- if (rtp->rtcp && rtp->rtcp->schedid < 1) {
+ /* Do not schedule RR if RTCP isn't run */
+ if (rtp->rtcp && rtp->rtcp->them.sin_addr.s_addr && rtp->rtcp->schedid < 1) {
/* Schedule transmission of Receiver Report */
rtp->rtcp->schedid = ast_sched_add(rtp->sched, ast_rtcp_calc_interval(rtp), ast_rtcp_write, rtp);
}
@@ -2157,11 +2160,12 @@ static int ast_rtcp_write_sr(void *data)
struct timeval dlsr;
char bdata[512];
- if (!rtp || !rtp->rtcp || (&rtp->rtcp->them.sin_addr == 0))
+ /* Commented condition is always not NULL if rtp->rtcp is not NULL */
+ if (!rtp || !rtp->rtcp/* || (&rtp->rtcp->them.sin_addr == 0)*/)
return 0;
if (!rtp->rtcp->them.sin_addr.s_addr) { /* This'll stop rtcp for this rtp session */
- ast_verbose("RTCP SR transmission error, rtcp halted %s\n",strerror(errno));
+ ast_verbose("RTCP SR transmission error, rtcp halted\n");
if (rtp->rtcp->schedid > 0)
ast_sched_del(rtp->sched, rtp->rtcp->schedid);
rtp->rtcp->schedid = -1;