mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-01 11:32:25 +00:00
Only delete scheduled item if it exists
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@35333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
4
rtp.c
4
rtp.c
@@ -1974,6 +1974,7 @@ static int ast_rtcp_write_sr(void *data)
|
||||
|
||||
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));
|
||||
if (rtp->rtcp->schedid > 0)
|
||||
ast_sched_del(rtp->sched, rtp->rtcp->schedid);
|
||||
rtp->rtcp->schedid = -1;
|
||||
return 0;
|
||||
@@ -2032,6 +2033,7 @@ static int ast_rtcp_write_sr(void *data)
|
||||
res = sendto(rtp->rtcp->s, (unsigned int *)rtcpheader, len, 0, (struct sockaddr *)&rtp->rtcp->them, sizeof(rtp->rtcp->them));
|
||||
if (res < 0) {
|
||||
ast_log(LOG_ERROR, "RTCP SR transmission error to %s:%d, rtcp halted %s\n",ast_inet_ntoa(iabuf, sizeof(iabuf), rtp->rtcp->them.sin_addr), ntohs(rtp->rtcp->them.sin_port), strerror(errno));
|
||||
if (rtp->rtcp->schedid > 0)
|
||||
ast_sched_del(rtp->sched, rtp->rtcp->schedid);
|
||||
rtp->rtcp->schedid = -1;
|
||||
return 0;
|
||||
@@ -2084,6 +2086,7 @@ static int ast_rtcp_write_rr(void *data)
|
||||
|
||||
if (!rtp->rtcp->them.sin_addr.s_addr) {
|
||||
ast_log(LOG_ERROR, "RTCP RR transmission error to, rtcp halted %s\n",strerror(errno));
|
||||
if (rtp->rtcp->schedid > 0)
|
||||
ast_sched_del(rtp->sched, rtp->rtcp->schedid);
|
||||
rtp->rtcp->schedid = -1;
|
||||
return 0;
|
||||
@@ -2132,6 +2135,7 @@ static int ast_rtcp_write_rr(void *data)
|
||||
if (res < 0) {
|
||||
ast_log(LOG_ERROR, "RTCP RR transmission error, rtcp halted: %s\n",strerror(errno));
|
||||
/* Remove the scheduler */
|
||||
if (rtp->rtcp->schedid > 0)
|
||||
ast_sched_del(rtp->sched, rtp->rtcp->schedid);
|
||||
rtp->rtcp->schedid = -1;
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user