Asterisk as a SIP-to-SIP gateway?

Hi,

I have just discovered Asterisk after searching for SIP servers.
I understand that Asterisk can work as a VoIP<->Plain-old-copper-phone gateway but could I use it as a “simple” VoIP<->VoIP gateway ?

I wish that oversea users just connect their VoIP software to my domain, say foobar.com, and local users do the same so each can talk to the other for the cost of an internet connection.

Thanks,
1010

yes it will work like this lots of info here voip-info.org/wiki-Asterisk