[Asterisk-cvs] asterisk/channels chan_iax2.c,1.188.2.1,1.188.2.2

russell at lists.digium.com russell at lists.digium.com
Fri Oct 8 20:24:45 CDT 2004


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

Modified Files:
      Tag: v1-0
	chan_iax2.c 
Log Message:
chan_iax2 shouldn't use IAX/Registry on temponly peers (bug #2610)


Index: chan_iax2.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v
retrieving revision 1.188.2.1
retrieving revision 1.188.2.2
diff -u -d -r1.188.2.1 -r1.188.2.2
--- chan_iax2.c	30 Sep 2004 22:47:32 -0000	1.188.2.1
+++ chan_iax2.c	9 Oct 2004 00:25:53 -0000	1.188.2.2
@@ -4342,7 +4342,8 @@
 	p->expire = -1;
 	/* Reset expirey value */
 	p->expirey = expirey;
-	ast_db_del("IAX/Registry", p->name);
+	if (p->temponly !=1)
+		ast_db_del("IAX/Registry", p->name);
 	register_peer_exten(p, 0);
 	if (iax2_regfunk)
 		iax2_regfunk(p->name, 0);
@@ -4358,7 +4359,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 != 1) && (!ast_db_get("IAX/Registry", p->name, data, sizeof(data)))) {
 		c = strchr(data, ':');
 		if (c) {
 			*c = '\0';
@@ -4418,7 +4419,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 != 1) && (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