Is it possible?

I have following problem and I do not know how to fix. My Asterisk box is here in USA. I have termination provider in China and do all call termination to China. Users here in USA make calls to China with crystal clear voice, but users in China are not. Is it anyway that I can use asterisk to do authentication and after that users in China connect my provider in China to make calls to China so that call does not travel all the way from China to USA and from USA to China? Does Asterisk have such feature?

This is a typical Asterisk setup adapted to fit your situation.

You have one asterisk machine in the USA and one asterisk machine in China. Your USA customers will connect to the IP address of the asterisk machine in the USA. Your China customers will connect to the IP address of the asterisk machine in China.

If a customer in China calls someone in China, your dial plan (extensions.conf) will need to route the call directly to your provider in China.

If a customer in China calls someone in the USA, your dial plan will need to route the call to the USA machine, which will hand off the call to your USA provider or directly to the customer in the USA.

The opposite is true also.

If a customer in the USA calls a customer in the USA your dial plan will need to route the call to your USA provider or directly to the customer.

If a customer in the USA calls a customer in China, your dial plan will need to route the call to your asterisk machine in China, which will hand off the call to your provider in China.

This can be easily done in your extensions.conf file with the use of the Dial command, and sip or iax.

Dan

I would appreciate it if you can give me an example for sip.conf or extensions.conf.

Machine A Config files
iax.conf ; if you are talking between asterisk servers this is the best way

[machineb]
type=friend
username=machinea
secret=hackme
host=ip address of machine b
context=from-machineb
qualify=yes

extensions.conf

[from-machineb]
extension => _XXXXX,1,Dial(myprovider)
extension => _NXXNXXXXXX,1,Dial(IAX2/machinea/${EXTEN})

Machine B Config files
extensions.conf

iax.conf

[machinea]
type=friend
username=machineb
secret=hackme
host=ip address of machine a
context=from-machinea
qualify=yes

extensions.conf

[from-machinea]
extension => _NXXNXXXXXX,1,Dial(myprovider)
extension => _XXXXX,1,Dial(IAX2/machineb/${EXTEN})

This is the basics. It will need some customizing to your exact needs, but it should be a good place to start. You will still need to configure things like your providers on each end, codecs to use between machines, etc…

Dan