Index: pbx/pbx_dundi.c =================================================================== --- pbx/pbx_dundi.c (revision 354394) +++ pbx/pbx_dundi.c (working copy) @@ -3366,9 +3366,11 @@ } AST_LIST_TRAVERSE(&peers, peer, list) { - if (has_permission(&peer->include, dr->dcontext) && - ast_eid_cmp(&peer->eid, &trans->them_eid) && - (peer->order <= order)) { + if (ast_eid_cmp(&peer->eid, &empty_eid) && // if the peer's eid is not 00:00:00:00:00:00 (in case of dynamic peers) + (peer->lastms > -1) && // if the peer is reachable + has_permission(&peer->include, dr->dcontext) && // if the peer has the destination context in its include + ast_eid_cmp(&peer->eid, &trans->them_eid) && // if the peer is not the transaction endpoint + (peer->order <= order)) { /* For each other transaction, make sure we don't ask this EID about the others if they're not already in the list */ @@ -4521,7 +4523,9 @@ if (needregister) { peer->registerid = ast_sched_add(sched, 2000, do_register, peer); } - qualify_peer(peer, 1); + if(ast_eid_cmp(eid, &empty_eid)) { // if the peer's eid is not 00:00:00:00:00:00 (in case of dynamic peers) + qualify_peer(peer, 1); + } } AST_LIST_UNLOCK(&peers); }