[asterisk-commits] tilghman: branch 1.4 r284393 - /branches/1.4/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Aug 31 15:13:42 CDT 2010


Author: tilghman
Date: Tue Aug 31 15:13:21 2010
New Revision: 284393

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=284393
Log:
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)

Modified:
    branches/1.4/channels/chan_sip.c

Modified: branches/1.4/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/channels/chan_sip.c?view=diff&rev=284393&r1=284392&r2=284393
==============================================================================
--- branches/1.4/channels/chan_sip.c (original)
+++ branches/1.4/channels/chan_sip.c Tue Aug 31 15:13:21 2010
@@ -17249,7 +17249,7 @@
 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 @@
 	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)) {




More information about the asterisk-commits mailing list