Fix SIP/IAX caching (bug #3671)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5249 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
3139c0e05c
commit
f203c9dcf6
|
@ -2566,8 +2566,12 @@ static struct iax2_peer *realtime_peer(const char *peername)
|
||||||
peerl.peers = peer;
|
peerl.peers = peer;
|
||||||
ast_mutex_unlock(&peerl.lock);
|
ast_mutex_unlock(&peerl.lock);
|
||||||
ast_copy_flags(peer, &globalflags, IAX_RTAUTOCLEAR|IAX_RTCACHEFRIENDS);
|
ast_copy_flags(peer, &globalflags, IAX_RTAUTOCLEAR|IAX_RTCACHEFRIENDS);
|
||||||
if (ast_test_flag(peer, IAX_RTAUTOCLEAR))
|
if (ast_test_flag(peer, IAX_RTAUTOCLEAR)) {
|
||||||
|
if (peer->expire > -1) {
|
||||||
|
ast_sched_del(sched, peer->expire);
|
||||||
|
}
|
||||||
peer->expire = ast_sched_add(sched, (global_rtautoclear) * 1000, expire_registry, (void *)peer);
|
peer->expire = ast_sched_add(sched, (global_rtautoclear) * 1000, expire_registry, (void *)peer);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
ast_set_flag(peer, IAX_TEMPONLY);
|
ast_set_flag(peer, IAX_TEMPONLY);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1292,6 +1292,9 @@ static struct sip_peer *realtime_peer(const char *peername, struct sockaddr_in *
|
||||||
if(ast_test_flag((&global_flags_page2), SIP_PAGE2_RTCACHEFRIENDS)) {
|
if(ast_test_flag((&global_flags_page2), SIP_PAGE2_RTCACHEFRIENDS)) {
|
||||||
ast_copy_flags((&peer->flags_page2),(&global_flags_page2), SIP_PAGE2_RTAUTOCLEAR|SIP_PAGE2_RTCACHEFRIENDS);
|
ast_copy_flags((&peer->flags_page2),(&global_flags_page2), SIP_PAGE2_RTAUTOCLEAR|SIP_PAGE2_RTCACHEFRIENDS);
|
||||||
if(ast_test_flag((&global_flags_page2), SIP_PAGE2_RTAUTOCLEAR)) {
|
if(ast_test_flag((&global_flags_page2), SIP_PAGE2_RTAUTOCLEAR)) {
|
||||||
|
if (peer->expire > -1) {
|
||||||
|
ast_sched_del(sched, peer->expire);
|
||||||
|
}
|
||||||
peer->expire = ast_sched_add(sched, (global_rtautoclear) * 1000, expire_register, (void *)peer);
|
peer->expire = ast_sched_add(sched, (global_rtautoclear) * 1000, expire_register, (void *)peer);
|
||||||
}
|
}
|
||||||
ASTOBJ_CONTAINER_LINK(&peerl,peer);
|
ASTOBJ_CONTAINER_LINK(&peerl,peer);
|
||||||
|
|
Reference in New Issue