How to connect two asterisk by using SIP trunk!

Hello, Friends:
I set two asterisk. I want to connect the two asterisk using SIP trunk. sterisk A has two different IPs, which and and Asterisk B has a IP( How Do I register each other and make dial plan for them. I have read from, but I am not very sure that. Please give me a hand!

Hello, friend:
i read the link. but I am still not very sure the extensions in sip.conf. Please give me an example of sip.conf. thanks!