2 Asterisk Boxes

I have 2 asterisk boxes,

First one is installed with all extension connected to it via SIP.
Second one has a T1/E1 card in it and is acting as a gateway.

I need to interconnect the boxes to achieve the following but do not know how.

  1. Call incoming from T1/E1 in the second box are all passed to the first box. The first box has all inbound rules set on it. The Caller Id must remain as it is when it reaches the T1/E1 trunk from outside.
  2. Outbound calls from the first box are passed to the second box to go out to the T1/E1 channels also passing the CID of the individual Extension.

Anyone could give me some help.

That should be eazy any quite straight forward. You should be able to find tons of examples on the net (you’ll need to create a new sip peer on both server).

For interconnecting both Asterisk servers vi internet link, I would recommend using routers that have VPN tunnel support.

Managed to set up the trunk and now i have a connection.

My remaining problem is that any call originating from an internal extension to an external number, the Extensions CID is not being passed out to the trunk.
Also, incoming calls on a DID are not passing the CID to the internal Box so that the inbound route is followed.

Caller ID should get passed by default. However resonsible ITSPs will not forward caller ID outbound if they have not confirmed you have a right to use it.

Using fromuser can frustrate caller ID. The service needs to support Remote-Party-ID, if you must force fromuser.

hmm ic…

how can i set the SIP Trunk then without using fromuser?

Use peers (you should use them anyway) and match based on static IP addresses.

This is what i have right now.

Asterisk - 1 (the one with the extensions)
Outgoing Settings
Trunk Name: trunk-asterisk
PEER Details:
host=192.168.XXX.XXX
username=user-gateway
fromuser=user-gateway
secret=*****************
type=peer
qualify=yes
Incoming Settings
UserContext: trunk-asterisk
User Details:
secret=******************
type=user
context=from-trunk

Asterisk - 2 (the one with the T1/E1)
Outgoing Settings
Trunk Name: trunk-gateway
PEER Details:
host=192.168.XXX.XXX
username=user-asterisk
secret=*****************
type=peer
qualify=yes
Incoming Settings
UserContext: user-gateway
User Details:
secret=******************
type=user
context=from-internal
trustpid=yes

what am i missing?

You are using a GUI. I don’t know how the GUI constructs sip.conf.

hmm oksry…here gos the equivalent in the sip.conf

Asterisk - 1 (the one with the extensions)
[trunk-gateway]
host=192.168.XXX.XXX
username=user-gateway
fromuser=user-gateway
secret=*********
type=peer
qualify=yes

[user-gateway]
secret=***************
type=user
context=from-trunk

Asterisk - 2 (the one with the T1/E1)
[trunk-gateway]
host=192.168.XXX.XXX
username=user-asterisk
secret=*****************
type=peer
qualify=yes

[user-gateway]
secret=*****************
type=user
context=from-internal

My problem is that I would not use two sections for each trunk, but I don’t know enough about your GUI to avoid doing that.

can you maybe tell me how i must do it leave apart the GUI.
I can enter the trunk details myself in the conf file.

Both trunks:

type=peer
host=xxxxx
secret=yyyyy
context=zzzzzz

secret is the same on both sides. I would, however, leave the secret out, and simply make sure that my firewalls didn’t allow spoofing of the IP addresses. Actually, I’ve never tried point to point with secrets. If you do use a secret, it must be the same on both sides.

You use the same entry for both inbound and outbound.

change to what you suggested, but CID is still not passed through

You may find your GUI code is overwriting it. You would need to get a SIP trace to see what is actually being sent.