[svn-commits] mjordan: branch 10 r372418 - in /branches/10: ./ pbx/pbx_dundi.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Sep 5 21:49:43 CDT 2012


Author: mjordan
Date: Wed Sep  5 21:49:41 2012
New Revision: 372418

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=372418
Log:
Fix DUNDi message routing bug when neighboring peer is unreachable

Consider a scenario where DUNDi peer PBX1 has two peers that are its neighbors,
PBX2 and PBX3, and where PBX2 and PBX3 are also neighbors.  If the connection
is temporarily broken between PBX1 and PBX3, PBX1 should not include PBX3 in
the list of peers it sends to PBX2 in a DPDISCOVER message, as it cannot send
messages to PBX3.  If it does, PBX2 will assume that PBX3 already received the
message and fail to forward the message on to PBX3 itself.  This patch fixes
this by only including peers in a DPDISCOVER message that are reachable by the
sending node.  This includes all peers with an empty address
(00:00:00:00:00:00) and that are have been reached by a qualify message.

This patch also prevents attempting to qualify a dynamic peer with an empty
address until that peer registers.

(closes issue ASTERISK-19309)
Reported by: Peter Racz
patches:
  dundi_routing.patch uploaded by Peter Racz (license 6290)

The patch uploaded by Peter was modified slightly for this commit.
........

Merged revisions 372417 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Modified:
    branches/10/   (props changed)
    branches/10/pbx/pbx_dundi.c

Propchange: branches/10/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/10/pbx/pbx_dundi.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/pbx/pbx_dundi.c?view=diff&rev=372418&r1=372417&r2=372418
==============================================================================
--- branches/10/pbx/pbx_dundi.c (original)
+++ branches/10/pbx/pbx_dundi.c Wed Sep  5 21:49:41 2012
@@ -3351,8 +3351,10 @@
 		}
 
 		AST_LIST_TRAVERSE(&peers, peer, list) {
-			if (has_permission(&peer->include, dr->dcontext) &&
-			    ast_eid_cmp(&peer->eid, &trans->them_eid) &&
+			if (ast_eid_cmp(&peer->eid, &empty_eid) &&			/* peer's eid is not empty (in case of dynamic peers) */
+				(peer->lastms > -1) &&							/* peer is reachable */
+				has_permission(&peer->include, dr->dcontext) &&	/* peer has destination context */
+				ast_eid_cmp(&peer->eid, &trans->them_eid) &&	/* peer is not transaction endpoint */
 				(peer->order <= order)) {
 				/* For each other transaction, make sure we don't
 				   ask this EID about the others if they're not
@@ -4505,7 +4507,9 @@
 		if (needregister) {
 			peer->registerid = ast_sched_add(sched, 2000, do_register, peer);
 		}
-		qualify_peer(peer, 1);
+		if (ast_eid_cmp(&peer->eid, &empty_eid)) {
+			qualify_peer(peer, 1);
+		}
 	}
 	AST_LIST_UNLOCK(&peers);
 }




More information about the svn-commits mailing list