|
|
|
@ -2634,8 +2634,10 @@ static struct iax2_peer *realtime_peer(const char *peername, struct sockaddr_in
|
|
|
|
|
|
|
|
|
|
peer = build_peer(peername, var, ast_test_flag((&globalflags), IAX_RTCACHEFRIENDS) ? 0 : 1);
|
|
|
|
|
|
|
|
|
|
if (!peer)
|
|
|
|
|
if (!peer) {
|
|
|
|
|
ast_variables_destroy(var);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tmp = var;
|
|
|
|
|
while(tmp) {
|
|
|
|
@ -2661,11 +2663,12 @@ static struct iax2_peer *realtime_peer(const char *peername, struct sockaddr_in
|
|
|
|
|
}
|
|
|
|
|
tmp = tmp->next;
|
|
|
|
|
}
|
|
|
|
|
if (!peer)
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
ast_variables_destroy(var);
|
|
|
|
|
|
|
|
|
|
if (!peer)
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
if (ast_test_flag((&globalflags), IAX_RTCACHEFRIENDS)) {
|
|
|
|
|
ast_copy_flags(peer, &globalflags, IAX_RTAUTOCLEAR|IAX_RTCACHEFRIENDS);
|
|
|
|
|
if (ast_test_flag(peer, IAX_RTAUTOCLEAR)) {
|
|
|
|
@ -2725,11 +2728,12 @@ static struct iax2_user *realtime_user(const char *username)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
user = build_user(username, var, !ast_test_flag((&globalflags), IAX_RTCACHEFRIENDS));
|
|
|
|
|
if (!user)
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
ast_variables_destroy(var);
|
|
|
|
|
|
|
|
|
|
if (!user)
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
if (ast_test_flag((&globalflags), IAX_RTCACHEFRIENDS)) {
|
|
|
|
|
ast_set_flag(user, IAX_RTCACHEFRIENDS);
|
|
|
|
|
ast_mutex_lock(&userl.lock);
|
|
|
|
@ -4925,15 +4929,12 @@ static int check_access(int callno, struct sockaddr_in *sin, struct iax_ies *ies
|
|
|
|
|
key++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!family || !key || ast_db_get(family, key, iaxs[callno]->secret, sizeof(iaxs[callno]->secret))) {
|
|
|
|
|
if (!family || !key || ast_db_get(family, key, iaxs[callno]->secret, sizeof(iaxs[callno]->secret)))
|
|
|
|
|
ast_log(LOG_WARNING, "Unable to retrieve database password for family/key '%s'!\n", user->dbsecret);
|
|
|
|
|
if (ast_test_flag(user, IAX_TEMPONLY)) {
|
|
|
|
|
destroy_user(user);
|
|
|
|
|
user = NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else
|
|
|
|
|
ast_copy_string(iaxs[callno]->secret, user->secret, sizeof(iaxs[callno]->secret));
|
|
|
|
|
if (ast_test_flag(user, IAX_TEMPONLY))
|
|
|
|
|
destroy_user(user);
|
|
|
|
|
res = 0;
|
|
|
|
|
}
|
|
|
|
|
ast_set2_flag(iaxs[callno], iax2_getpeertrunk(*sin), IAX_TRUNK);
|
|
|
|
|