mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-02 03:48:02 +00:00
Merged revisions 44090 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r44090 | pcadach | 2006-10-01 01:20:38 +0600 (Вск, 01 Окт 2006) | 1 line Allow one-way RTP streams (device->Asterisk) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@44091 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
10
main/rtp.c
10
main/rtp.c
@@ -1137,9 +1137,11 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp)
|
|||||||
return &ast_null_frame;
|
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 we don't have the other side's address, then ignore this */
|
||||||
if (!rtp->them.sin_addr.s_addr || !rtp->them.sin_port)
|
if (!rtp->them.sin_addr.s_addr || !rtp->them.sin_port)
|
||||||
return &ast_null_frame;
|
return &ast_null_frame;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Send to whoever send to us if NAT is turned on */
|
/* Send to whoever send to us if NAT is turned on */
|
||||||
if (rtp->nat) {
|
if (rtp->nat) {
|
||||||
@@ -1205,7 +1207,8 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp)
|
|||||||
rtp->seedrxseqno = seqno;
|
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 */
|
/* Schedule transmission of Receiver Report */
|
||||||
rtp->rtcp->schedid = ast_sched_add(rtp->sched, ast_rtcp_calc_interval(rtp), ast_rtcp_write, rtp);
|
rtp->rtcp->schedid = ast_sched_add(rtp->sched, ast_rtcp_calc_interval(rtp), ast_rtcp_write, rtp);
|
||||||
}
|
}
|
||||||
@@ -2208,11 +2211,12 @@ static int ast_rtcp_write_sr(void *data)
|
|||||||
struct timeval dlsr;
|
struct timeval dlsr;
|
||||||
char bdata[512];
|
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;
|
return 0;
|
||||||
|
|
||||||
if (!rtp->rtcp->them.sin_addr.s_addr) { /* This'll stop rtcp for this rtp session */
|
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)
|
if (rtp->rtcp->schedid > 0)
|
||||||
ast_sched_del(rtp->sched, rtp->rtcp->schedid);
|
ast_sched_del(rtp->sched, rtp->rtcp->schedid);
|
||||||
rtp->rtcp->schedid = -1;
|
rtp->rtcp->schedid = -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user