FreePBX + Digium gateway 2G402F?

Dear all,

I installed a free-PBX (version 14.0.2.14) + Digium Gate 2G402F (4 port) + two PSTN providers

Free-PBX server IP: 192.168.1.10
Digium gateway has two IPs: 192.168.1.11 and 192.168.1.12

I have two extensions: 6XXX and 7XXX
I need to configure outbound calls for extensions with: 7XXX through port 1 on Digium gateway and 6XXX through port 2 on Digium gateway. so I created two trunks in freePBX to Digium gateway:

first trunk:
trunk name: 6XXX
type=peer
secret=password
host=192.168.1.11
defaultuser=user
context=from-trunk

and second trunk:

trunk name: 7XXX
type=peer
secret=password
host=192.168.1.12
defaultuser=user
context=from-trunk

I created outbound route in freePBX and saw that extensions 6XXX go through trunk name: 6XXX and extensions 7XXX go through trunk name: 7XXX

I also created two call routing rules on Digium gateway. the outbound calls on trunk 6XXX go through port 1 and 7XXX go through port 2.

but I have issue, all outbound calls go through port 1 on Digium gateway.

Please help on this

That is probably because the ports in the gateway are configured to act as a trunk, that is the gateway decides which port to use. Look for an option to configure port selection.

I re-checked the call routing rules in gateway.
the trunk 6XXX --> port1 in gateway --> PSTN 1
the trunk 7XXX --> port2 in gateway --> PSTN 2

But outbound calls still went through port 1 --> PSTN1

when I tried to disable port1 in gateway, then outbound calls went through port2 --> PSTN2

Does the gateway verify the trunk by IP address, so any trunks from one IP will be same?

Thanks

In general, all FXO gateways decide internally how to use the ports. Depending on the brand, the configuration varies according to how they manage port assignment. If you are sure that your outbound rules are correctly defined, I suggest you take a look on Digium’s documents to configure port assignment. For example, on Grandstream gateways, you assign the FXO ports to different TCP ports and configure the trunks for each port, like 5060, 5062 and so on. That way the gateway knows which FXO port to use depending on the TCP port that received the dial request. I guess your Digium gateway might have a similar way of doing it, either by TCP ports or by SIP accounts, but you need to check the manual to be sure.

You probably don’t need two trunks, but help us understand your setup a bit better.
When you say you have two extensions, are those SIP endpoints registering to FreePBX, or analog sets connecting to the gateway?

https://wiki.freepbx.org/plugins/servlet/mobile#content/view/28180815

Those SIP endpoints register to Free-PBX. and Free-PBX will do outbound routes to gateway by extension.

If extension is 6XXX–> Trunk name: 6XXX -->Trunk: 6XXX in gateway --> port 1 (E1) --> PSTN1
If extension is 7XXX --> trunk name: 7XXX -->Trunk: 7XXX in gateway --> port 2 (E1) --> PSTN2

It seems digium gateway cannot identify the calls is called from which trunk, I monitored in freepbx log and saw that freePBX sent to gateway as 6XXX@freepbxIP or 7XXX@freepbxIP.

Please help.

Thanks

I don’t see that model on Digium’s website

1 Like

this is the model https://www.digium.com/products/voip-gateways/g400

image
Thanks

That is not a PSTN gateway. That is a T1/E1 gateway.

@arielgrin, when did T1/E1’s stop being able to connect to the PublicServiceTelephoneNetwork?

Sorry, I meant it in the sense that is not an analog gateway. My bad for not specifying correctly.
Anyway, according to its manual, you should have an option called “Send Call Through” on menu “Call Routing rules” that should let you specify which port to use according to specified rules.

there was never a mention of analog in this thread, just E1,

A caveat, I know nothing about these devices, but If the device has two ip’s logically they have two trunks, if they had had two ports, I would assume one trunk and two extensions, if two ip’s then routing through that ip specific trunk is ineffective?

Maybe the rules are not correctly defined, I’m not sure that by only setting two different IPs is enough to direct calls through one port or another. In fact that gateway has four T1 ports.

Try this as a starting point

https://support.digium.com/community/s/article/How-do-I-connect-an-AsteriskNOW-system-with-FreePBX-to-a-Digium-gateway

No guessing allowed, (it’s pointless).

@caoquocai . . . please
a) RTFM
and
b) let us know more about what you did.

I created two trunks to two IP addresses of gateway. In gateway also showed two trunks connected from one IP address: 192.168.1.10 (freepbxIP).

when calling, freePBX routes to gateway with string: 6XXX@freepbxIP or 7XXX@freepbxIP without any information about IP of gateway.

is that problem to make the gateway doesn’t know the calls to which trunk in gateway?

I tried to create one more freePBX with IP 192.192.1.13 and configured like below, it worked.

freepbx1 (192.168.1.10) --> trunk 6XXX in gateway --> PSTN1
freepbx2 (192.168.1.13) --> trunk 7XXX in gateway --> PSTN2

Thanks

Did you read all of

yet?

I already read this some times, but it not mentions about one free-PBX to gateway with two trunks.

You will have to be way more explicit as to how you did that, you might want to go to the Digium support site because that is where you bought it, I’m sure you will find other folks with the same hardware and likely useful solutions, here you will find . . . . well , not so many, so we can’t guess.