aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-04-16 22:05:27 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-04-16 22:05:27 +0000
commitc4cc369c4ff3d6f5ffcfd657b45a80aece0263ea (patch)
tree959e9b6887cb4572d1ab7324a8e3b1067efb1479 /channels
parent0dcf742d65a91fdb5f7b53c328a8794994c0ace6 (diff)
Merged revisions 188836 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r188836 | tilghman | 2009-04-16 16:57:37 -0500 (Thu, 16 Apr 2009) | 14 lines Merged revisions 188835 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r188835 | tilghman | 2009-04-16 16:41:13 -0500 (Thu, 16 Apr 2009) | 7 lines Only update realtime, if global option rtupdate != false (closes issue #14885) Reported by: deepesh Patches: 20090413__bug14885.diff.txt uploaded by tilghman (license 14) Tested by: deepesh ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@188839 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index d3648a7b7..5cf78d851 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -11117,9 +11117,8 @@ static void destroy_association(struct sip_peer *peer)
char *tablename = (realtimeregs) ? "sipregs" : "sippeers";
if (!sip_cfg.ignore_regexpire) {
- if (peer->rt_fromcontact) {
- ast_update_realtime(tablename, "name", peer->name, "fullcontact", "", "ipaddr", "", "port", "", "regseconds", "0", peer->deprecated_username ? "username" : "defaultuser", "", "regserver", "", "useragent", "", SENTINEL);
- ast_update_realtime(tablename, "name", peer->name, "lastms", "", SENTINEL);
+ if (peer->rt_fromcontact && sip_cfg.peer_rtupdate) {
+ ast_update_realtime(tablename, "name", peer->name, "fullcontact", "", "ipaddr", "", "port", "", "regseconds", "0", peer->deprecated_username ? "username" : "defaultuser", "", "regserver", "", "useragent", "", "lastms", "", SENTINEL);
} else {
ast_db_del("SIP/Registry", peer->name);
}
@@ -17253,7 +17252,9 @@ static void handle_response_peerpoke(struct sip_pvt *p, int resp, struct sip_req
ast_log(LOG_NOTICE, "Peer '%s' is now %s. (%dms / %dms)\n",
peer->name, s, pingtime, peer->maxms);
ast_devstate_changed(AST_DEVICE_UNKNOWN, "SIP/%s", peer->name);
- ast_update_realtime(ast_check_realtime("sipregs") ? "sipregs" : "sippeers", "name", peer->name, "lastms", str_lastms, SENTINEL);
+ if (sip_cfg.peer_rtupdate) {
+ ast_update_realtime(ast_check_realtime("sipregs") ? "sipregs" : "sippeers", "name", peer->name, "lastms", str_lastms, SENTINEL);
+ }
manager_event(EVENT_FLAG_SYSTEM, "PeerStatus",
"ChannelType: SIP\r\nPeer: SIP/%s\r\nPeerStatus: %s\r\nTime: %d\r\n",
peer->name, s, pingtime);
@@ -21673,7 +21674,9 @@ static int sip_poke_noanswer(const void *data)
if (peer->lastms > -1) {
ast_log(LOG_NOTICE, "Peer '%s' is now UNREACHABLE! Last qualify: %d\n", peer->name, peer->lastms);
- ast_update_realtime(ast_check_realtime("sipregs") ? "sipregs" : "sippeers", "name", peer->name, "lastms", "-1", SENTINEL);
+ if (sip_cfg.peer_rtupdate) {
+ ast_update_realtime(ast_check_realtime("sipregs") ? "sipregs" : "sippeers", "name", peer->name, "lastms", "-1", SENTINEL);
+ }
manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "ChannelType: SIP\r\nPeer: SIP/%s\r\nPeerStatus: Unreachable\r\nTime: %d\r\n", peer->name, -1);
if (sip_cfg.regextenonqualify) {
register_peer_exten(peer, FALSE);