]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 284393 via svnmerge from
authorTilghman Lesher <tilghman@meg.abyt.es>
Tue, 31 Aug 2010 20:18:32 +0000 (20:18 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Tue, 31 Aug 2010 20:18:32 +0000 (20:18 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r284393 | tilghman | 2010-08-31 15:13:21 -0500 (Tue, 31 Aug 2010) | 7 lines

  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.6.2@284399 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 5ebd1f558ad681038ee8c47167f46d811bd450f4..26cc5a21448f1ba186b67b39a9aa45c69e0a67d5 100644 (file)
@@ -23050,7 +23050,7 @@ enum st_mode st_get_mode(struct sip_pvt *p)
 static int sip_poke_noanswer(const void *data)
 {
        struct sip_peer *peer = (struct sip_peer *)data;
-       
+
        peer->pokeexpire = -1;
 
        if (peer->lastms > -1) {
@@ -23069,12 +23069,15 @@ static int sip_poke_noanswer(const void *data)
                peer->call = dialog_unref(peer->call, "unref dialog peer->call");
                /* peer->call = sip_destroy(peer->call);*/
        }
-       
-       peer->lastms = -1;
-       ast_devstate_changed(AST_DEVICE_UNKNOWN, "SIP/%s", peer->name);
+
+       /* Don't send a devstate change if nothing changed. */
+       if (peer->lastms > -1) {
+               peer->lastms = -1;
+               ast_devstate_changed(AST_DEVICE_UNKNOWN, "SIP/%s", peer->name);
+       }
 
        /* Try again quickly */
-       AST_SCHED_REPLACE_UNREF(peer->pokeexpire, sched, 
+       AST_SCHED_REPLACE_UNREF(peer->pokeexpire, sched,
                        DEFAULT_FREQ_NOTOK, sip_poke_peer_s, peer,
                        unref_peer(_data, "removing poke peer ref"),
                        unref_peer(peer, "removing poke peer ref"),