mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-21 20:56:39 +00:00
Fix fd's when we release rtp/vrtp
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5940 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -9189,10 +9189,18 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
|
|||||||
}
|
}
|
||||||
/* Go ahead and free RTP port */
|
/* Go ahead and free RTP port */
|
||||||
if (p->rtp) {
|
if (p->rtp) {
|
||||||
|
if (p->owner) {
|
||||||
|
p->owner->fds[0] = -1;
|
||||||
|
p->owner->fds[1] = -1;
|
||||||
|
}
|
||||||
ast_rtp_destroy(p->rtp);
|
ast_rtp_destroy(p->rtp);
|
||||||
p->rtp = NULL;
|
p->rtp = NULL;
|
||||||
}
|
}
|
||||||
if (p->vrtp) {
|
if (p->vrtp) {
|
||||||
|
if (p->owner) {
|
||||||
|
p->owner->fds[2] = -1;
|
||||||
|
p->owner->fds[3] = -1;
|
||||||
|
}
|
||||||
ast_rtp_destroy(p->vrtp);
|
ast_rtp_destroy(p->vrtp);
|
||||||
p->vrtp = NULL;
|
p->vrtp = NULL;
|
||||||
}
|
}
|
||||||
@@ -9219,10 +9227,18 @@ static int handle_request_register(struct sip_pvt *p, struct sip_request *req, i
|
|||||||
if (res < 1) {
|
if (res < 1) {
|
||||||
/* Go ahead and free RTP port */
|
/* Go ahead and free RTP port */
|
||||||
if (p->rtp) {
|
if (p->rtp) {
|
||||||
|
if (p->owner) {
|
||||||
|
p->owner->fds[0] = -1;
|
||||||
|
p->owner->fds[1] = -1;
|
||||||
|
}
|
||||||
ast_rtp_destroy(p->rtp);
|
ast_rtp_destroy(p->rtp);
|
||||||
p->rtp = NULL;
|
p->rtp = NULL;
|
||||||
}
|
}
|
||||||
if (p->vrtp) {
|
if (p->vrtp) {
|
||||||
|
if (p->owner) {
|
||||||
|
p->owner->fds[2] = -1;
|
||||||
|
p->owner->fds[3] = -1;
|
||||||
|
}
|
||||||
ast_rtp_destroy(p->vrtp);
|
ast_rtp_destroy(p->vrtp);
|
||||||
p->vrtp = NULL;
|
p->vrtp = NULL;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user