This is a hack to maintain old behavior of chan_iax2. This ensures that if

the peers and users are being stored in a linked list, that they go in the
list in the same order that the older code used.  This is necessary to maintain
the behavior of which peers and users get matched when traversing the container.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80497 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2007-08-23 16:53:52 +00:00
parent fa1bc2a13b
commit b2c65cf51d
3 changed files with 17 additions and 7 deletions

View File

@@ -9735,14 +9735,14 @@ static int set_config(char *config_file, int reload)
/* Start with general parameters, then specific parameters, user and peer */
user = build_user(cat, gen, ast_variable_browse(ucfg, cat), 0);
if (user) {
ao2_link(users, user);
__ao2_link(users, user, (MAX_PEER_BUCKETS == 1) ? 1 : 0);
user = NULL;
}
peer = build_peer(cat, gen, ast_variable_browse(ucfg, cat), 0);
if (peer) {
if (ast_test_flag(peer, IAX_DYNAMIC))
reg_source_db(peer);
ao2_link(peers, peer);
__ao2_link(peers, peer, (MAX_PEER_BUCKETS == 1) ? 1 : 0);
peer = NULL;
}
}
@@ -9779,7 +9779,7 @@ static int set_config(char *config_file, int reload)
if (!strcasecmp(utype, "user") || !strcasecmp(utype, "friend")) {
user = build_user(cat, ast_variable_browse(cfg, cat), NULL, 0);
if (user) {
ao2_link(users, user);
__ao2_link(users, user, (MAX_PEER_BUCKETS == 1) ? 1 : 0);
user = NULL;
}
}
@@ -9788,7 +9788,7 @@ static int set_config(char *config_file, int reload)
if (peer) {
if (ast_test_flag(peer, IAX_DYNAMIC))
reg_source_db(peer);
ao2_link(peers, peer);
__ao2_link(peers, peer, (MAX_PEER_BUCKETS == 1) ? 1 : 0);
peer = NULL;
}
} else if (strcasecmp(utype, "user")) {