From a2be145193cfe824d8994d87d4296275231b6aa3 Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" <kpfleming@digium.com> Date: Fri, 2 Sep 2005 14:19:36 +0000 Subject: [PATCH] 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 --- channels/chan_iax2.c | 9 +++++---- configs/iax.conf.sample | 40 ++++++++++++++++++---------------------- 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 562108acc3..ad028bae60 100755 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -239,7 +239,7 @@ struct iax2_context { #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_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_FORCEJITTERBUF (1 << 20) /* Force jitterbuffer, even when bridged to a channel that can take jitter */ #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)); p = find_peer(name, 1); 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); if (inaddrcmp(&p->addr, sin)) { if (iax2_regfunk) @@ -8426,6 +8426,7 @@ static int set_config(char *config_file, int reload) /* Reset Global Flags */ memset(&globalflags, 0, sizeof(globalflags)); + ast_set_flag(&globalflags, IAX_RTUPDATE); #ifdef SO_NO_CHECK 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); else if (!strcasecmp(v->name, "rtignoreregexpire")) ast_set2_flag((&globalflags), ast_true(v->value), IAX_RTIGNOREREGEXPIRE); - else if (!strcasecmp(v->name, "rtnoupdate")) - ast_set2_flag((&globalflags), ast_true(v->value), IAX_RTNOUPDATE); + else if (!strcasecmp(v->name, "rtupdate")) + ast_set2_flag((&globalflags), ast_true(v->value), IAX_RTUPDATE); else if (!strcasecmp(v->name, "trunktimestamps")) ast_set2_flag(&globalflags, ast_true(v->value), IAX_TRUNKTIMESTAMPS); else if (!strcasecmp(v->name, "rtautoclear")) { diff --git a/configs/iax.conf.sample b/configs/iax.conf.sample index da166b0a80..b0878289e0 100755 --- a/configs/iax.conf.sample +++ b/configs/iax.conf.sample @@ -251,29 +251,25 @@ autokill=yes ; ;codecpriority=host -; -; Cache realtime friends by adding them to the internal list -; just like friends added from the config file only on a -; as-needed basis. -; -;rtcachefriends=yes -; -; do not send the update request over realtime. -; -;rtnoupdate=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 -; -;rtautoclear=yes -; -;rtignoreexpire=yes ; when reading a peer from Realtime, if the peer's registration +;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 + ; address information regardless. (yes|no) ; Guest sections for unauthenticated connection attempts. Just ; specify an empty secret, or provide no secret section. -- GitLab