]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
release RTP ports early on SUBSCRIBE (bug #3655 / #3673)
authorRussell Bryant <russell@russellbryant.com>
Mon, 28 Feb 2005 00:30:35 +0000 (00:30 +0000)
committerRussell Bryant <russell@russellbryant.com>
Mon, 28 Feb 2005 00:30:35 +0000 (00:30 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@5101 65c4cc65-6c06-0410-ace0-fbb531ad65f3

CHANGES
channels/chan_sip.c

diff --git a/CHANGES b/CHANGES
index 6c8f96a732b3e975fc7360c99051406157e6503d..0f754f7bcab31934038daf12c1d71c045dc790b8 100755 (executable)
--- a/CHANGES
+++ b/CHANGES
@@ -21,6 +21,8 @@ Asterisk 1.0.6
     -- There was a problem incorrectly matching codec availablity when global preferences were 
        different from that of the user.  To fix this, processing of SDP data has been moved 
        to after determining who the call is coming from.
+    -- Asterisk would run out of RTP ports while waiting for SUBSCRIBE's to expire even though
+       an RTP port isn't needed in this case.  This has been fixed by releasing the ports early.
  -- chan_zap:
     -- During a certain scenario when using flash and '#' transfers you would hear the
        other person and the music they were hearing. This has been fixed.
index e0c94e6199df1c6e7c14c22cb5d22a9fac035ff2..714aea02dbec2f3c6e6ac740a6973f39cce35052 100755 (executable)
@@ -7644,7 +7644,16 @@ 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->vrtp);
+                                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);
@@ -7671,6 +7680,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->vrtp);
+                               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);