Connect 2 Asterisk Servers SIP accounts

Hello community,

I would like to ask you if i can connect two different Asterisk servers in the same local network while you use SIP accounts.

Because i ve found some tutorials and i got confused, my questions is, do i have to configure iax.conf and extensions.conf file and leave the sip and pjsip files as they are ?

And could you please enlight me with a helpfull tutorial??

Thanks in advance.

The WIKI has a example of a trunk between peers.

Hello johnkiniston,

Thank you so much for your reply.

I have tried some configurations, but it didnt work.

I opened a new topic explaning everything.

I would be gratefull if you could help me somehow.

Thanks in advance.

Hello johnkiniston,

I would like to ask you something.

I have SIP accounts and 2 servers.

I want to connect the two servers

So i attached one user to 1st server and 2nd user to the second server.

Do i have to configure iax.conf file to make it work, or the configurations will be only in sip.conf file?

Thanks in advance.

You do not need to modify iax.conf to connect two servers using SIP.

I linked above to the WIKI where there is a configuration example

Hello johnkiniston,

Thank you for your reply.

I found here also a example for sip trunk.

It has less configurations.

But i want to ask you something because iam so confused.

Lets say we follow this one :

register => myaccountname:1234567890@ :5060


I have 2 servers and 2 users. One is attached to the 1st and the other to the 2nd.

Can you please explain the logic of the trunks and the configuration, because iam completely lost who is registering where and how.

Thanks in advance.

I don’t recommend you use registration, just create a static definition.

Let’s assume you have a Asterisk 1.8 PBX at the IP called ‘Kilroy’

Let’s assume your modern asterisk PBX is at the IP of and it’s called ‘Bozo’

To define a trunk on Bozo to send and receive calls from Kilroy you would edit your pjsip.conf and create an aor, endpoint, and an identify section.




On Bozo you can dial extension 100 at Kilroy PBX by dialing PJSIP/100@kilroy

When calls arrive at Bozo from Kilroy they will be matched by the identify section to the endpoint and will arrive at the context ‘from-kilroy’

On Kilroy to create you trunk to Bozo you would modify sip.conf and add a peer.


To dial extension 200 at Bozo from Kilroy you would dial SIP/200@Bozo

When calls arrive at Kilroy from Bozo they will be matched by the IP address and will arrive at the context ‘from-bozo’

1 Like

Hello johnkiniston,

I did it the way you said but with the sip configurations.

Finally i found out how it works, the logic behind the trunks.

Really appreciate the fact that you spent time explaining to me.

Really thank you.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.