]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Don't send a devstate change on poke_noanswer if the state did not change.
authorTilghman Lesher <tilghman@meg.abyt.es>
Tue, 31 Aug 2010 20:13:21 +0000 (20:13 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Tue, 31 Aug 2010 20:13:21 +0000 (20:13 +0000)
(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

index 9de933c46a401e87126e638726f9871590fc0840..6865b51e22e89d6d0da418c1255618cec3492eca 100644 (file)
@@ -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)) {