[svn-commits] branch oej/bug2617 r11356 - in /team/oej/bug2617: ./
channels/chan_sip.c cli.c
svn-commits at lists.digium.com
svn-commits at lists.digium.com
Tue Feb 28 05:45:45 MST 2006
Author: oej
Date: Tue Feb 28 06:45:42 2006
New Revision: 11356
URL: http://svn.digium.com/view/asterisk?rev=11356&view=rev
Log:
Updates
Modified:
team/oej/bug2617/ (props changed)
team/oej/bug2617/channels/chan_sip.c
team/oej/bug2617/cli.c
Propchange: team/oej/bug2617/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Feb 28 06:45:42 2006
@@ -1,1 +1,1 @@
-/branches/1.2:1-11258
+/branches/1.2:1-11355
Modified: team/oej/bug2617/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/bug2617/channels/chan_sip.c?rev=11356&r1=11355&r2=11356&view=diff
==============================================================================
--- team/oej/bug2617/channels/chan_sip.c (original)
+++ team/oej/bug2617/channels/chan_sip.c Tue Feb 28 06:45:42 2006
@@ -1680,7 +1680,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/bug2617/cli.c
URL: http://svn.digium.com/view/asterisk/team/oej/bug2617/cli.c?rev=11356&r1=11355&r2=11356&view=diff
==============================================================================
--- team/oej/bug2617/cli.c (original)
+++ team/oej/bug2617/cli.c Tue Feb 28 06:45:42 2006
@@ -1373,34 +1373,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 svn-commits
mailing list