[Home]

Summary:ASTERISK-15413: [patch] "config reload" doesn't work correctly
Reporter:pj (pj)Labels:
Date Opened:2010-01-07 08:22:08.000-0600Date Closed:2010-01-11 10:40:26.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/Configuration
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) cli_aliases.conf
( 1) issue16564_20100109.diff
( 2) issue16564_20100111.diff
Description:After change in cli_aliases.conf, I tried to reload changed config using:
"config reload /etc/asterisk/cli_aliases.conf"
then I got warnings like below and cli aliases are then doubled.

localhost*CLI> config reload /etc/asterisk/cli_aliases.conf
[Jan  7 09:09:14]     -- Reloading module 'res_clialiases.so' (CLI Aliases)
[Jan  7 09:09:14]   == Parsing '/etc/asterisk/cli_aliases.conf': [Jan  7 09:09:14]   == Found
[Jan  7 09:09:14]   == Aliased CLI command 'c' to 'core show channels verbose'
[Jan  7 09:09:14] WARNING[3095]: cli.c:1957 __ast_cli_register: Command 'hangup' already registered (or something close enough)
[Jan  7 09:09:14]   == Aliased CLI command 'hangup' to 'channel request hangup'
[Jan  7 09:09:14] WARNING[3095]: cli.c:1957 __ast_cli_register: Command 's' already registered (or something close enough)
[Jan  7 09:09:14]   == Aliased CLI command 's' to 'sip show peers'
[Jan  7 09:09:14] WARNING[3095]: cli.c:1957 __ast_cli_register: Command 'sp' already registered (or something close enough)
[Jan  7 09:09:14]   == Aliased CLI command 'sp' to 'sip show peer'
[Jan  7 09:09:14] WARNING[3095]: cli.c:1957 __ast_cli_register: Command 'sc' already registered (or something close enough)
[Jan  7 09:09:14]   == Aliased CLI command 'sc' to 'sip show channels'
[Jan  7 09:09:14] WARNING[3095]: cli.c:1957 __ast_cli_register: Command 'su' already registered (or something close enough)
[Jan  7 09:09:14]   == Aliased CLI command 'su' to 'sip show subscriptions'
[Jan  7 09:09:14] WARNING[3095]: cli.c:1957 __ast_cli_register: Command 'hint' already registered (or something close enough)
[Jan  7 09:09:14]   == Aliased CLI command 'hint' to 'core show hints'
[Jan  7 09:09:14] WARNING[3095]: cli.c:1957 __ast_cli_register: Command 'sd' already registered (or something close enough)
[Jan  7 09:09:14]   == Aliased CLI command 'sd' to 'skinny show devices'
[Jan  7 09:09:14] WARNING[3095]: cli.c:1957 __ast_cli_register: Command 'md' already registered (or something close enough)
[Jan  7 09:09:14]   == Aliased CLI command 'md' to 'mobile show devices'
.....

****** ADDITIONAL INFORMATION ******

localhost*CLI> cli show aliases
Alias Command                                      Real Command
c                                                  core show channels verbose
m                                                  memory show summary
m                                                  memory show summary
l                                                  core show locks
l                                                  core show locks
stop                                               core stop now
stop                                               core stop now
u                                                  core show uptime
u                                                  core show uptime
su                                                 sip show subscriptions
su                                                 sip show subscriptions
...
Comments:By: Sean Bright (seanbright) 2010-01-09 11:29:26.000-0600

Please test the attached patch (issue16564_20100109.diff) and report results.  Thanks.



By: pj (pj) 2010-01-11 07:01:52.000-0600

patched with issue16564_20100109.diff and recompiled, but it still doesn't work,
when I update cli_aliases.conf and do "config reload" it still generates warnings and aliases are doubled, subsequent "config reload" (i.e. when cli_aliased.conf isn't updated) it doesn't generate warnings

By: Sean Bright (seanbright) 2010-01-11 08:11:17.000-0600

New patch uploaded.

By: pj (pj) 2010-01-11 08:18:31.000-0600

it's now working as expected, thanks!

By: Sean Bright (seanbright) 2010-01-11 09:58:14.000-0600

https://reviewboard.asterisk.org/r/457/

By: Digium Subversion (svnbot) 2010-01-11 10:40:25.000-0600

Repository: asterisk
Revision: 239113

U   trunk/main/astobj2.c

------------------------------------------------------------------------
r239113 | seanbright | 2010-01-11 10:40:24 -0600 (Mon, 11 Jan 2010) | 19 lines

Fix ao2_callback when both OBJ_MULTIPLE and OBJ_NODATA are passed.

There is an issue which only affects trunk and the new ao2_callback OBJ_MULTIPLE
implementation.  When both OBJ_MULTIPLE and OBJ_NODATA are passed, only the first
object is visited, regardless of what is returned by the specified callback. This
causes a problem when we are clearing a container, i.e.:

   ao2_callback(container, OBJ_UNLINK | OBJ_NODATA | OBJ_MULTIPLE, NULL, NULL);

Only unlinks the first object.  This patch resolves this.

(closes issue ASTERISK-15413)
Reported by: pj
Patches:
     issue16564_20100111.diff uploaded by seanbright (license 71)
Tested by: pj, seanbright

Review: https://reviewboard.asterisk.org/r/457/

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=239113