Transferring calls between two servers: trunk or register?


I want to transfer calls from one server “A” to another server “B”, I have it working now but I don’t understand why:-)

Until now, Server A just registers in server B as any phone would: in the sip.conf of server B I have set an entry with type=friend and host=dynamic, just as I would do to allow registering a phone.
Though I’ve read that for a Trunk between two servers I should set type=peer and as host I should specify the IP.
So I wonder, why does it work for me like this? What is the difference if I would change type=friend to type=peer and change the host to the ip?

Thank you for any clarification!

You should normally use type=peer with register, as well.

Static addresses are less hassle, more secure, and won’t drop out if register requests get lost. type=peer is more secure and avoids problems when caller ID matches the peer name (although you should not use directory numbers for this, in any case).

I don’t see any real difference between 1) a phone registering to a server and the server transferring calls, with 2) a Server A registering to a server B and server A transferring calls to server B…
Why is it call a Trunk in the latter case as it seems the exact same thing?

You probably don’t understand the purpose of register!

REGISTER is there to cope with UACs that can be moved around. This also makes it able to cope with dynamic IP allocations.

I believe there are SIP services that actually allow the same address of record to register from multiple addresses, at the same time, although Asterisk can’t do that.

It can also be convenient for system administrators who don’t want to do the record keeping needed to associate a MAC with a particular IP address, or particular IP address with a particular user.