From a8742f4a9ae60b3f6530dd8dbe93249147116c24 Mon Sep 17 00:00:00 2001 From: Tilghman Lesher Date: Tue, 31 Aug 2010 20:13:21 +0000 Subject: [PATCH] Don't send a devstate change on poke_noanswer if the state did not change. (closes issue #17741) Reported by: schmidts Patches: chan_sip.c.patch uploaded by schmidts (license 1077) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@284393 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_sip.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 9de933c46a..6865b51e22 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -17249,7 +17249,7 @@ static int restart_monitor(void) static int sip_poke_noanswer(const void *data) { struct sip_peer *peer = (struct sip_peer *)data; - + peer->pokeexpire = -1; if (peer->lastms > -1) { ast_log(LOG_NOTICE, "Peer '%s' is now UNREACHABLE! Last qualify: %d\n", peer->name, peer->lastms); @@ -17261,8 +17261,12 @@ static int sip_poke_noanswer(const void *data) if (peer->call) sip_destroy(peer->call); peer->call = NULL; - peer->lastms = -1; - ast_device_state_changed("SIP/%s", peer->name); + + /* Don't send a devstate change if nothing changed. */ + if (peer->lastms > -1) { + peer->lastms = -1; + ast_device_state_changed("SIP/%s", peer->name); + } /* This function gets called one place outside of the scheduler ... */ if (!AST_SCHED_DEL(sched, peer->pokeexpire)) { -- 2.47.3