Calls from one Asterisk box to another

Hi, i’m new to asterisk so this question may seem obvious to some of you…

I would like to make calls from one asterisk server to another, i’ve already done this with the two servers in the same network (ex : server1 - 192.168.1.100 server2 - 192.168.1.110) but now I want to place the second server in a complete different network

ex:
server 1 will be in 91.100.124.12
server 2 will be in 83.211.15.123

Both of them are behind a router so they wont have the address the my isp provide me (the router in the network of server1 will have the address 91.100.124.12 and then the server will have an address like 192.168.x.x) I would like to know what kind of config in which device (router or server) I have to do to make calls to the other server.

Thank you!

This link will be useful for you

Thank you, usefull link but is there any way to do it with the SIP protocol ? or better said, why the 3 methods use IAX instead of SIP.

Thank you!

Yes is possible, actually is very similar only you have to add two lines in the peer configuration:

in the register section you need to make the registration of peer:

register => your-remote-peer1:remote-password@domain-of-asterisk/or-static-ip

[Your peer]
type=friend
defaultuser=your user
secret=yourpass
context=your context
host=dynamic
disallow=all
allow=your codec
qualify=yes
insecure=invite,port ; important add this line
port=5060