I am really new to this so i am sorry if its a stupid question,
what i want is that i have for example 2 buildings that each one have 5 offices
i also want the users to have same numbers
building1
Office 1 - number 1
Office 2 - number 2
…
building2
Office 1 - number 1
Office 2 - number 2
if office 1 on building2 dial 2 it should call office 2 in building2
and if office 1 on building1 dial 2 it should call office 2 in building1
Please explain your application. If these are unrelated organizations, you could (for example) run two instances of FreePBX in VMs on the same server, or use a competing system such as FusionPBX.
If these are branch offices of the same company, for example the result of a merger or acquisition, I recommend re-numbering so each associate has a unique number.