dect
/
asterisk
Archived
13
0
Fork 0

clean up rtcaching config options (issue #4075)

git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6401 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
kpfleming 2005-08-25 02:25:30 +00:00
parent 02f5f71bab
commit 9b4e385ccc
2 changed files with 24 additions and 18 deletions

View File

@ -494,7 +494,7 @@ struct sip_auth {
/* a new page of flags for peer */
#define SIP_PAGE2_RTCACHEFRIENDS (1 << 0)
#define SIP_PAGE2_RTNOUPDATE (1 << 1)
#define SIP_PAGE2_RTUPDATE (1 << 1)
#define SIP_PAGE2_RTAUTOCLEAR (1 << 2)
#define SIP_PAGE2_RTIGNOREREGEXPIRE (1 << 3)
@ -1552,7 +1552,7 @@ static void sip_destroy_peer(struct sip_peer *peer)
/*--- update_peer: Update peer data in database (if used) ---*/
static void update_peer(struct sip_peer *p, int expiry)
{
if (!ast_test_flag((&global_flags_page2), SIP_PAGE2_RTNOUPDATE) &&
if (ast_test_flag((&global_flags_page2), SIP_PAGE2_RTUPDATE) &&
(ast_test_flag(p, SIP_REALTIME) ||
ast_test_flag(&(p->flags_page2), SIP_PAGE2_RTCACHEFRIENDS))) {
realtime_update_peer(p->name, &p->addr, p->username, expiry);
@ -7496,7 +7496,7 @@ static int sip_show_settings(int fd, int argc, char *argv[])
ast_cli(fd, " Realtime Peers: %s\n", realtimepeers ? "Yes" : "No");
ast_cli(fd, " Realtime Users: %s\n", realtimeusers ? "Yes" : "No");
ast_cli(fd, " Cache Friends: %s\n", ast_test_flag(&global_flags_page2, SIP_PAGE2_RTCACHEFRIENDS) ? "Yes" : "No");
ast_cli(fd, " No update: %s\n", ast_test_flag(&global_flags_page2, SIP_PAGE2_RTNOUPDATE) ? "Yes" : "No");
ast_cli(fd, " Update: %s\n", ast_test_flag(&global_flags_page2, SIP_PAGE2_RTUPDATE) ? "Yes" : "No");
ast_cli(fd, " Ignore Reg. Expire: %s\n", ast_test_flag(&global_flags_page2, SIP_PAGE2_RTIGNOREREGEXPIRE) ? "Yes" : "No");
ast_cli(fd, " Auto Clear: %d\n", global_rtautoclear);
}
@ -11177,6 +11177,7 @@ static int reload_config(void)
ast_set_flag(&global_flags, SIP_DTMF_RFC2833);
ast_set_flag(&global_flags, SIP_NAT_RFC3581);
ast_set_flag(&global_flags, SIP_CAN_REINVITE);
ast_set_flag(&global_flags_page2, SIP_PAGE2_RTUPDATE);
global_mwitime = DEFAULT_MWITIME;
strcpy(global_vmexten, DEFAULT_VMEXTEN);
srvlookup = 0;
@ -11205,8 +11206,8 @@ static int reload_config(void)
default_useragent);
} else if (!strcasecmp(v->name, "rtcachefriends")) {
ast_set2_flag((&global_flags_page2), ast_true(v->value), SIP_PAGE2_RTCACHEFRIENDS);
} else if (!strcasecmp(v->name, "rtnoupdate")) {
ast_set2_flag((&global_flags_page2), ast_true(v->value), SIP_PAGE2_RTNOUPDATE);
} else if (!strcasecmp(v->name, "rtupdate")) {
ast_set2_flag((&global_flags_page2), ast_true(v->value), SIP_PAGE2_RTUPDATE);
} else if (!strcasecmp(v->name, "rtignoreregexpire")) {
ast_set2_flag((&global_flags_page2), ast_true(v->value), SIP_PAGE2_RTIGNOREREGEXPIRE);
} else if (!strcasecmp(v->name, "rtautoclear")) {

View File

@ -169,20 +169,25 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls
; route = Assume NAT, don't send rport
; (work around more UNIDEN bugs)
;rtcachefriends=yes ; Cache realtime friends by adding them to the internal list
; just like friends added from the config file only on a
; as-needed basis.
;rtnoupdate=yes ; do not send the update request over realtime.
;rtautoclear=yes ; Auto-Expire friends created on the fly on the same schedule
; as if it had just registered when the registration expires
; the friend will vanish from the configuration until requested
; again. If set to an integer, friends expire
; within this number of seconds instead of the
; same as the registration interval
;rtignoreexpire=yes ; when reading a peer from Realtime, if the peer's registration
; has expired based on its registration interval, used the stored
; address information regardless
;rtcachefriends=yes ; Cache realtime friends by adding them to the internal list
; just like friends added from the config file only on a
; as-needed basis? (yes|no)
;rtupdate=yes ; Send registry updates to database using realtime? (yes|no)
; If set to yes, when a SIP UA registers successfully, the ip address,
; the origination port, the registration period, and the username of
; the UA will be set to database via realtime. If not present, defaults to 'yes'.
;rtautoclear=yes ; Auto-Expire friends created on the fly on the same schedule
; as if it had just registered? (yes|no|<seconds>)
; If set to yes, when the registration expires, the friend will vanish from
; the configuration until requested again. If set to an integer,
; friends expire within this number of seconds instead of the
; registration interval.
;rtignoreexpire=yes ; When reading a peer from Realtime, if the peer's registration
; has expired based on its registration interval, used the stored
; address information regardless. (yes|no)
[authentication]
; Global credentials for outbound calls, i.e. when a proxy challenges your