[Asterisk-cvs] asterisk/channels chan_sip.c,1.510.2.52,1.510.2.53

russell at lists.digium.com russell at lists.digium.com
Sun Feb 27 18:32:54 CST 2005


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv21062/channels

Modified Files:
      Tag: v1-0
	chan_sip.c 
Log Message:
release RTP ports early on SUBSCRIBE (bug #3655 / #3673)


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.510.2.52
retrieving revision 1.510.2.53
diff -u -d -r1.510.2.52 -r1.510.2.53
--- chan_sip.c	27 Feb 2005 02:37:23 -0000	1.510.2.52
+++ chan_sip.c	28 Feb 2005 00:30:35 -0000	1.510.2.53
@@ -7644,7 +7644,16 @@
 				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 @@
 		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);




More information about the svn-commits mailing list