Same Local and Remote Extension

Hi,
I have 2 asterisk boxes connected via SIP trunk, i have extension 6000 on boxA, and the same extension on the remote Asterisk boxB, an outbound route from boxA to boxB to route 6XXX extensions to boxB, so when i dial 6000 from boxA , asterisk seems to get confused, what i want to achieve is that if he can’t find the extension 6000 registered on boxA, to try to dial it through the trunk to boxB,

is it possible?