aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authortwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-09-23 18:05:16 +0000
committertwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-09-23 18:05:16 +0000
commit77019ba36d5aa87ff94ac92c47953d13105c669e (patch)
tree2dd033a60a57e65dd34207ada332aa24f68d2b05 /main
parenta9b13025844dd37aca7e6f2eef6db5bf58f28192 (diff)
Make AMI honor enabled=no
(closes issue #18040) Reported by: twilson Review: https://reviewboard.asterisk.org/r/938/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.8@288572 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/manager.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/main/manager.c b/main/manager.c
index 740dd5fc1..cf24d354e 100644
--- a/main/manager.c
+++ b/main/manager.c
@@ -6215,6 +6215,8 @@ static int __init_manager(int reload)
/* default values */
ast_copy_string(global_realm, S_OR(ast_config_AST_SYSTEM_NAME, DEFAULT_REALM), sizeof(global_realm));
+ memset(&ami_desc.local_address, 0, sizeof(struct sockaddr_in));
+ memset(&amis_desc.local_address, 0, sizeof(amis_desc.local_address));
amis_desc_local_address_tmp.sin_port = htons(5039);
ami_desc_local_address_tmp.sin_port = htons(DEFAULT_MANAGER_PORT);
@@ -6299,8 +6301,10 @@ static int __init_manager(int reload)
ami_desc_local_address_tmp.sin_addr;
}
- ast_sockaddr_from_sin(&ami_desc.local_address, &ami_desc_local_address_tmp);
- ast_sockaddr_from_sin(&amis_desc.local_address, &amis_desc_local_address_tmp);
+ if (manager_enabled) {
+ ast_sockaddr_from_sin(&ami_desc.local_address, &ami_desc_local_address_tmp);
+ ast_sockaddr_from_sin(&amis_desc.local_address, &amis_desc_local_address_tmp);
+ }
AST_RWLIST_WRLOCK(&users);