aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-09-02 14:19:36 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-09-02 14:19:36 +0000
commitd1edefbcf4e83a7973009da15f5cc4117196da78 (patch)
treee5cd101bc94aa6718cbe4b79737a59821a215fe8
parentd976cebb0ca48306bf7c7baa52347c489dc2ea50 (diff)
make chan_iax2 rtupdate behave the same as chan_sip
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6501 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xchannels/chan_iax2.c9
-rwxr-xr-xconfigs/iax.conf.sample40
2 files changed, 23 insertions, 26 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 562108acc..ad028bae6 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 da166b0a8..b0878289e 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.