[Asterisk-cvs] asterisk/channels chan_iax2.c,1.200,1.201

markster at lists.digium.com markster at lists.digium.com
Fri Oct 8 11:20:09 CDT 2004


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

Modified Files:
	chan_iax2.c 
Log Message:
Don't save dynamic peers in registery (bug #2610)


Index: chan_iax2.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v
retrieving revision 1.200
retrieving revision 1.201
diff -u -d -r1.200 -r1.201
--- chan_iax2.c	8 Oct 2004 05:37:19 -0000	1.200
+++ chan_iax2.c	8 Oct 2004 15:21:20 -0000	1.201
@@ -4295,7 +4295,8 @@
 	p->expire = -1;
 	/* Reset expirey value */
 	p->expirey = expirey;
-	ast_db_del("IAX/Registry", p->name);
+	if (!p->temponly)
+		ast_db_del("IAX/Registry", p->name);
 	register_peer_exten(p, 0);
 	if (iax2_regfunk)
 		iax2_regfunk(p->name, 0);
@@ -4311,7 +4312,7 @@
 	struct in_addr in;
 	char iabuf[INET_ADDRSTRLEN];
 	char *c, *d;
-	if (!ast_db_get("IAX/Registry", p->name, data, sizeof(data))) {
+	if (!p->temponly && (!ast_db_get("IAX/Registry", p->name, data, sizeof(data)))) {
 		c = strchr(data, ':');
 		if (c) {
 			*c = '\0';
@@ -4367,7 +4368,7 @@
 			if (iax2_regfunk)
 				iax2_regfunk(p->name, 1);
 			snprintf(data, sizeof(data), "%s:%d:%d", ast_inet_ntoa(iabuf, sizeof(iabuf), sin->sin_addr), ntohs(sin->sin_port), p->expirey);
-			if (sin->sin_addr.s_addr) {
+			if (!p->temponly && sin->sin_addr.s_addr) {
 				ast_db_put("IAX/Registry", p->name, data);
 				if  (option_verbose > 2)
 				ast_verbose(VERBOSE_PREFIX_3 "Registered '%s' (%s) at %s:%d\n", p->name, 




More information about the svn-commits mailing list