Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to create a voip between two clients. I have two asterisks installed and configured on two public ip: Asterisk1 and Asterisk2. I have two clients defined in asterisk1 (client1,client2) and two client defined in asterisk2(client3,client4).

It's easy to configure asterisk1 for client1 to call client2 because client1 and client2 are in the same domain.

BUT WHAT happns If client1@asterisk1 wants to call client3@asterisk2? Do I have to creat a sip trunk between asterisk1 and asterisk2. What are the configurations that i need to implement in bought asterisk servers. Also the RTP stream will be point to point?(client1-client3)? I would like to specify that all the clients are behind nat( have private ip)

Can someone explain in detail this coonfiguration? I would appreciate if you could post some link files with this structure and some explination and asterisk configuration.


share|improve this question

migrated from Nov 7 '11 at 12:17

This question came from our site for professional and enthusiast programmers.

up vote 0 down vote accepted

You have to create a sip trunk in both Asterisk1 and Asterisk2, by editing the file sip.conf. This way the two servers get a link between them. Then you have to provide the rules in extensions.conf to use the trunk when a user in Asterisk1 dials a user in Asterisk2.

With such a configuration I think the RTP flow is point to point, i.e. directly from client1@asterisk1 to client3@asterisk2 (and not from client1 to asterisk1 to asterisk2 to client3!).

You can refer to this page to have an example of configuration files.

share|improve this answer
thx for your answer. I did the example from the link you've posted but when i try to call from client1@asterisk1 to client2@asterisk2 I have the 407 error Proxy Authentification required. Have any idea why? – Angel Dream Nov 1 '11 at 8:26
@AngelDream Try adding insecure=very in the trunk settings in sip.conf – Daniele Nov 1 '11 at 18:03
i did add. the error is either 403 forbidden either 404 not found. the invite is ok, the respose of the second server is 404 though the client from the second server is registered:) – Angel Dream Nov 3 '11 at 14:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.