Call Routing on GRANDSTREAM GXW4104


Anyone can help me on how to configure freepbx to route calls to specifix channel on the GRANDSTREAM GXW4104? thanks…

Grandstream has instructions on how to do this on their web-site. Assuming you’ve started with that, the channels are generally addressed using their port #.

5060 - Line 1
5062 - Line 2
5064 - Line 3
5066 - Line 4

I have some detailed instructions on how to configure the GXW, so if this is too specific, let me know and I’ll post the entire set of instructions when I get back to my main computer.

Be sure to run the impedence tests! This is critical to ensure good call quality. I also like to reduce the TX Gain to -5.

Thank you AdHominem

I already read through all the manuals available on their website. Maybe i’m missing something here…

I created 4 trunks in freepbx with different dial plans, corresponding to each user on the Grandstream Channel Tab, but each time i dialed a number its not going to the channel that it should… It would help if you can share your instructions here… thank you very much,

GXW-4104 Settings

Basic Settings:

Statically configured:
IP Address:
Subnet Mask:
Default Router:
DNS Server 1:
DNS Server 2:

Time Zone: GMT -8:00 (US Pacific Time, Los Angeles)

Note: .xxx above refers to the IP address you are assigned to the GXW and NOT to the address of your PBX.

Advanced Settings:

Admin Password: ** (Whatever you want)
Firmware Upgrade and Provisioning:
Firmware Server Path:
Automatic Upgrade: Yes (10080 minutes)

FXO Line Test:

Click “Test 1” on Line #1. Click “Yes” to the right of “Apply test results automatically.” Click Update. Reboot. Click “Start Test.”

A few minutes later, repeat the sequence on line 2. The test results should show up on the “FXO Lines” tab under AC Termination Impedence.

FXO Lines:

AC Termination Impedence: ch1:8;ch2:7;ch3-4:0;

(This entry comes from the FXO Line Test, above for my lines. Your mileage may vary). Do not set these yourself. Just check them to make sure that the test results actually got updated here.

Channel Dialing to PSTN:
Stage Method: ch1-4:1;
(For two-stage dialing, change this from 1 to 2. Note that the GS only supports 1 or 2-stage dialing, and not both).

Min Delay Before Dialing Out: ch1-4:750;
Note: The above is required at my location, but may not be at yours.

Channel Dialing to VOIP

  1. Unconditional Call Forward:
    User ID: ch1:2125551000;ch2:2125551001;ch3:2125551002;ch4:2125551003

NOTE: These are the phone numbers that the inbound routes will use when calls come in. You should change them to your DID numbers. Your inbound routes should match whatever DIDs you set here.

SIP Server: ch1-4:p1;
Sip Destination Port: ch1-4:5060;

PSTN to VIP Caller ID Setting:
Number of Rings Before Pickup: ch1-4:2;

Note: This is the number of rings that the system will wait to receive a Caller ID before passing the call along. If a caller ID is delivered, the system will stop waiting and pass the call immediately. So, if you don’t have caller ID, you may wish to set this to 0.

Channel Voice Setting:

TX to PSTN Audio Gain (db): ch1-4:-5;
RX from PSTN Audio Gain (db): ch1-4:12;

Note: You may have to adjust the figures above. TX is the volume of the audio sent from the microphone of my phone. RX is the audio sent from the phone company to the speaker of your own phone.

Channel Specific Setting:

  1. DTMF Methods: ch1-4:3;

Note: If 3 causes problems, try 1.

Port Scheduling Schema (VOIP->PSTN)
Round-Robin and/or Flexible: rr:1;rr:2;rr:3;rr:4;

Note: This setting has no round-robin. Each line operates independently. If you want to address each trunk individually, you’ll want to use the above. If you want round robin to work, i.e. if one trunk is busy, the GXW will try another, use this instead:


Prefix to Specify Port: 9999999999

Note: The above is used to prevent users from choosing which line their calls will go out on. FreePBX should do that in the outbound routes.


PSTN Outgoing Dial Plan: {[x*#]+}
DTM Digit Length (X10ms): ch1-4:10;

Profile 1:
Profile Name: FreePBX
SIP Server: 192.168.1.yyy
Outbound Proxy: 192.168.1.yyy
SIP Registration: No

Note: yyy above refers to your PBX IP address, and not the address you fixed for the GXW-4104 above (which is marked as .xxx).

FreePBX Trunk Settings

GXW4104 Line 1

Trunk Name: GXW4104-1
Outbound Caller ID: 2125551000
CID Options: Allow Any CID
Maximum Channels:

Dialed Number Manipulation Rules:

(Change 212 in the second line above to your area code to allow 7-digit dialing. Change the outbound Caller ID to the phone number this line will use).

csv version


Trunk Name: GXW4104-1
Peer Details:


GXW4104 Line 2

Trunk Name: GXW4104-2
Outbound Caller ID: 2125551001
CID Options: Allow Any CID
Maximum Channels:

Dialed Number Manipulation Rules:

See CGXW4104-1

Trunk Name: GXW4104-2
Peer Details:


Note: If you use Line 3 and 4, just duplicate Line 2, but change port to 5064 for Line 3and 5066 for Line 4.

Hi AdHominem!

This line did the trick!

Port Scheduling Schema (VOIP->PSTN)
Round-Robin and/or Flexible: rr:1;rr:2;rr:3;rr:4;

Thank you very much… Hope I can share too… =)