Block extensions by inbound route?

I have a pbx that I share w/ a friend. We both own small businesses. All is working well, with one minor annoyance.

When a client call into one of his DID’s, they can go to my extension (I’m 701, my friend is 601), but should only be able to go to his.

Is there a way to restrict the available extensions based on inbound route?

Maybe I’m making it harder than it is, but I’m not seeing a way.

Thanks!

Yes, create a different directory for each business.

Yes, thank you. A while after my post, I realized how I could do it.
I already had the directory, but during the playing of the main IVR for my friend’s business I had allowed directly dialing an extension.
I turned that off so they were forced to make the correct choice.
It’s all working pretty well now.
Thank you for taking the time to answer.