Ok this is how we do it on my client.
My client is a well know bank that has multiple branches in different regions (APAC, EMEA, CALA, NAR)
Now each countries have their own avaya system. Practically S87xx.
Now, for them to perform long distance calls without adding a charge on their local PSTN, they are utilizing their WAN connectivity as their means of communication. Let say country A branch wants to call Country B brach or Country C. These Cisco WANs routers are under control of a single Cisco Call Manager.
Each Avaya PBX on different countries have a tieline going to a their local router. (Please also take note that each country has their own ISDN line terminated on their avaya system - this ISDN lines have their own DID range)
Also take note that each user on each of the countries have their own DID number.
The dialing algorithm performed is if User A (In Country A) tries to call User B (In Country B) they need to dial the ff: format:
Country exit code + Country Code + area code + Telephone Number
The routing algorithm perform is i will pass the DTMF tones dialed by the user on the Cisco Tieline first, then if Cisco tieline is not available due to some circumstances, it will route to local PSTN, AND ALSO Let say, if users try to dial NON DID number, it will route to Cisco gateway but if the Cisco voice gateway cannot understand the digits thrown by Avaya, it will pass the signal back to avaya and will say I cannot process this, then avaya will rehunt another channel available on the next trunk which is the local PSTN. (Route Pattern Manipulation)