Call routing (from inside to outside) without LD charges

Hi guys ! I have been administering about 100 sip phones that can take calls from outside (eg landline phone) and route it within the asterisk system with no problems. Most of the phones are connected miles apart from each other. The voice data are routed through the internet (we are using vpn).

I would like to be able to place a call from one of our provincial site or remote site to the main asterisk server and route this call to a landline without incurring long distance charges.

I hope that I have asked it clearly. I also hope someone will give me an idea on how to do it or where to go for support. I have searched through google without finding a similar scenario.

I imagine you haven’t found anything on Google because this (remote breakout) is too easy, once you have “trunks” and a basic understanding of Asterisk dialplans.

Match the prefix at the source site, route the call with full digits down the trunk. Have the incoming context for the trunk include or be the same context as local “extensions” that have outgoing call class of service.