[asterisk-commits] branch oej/moduletest r12460 - in /team/oej/moduletest: ./ channels/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Mar 8 04:11:50 MST 2006


Author: oej
Date: Wed Mar  8 05:11:47 2006
New Revision: 12460

URL: http://svn.digium.com/view/asterisk?rev=12460&view=rev
Log:
Update

Modified:
    team/oej/moduletest/   (props changed)
    team/oej/moduletest/channels/chan_sip.c
    team/oej/moduletest/cli.c

Propchange: team/oej/moduletest/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Mar  8 05:11:47 2006
@@ -1,1 +1,1 @@
-/branches/1.2:1-7496,7498-11264
+/branches/1.2:1-7496,7498-11355

Modified: team/oej/moduletest/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/channels/chan_sip.c?rev=12460&r1=12459&r2=12460&view=diff
==============================================================================
--- team/oej/moduletest/channels/chan_sip.c (original)
+++ team/oej/moduletest/channels/chan_sip.c Wed Mar  8 05:11:47 2006
@@ -1684,7 +1684,10 @@
 		var = ast_load_realtime("sippeers", "name", peername, NULL);
 	else if (sin) {	/* Then check on IP address */
 		ast_inet_ntoa(iabuf, sizeof(iabuf), sin->sin_addr);
-		var = ast_load_realtime("sippeers", "ipaddr", iabuf, NULL);
+		var = ast_load_realtime("sippeers", "host", iabuf, NULL);	/* First check for fixed IP hosts */
+		if (!var)
+			var = ast_load_realtime("sippeers", "ipaddr", iabuf, NULL);	/* Then check for registred hosts */
+	
 	} else
 		return NULL;
 

Modified: team/oej/moduletest/cli.c
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/cli.c?rev=12460&r1=12459&r2=12460&view=diff
==============================================================================
--- team/oej/moduletest/cli.c (original)
+++ team/oej/moduletest/cli.c Wed Mar  8 05:11:47 2006
@@ -1456,34 +1456,35 @@
 	char *dup;
 	int tws;
 
-	dup = parse_args(s, &x, argv, sizeof(argv) / sizeof(argv[0]), &tws);
-	if (!dup) {
-		ast_log(LOG_ERROR, "Out of Memory!\n");
+	if ((dup = parse_args(s, &x, argv, sizeof(argv) / sizeof(argv[0]), &tws))) {
+		/* We need at least one entry, or ignore */
+		if (x > 0) {
+			ast_mutex_lock(&clilock);
+			e = find_cli(argv, 0);
+			if (e)
+				e->inuse++;
+			ast_mutex_unlock(&clilock);
+			if (e) {
+				switch(e->handler(fd, x, argv)) {
+				case RESULT_SHOWUSAGE:
+					if (e->usage)
+						ast_cli(fd, "%s", e->usage);
+					else
+						ast_cli(fd, "%s", "Invalid usage, but no usage information available.\n");
+					break;
+				}
+			} else 
+				ast_cli(fd, "No such command '%s' (type 'help' for help)\n", find_best(argv));
+			if (e) {
+				ast_mutex_lock(&clilock);
+				e->inuse--;
+				ast_mutex_unlock(&clilock);
+			}
+		}
+		free(dup);
+	} else {
+		ast_log(LOG_WARNING, "Out of memory\n");	
 		return -1;
 	}
-
-	/* We need at least one entry, or ignore */
-	if (x > 0) {
-		ast_mutex_lock(&clilock);
-		e = find_cli(argv, 0);
-		if (e)
-			e->inuse++;
-		ast_mutex_unlock(&clilock);
-		if (e) {
-			switch(e->handler(fd, x, argv)) {
-			case RESULT_SHOWUSAGE:
-				ast_cli(fd, "%s", e->usage);
-				break;
-			}
-		} else 
-			ast_cli(fd, "No such command '%s' (type 'help' for help)\n", find_best(argv));
-		if (e) {
-			ast_mutex_lock(&clilock);
-			e->inuse--;
-			ast_mutex_unlock(&clilock);
-		}
-	}
-	free(dup);
-	
 	return 0;
 }



More information about the asterisk-commits mailing list