Dundi multiple result

Hi All…
I use asterisk 1.6
I have multiple asterisk servers scattered over 3 locations. with 2 * boxes at each location. I have also implemented Dundi to do lookup of extensions. every thing is working fine.
Now i want to implement intelligent routing when i get multiple result from Dundilookup. I want to give more preference to the result or IP which is from the same subnet.
For example i get this result.
asterisk2*CLI> dundi lookup 1234567@priv

  1. 0 IAX2/priv:1EURDzB1rHGtsJV4hhJ4SQ==@ (EXISTS)
    from 00:15:17:44:ea:24, expires in 5 s
  2. 0 IAX2/priv:mJ8iFaP1TEoECokC4W1xZQ==@ (EXISTS)
    from 00:15:17:44:aa:34, expires in 5 s
    DUNDi lookup completed in 45 ms
So lets say the Query was from, and the above was the dundi result, 
Now i want to  give preference to, and so on..

Has any one worked on this before, any pointers Appreciated…