Update ast_append_ha() usage
authorPaul Cadach <paul@odt.east.telecom.kz>
Thu, 18 Jan 2007 06:59:22 +0000 (06:59 +0000)
committerPaul Cadach <paul@odt.east.telecom.kz>
Thu, 18 Jan 2007 06:59:22 +0000 (06:59 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@51221 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_h323.c

index 096e8dd..ef099eb 100644 (file)
@@ -1425,7 +1425,11 @@ static struct oh323_user *build_user(char *name, struct ast_variable *v, struct
                        }
                } else if (!strcasecmp(v->name, "permit") ||
                                        !strcasecmp(v->name, "deny")) {
-                       user->ha = ast_append_ha(v->name, v->value, user->ha, NULL);
+                       int ha_error = 0;
+
+                       user->ha = ast_append_ha(v->name, v->value, user->ha, &ha_error);
+                       if (ha_error)
+                               ast_log(LOG_ERROR, "Bad ACL entry in configuration line %d : %s\n", v->lineno, v->value);
                }
        }
        if (!user->options.dtmfmode)
@@ -1529,7 +1533,11 @@ static struct oh323_peer *build_peer(const char *name, struct ast_variable *v, s
                        peer->addr.sin_port = htons(atoi(v->value));
                } else if (!strcasecmp(v->name, "permit") ||
                                        !strcasecmp(v->name, "deny")) {
-                       peer->ha = ast_append_ha(v->name, v->value, peer->ha);
+                       int ha_error = 0;
+
+                       peer->ha = ast_append_ha(v->name, v->value, peer->ha, &ha_error);
+                       if (ha_error)
+                               ast_log(LOG_ERROR, "Bad ACL entry in configuration line %d : %s\n", v->lineno, v->value);
                } else if (!strcasecmp(v->name, "mailbox")) {
                        ast_copy_string(peer->mailbox, v->value, sizeof(peer->mailbox));
                }