diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-02-26 01:16:12 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-02-26 01:16:12 +0000 |
commit | ab43f6438da93c849e81f56d52f07add45b73539 (patch) | |
tree | c704a8b7f35dedc8644786958cff575b7ea1e222 /channels | |
parent | d4dff42f6fd246edc4044bc15d2fd2dc389e08f4 (diff) |
Release RTP ports early (bug #3655)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5082 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rwxr-xr-x | channels/chan_sip.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 56de6713f..5a569616b 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -8379,6 +8379,15 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc if (p->expiry>max_expiry) p->expiry = max_expiry; } + /* Go ahead and free RTP port */ + if (p->rtp) { + ast_rtp_destroy(p->rtp); + p->rtp = NULL; + } + if (p->vrtp) { + ast_rtp_destroy(p->rtp); + p->vrtp = NULL; + } transmit_response(p, "200 OK", req); sip_scheddestroy(p, (p->expiry+10)*1000); transmit_state_notify(p, ast_extension_state(NULL, p->context, p->exten),1); @@ -8406,6 +8415,15 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc if ((res = register_verify(p, sin, req, e, ignore)) < 0) ast_log(LOG_NOTICE, "Registration from '%s' failed for '%s'\n", get_header(req, "To"), ast_inet_ntoa(iabuf, sizeof(iabuf), sin->sin_addr)); if (res < 1) { + /* Go ahead and free RTP port */ + if (p->rtp) { + ast_rtp_destroy(p->rtp); + p->rtp = NULL; + } + if (p->vrtp) { + ast_rtp_destroy(p->rtp); + p->vrtp = NULL; + } /* Destroy the session, but keep us around for just a bit in case they don't get our 200 OK */ sip_scheddestroy(p, 15*1000); |