make chan_iax2 rtupdate behave the same as chan_sip

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6501 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.2-netsec
Kevin P. Fleming 20 years ago
parent 019310244e
commit a2be145193

@ -239,7 +239,7 @@ struct iax2_context {
#define IAX_CODEC_NOPREFS (1 << 15) /* Force old behaviour by turning off prefs */ #define IAX_CODEC_NOPREFS (1 << 15) /* Force old behaviour by turning off prefs */
#define IAX_CODEC_NOCAP (1 << 16) /* only consider requested format and ignore capabilities*/ #define IAX_CODEC_NOCAP (1 << 16) /* only consider requested format and ignore capabilities*/
#define IAX_RTCACHEFRIENDS (1 << 17) /* let realtime stay till your reload */ #define IAX_RTCACHEFRIENDS (1 << 17) /* let realtime stay till your reload */
#define IAX_RTNOUPDATE (1 << 18) /* Don't send a realtime update */ #define IAX_RTUPDATE (1 << 18) /* Send a realtime update */
#define IAX_RTAUTOCLEAR (1 << 19) /* erase me on expire */ #define IAX_RTAUTOCLEAR (1 << 19) /* erase me on expire */
#define IAX_FORCEJITTERBUF (1 << 20) /* Force jitterbuffer, even when bridged to a channel that can take jitter */ #define IAX_FORCEJITTERBUF (1 << 20) /* Force jitterbuffer, even when bridged to a channel that can take jitter */
#define IAX_RTIGNOREREGEXPIRE (1 << 21) #define IAX_RTIGNOREREGEXPIRE (1 << 21)
@ -5517,7 +5517,7 @@ static int update_registry(char *name, struct sockaddr_in *sin, int callno, char
memset(&ied, 0, sizeof(ied)); memset(&ied, 0, sizeof(ied));
p = find_peer(name, 1); p = find_peer(name, 1);
if (p) { if (p) {
if (!ast_test_flag((&globalflags), IAX_RTNOUPDATE) && (ast_test_flag(p, IAX_TEMPONLY|IAX_RTCACHEFRIENDS))) if (ast_test_flag((&globalflags), IAX_RTUPDATE) && (ast_test_flag(p, IAX_TEMPONLY|IAX_RTCACHEFRIENDS)))
realtime_update_peer(name, sin); realtime_update_peer(name, sin);
if (inaddrcmp(&p->addr, sin)) { if (inaddrcmp(&p->addr, sin)) {
if (iax2_regfunk) if (iax2_regfunk)
@ -8426,6 +8426,7 @@ static int set_config(char *config_file, int reload)
/* Reset Global Flags */ /* Reset Global Flags */
memset(&globalflags, 0, sizeof(globalflags)); memset(&globalflags, 0, sizeof(globalflags));
ast_set_flag(&globalflags, IAX_RTUPDATE);
#ifdef SO_NO_CHECK #ifdef SO_NO_CHECK
nochecksums = 0; nochecksums = 0;
@ -8520,8 +8521,8 @@ static int set_config(char *config_file, int reload)
ast_set2_flag((&globalflags), ast_true(v->value), IAX_RTCACHEFRIENDS); ast_set2_flag((&globalflags), ast_true(v->value), IAX_RTCACHEFRIENDS);
else if (!strcasecmp(v->name, "rtignoreregexpire")) else if (!strcasecmp(v->name, "rtignoreregexpire"))
ast_set2_flag((&globalflags), ast_true(v->value), IAX_RTIGNOREREGEXPIRE); ast_set2_flag((&globalflags), ast_true(v->value), IAX_RTIGNOREREGEXPIRE);
else if (!strcasecmp(v->name, "rtnoupdate")) else if (!strcasecmp(v->name, "rtupdate"))
ast_set2_flag((&globalflags), ast_true(v->value), IAX_RTNOUPDATE); ast_set2_flag((&globalflags), ast_true(v->value), IAX_RTUPDATE);
else if (!strcasecmp(v->name, "trunktimestamps")) else if (!strcasecmp(v->name, "trunktimestamps"))
ast_set2_flag(&globalflags, ast_true(v->value), IAX_TRUNKTIMESTAMPS); ast_set2_flag(&globalflags, ast_true(v->value), IAX_TRUNKTIMESTAMPS);
else if (!strcasecmp(v->name, "rtautoclear")) { else if (!strcasecmp(v->name, "rtautoclear")) {

@ -251,29 +251,25 @@ autokill=yes
; ;
;codecpriority=host ;codecpriority=host
; ;rtcachefriends=yes ; Cache realtime friends by adding them to the internal list
; Cache realtime friends by adding them to the internal list ; just like friends added from the config file only on a
; just like friends added from the config file only on a ; as-needed basis? (yes|no)
; as-needed basis.
; ;rtupdate=yes ; Send registry updates to database using realtime? (yes|no)
;rtcachefriends=yes ; If set to yes, when a SIP UA registers successfully, the ip address,
; ; the origination port, the registration period, and the username of
; do not send the update request over realtime. ; the UA will be set to database via realtime. If not present, defaults to 'yes'.
;
;rtnoupdate=yes ;rtautoclear=yes ; Auto-Expire friends created on the fly on the same schedule
; ; as if it had just registered? (yes|no|<seconds>)
; Auto-Expire friends created on the fly on the same schedule ; If set to yes, when the registration expires, the friend will vanish from
; as if it had just registered when the registration expires ; the configuration until requested again. If set to an integer,
; the friend will vanish from the configuration until requested ; friends expire within this number of seconds instead of the
; again. If set to an integer, friends expire ; registration interval.
; 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
;
;rtautoclear=yes
;
;rtignoreexpire=yes ; when reading a peer from Realtime, if the peer's registration
; has expired based on its registration interval, used the stored ; has expired based on its registration interval, used the stored
; address information regardless ; address information regardless. (yes|no)
; Guest sections for unauthenticated connection attempts. Just ; Guest sections for unauthenticated connection attempts. Just
; specify an empty secret, or provide no secret section. ; specify an empty secret, or provide no secret section.

Loading…
Cancel
Save