Page tree
Skip to end of metadata
Go to start of metadata

The Grandstream GXW-410x devices are inexpensive devices that allow you to connect ordinary phone lines to a FreePBX/Asterisk phone system and use those phone lines to make and receive calls.  Each line can support one telephone call.  You will not be able to use call waiting or three way calling from the phone company to have more than one call on a single phone line.  However, you can use FreePBX/Asterisk to conference separate lines together to make a conference calls.  The phone company can set-up multiple phone lines in a rotation, so that if one is busy, the call will ring in on the next available line.

Two models are available.  The GXW-4104 allows you to connect up to four phone lines.  The GXW-4108 allows you to connect up to 8 phone lines.  These instructions are written assuming that you'll use the GXW-4104, but the same instructions will apply to the GXW-4108.

1. Log-in

Access the GXW-4104’s web interface by typing it’s IP address into a browser on the same network.  The default password is “admin” (without the quotes).


NOTE:  Due to firmware changes made by Grandstream since this guide was written, the options listed below have been reorganized into different locations.  They're still there, but you'll have to hunt for them.  

2.  Set a static IP address

You’ll generally want to assign the GXW-4104 to a static IP address.  Do so by changing the following settings:

Basic Settings:

IP Address:

            Check “Statically configured as:”

                        IP Address:

                        Subnet Mask:

                        Default Router:

                        DNS Server 1:

                        DNS Server 2:

(Change these to give the GXW-4104 a unique IP address on your system and to match the IP address of your router and your preferred DNS Servers).

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

(Set this to your time zone).

3.  Change the default Admin password and configure auto updating:

Advanced Settings:

Admin Password:  **WHATEVERYOUWANT

            Firmware Upgrade and Provisioning: 

            Upgrade via:  Check HTTP

            Firmware Server Path:

            Automatic Upgrade:  Yes  (10080 minutes)


4.  Perform an FXO Line Test

You’ll generally want to perform an FXO Impedence test on every line that is connected.  Doing this test will substantially reduce any echo that you may experience on the lines.  Do this test after you connect all of your phone lines.

FXO Line Test:

Click “Test 1” on Line #1. 

Under “Test Parameters,” click “Yes” to the right of “Apply test results automatically.”  Click Update.  Reboot. 

Log back in and go to the same page.  Click “Start Test.”

The test results should show up on the “FXO Lines” tab under AC Termination Impedence.

Ten minutes later, repeat the sequence by unchecking Test 1 on Line 1 and checking Test 1 on Line 2, and then on Line 3, Line 4, etc.  You can skip any line that is not connected.

When finished, uncheck all boxes, update, and reboot.


5.  Configure the GXW-4104 for use with your PBX. 

Make the following changes:

FXO Lines Tab (at top of configuration screen):

FXO Termination:

            7.         AC Termination Impedence:  (This entry comes from the FXO Line Test, above.  You don’t need to change it.)

Channel Dialing to PSTN:

            2.         Stage Method:  ch1-4:1;

Note:  This entry sets up the GXW-4104 to use 1-stage dialing.  With a PBX, you’ll normally want one-stage dialing.

            3.         Min Delay Before Dialing Out:  ch1-4:1300;

Note:  This entry changes the amount of time that the GXW-4104 will wait after picking up the phone and before dialing out.  I changed this because I sometimes have a delay before getting a dial-tone.  You may not need to.

Channel Dialing to VOIP

            1.         Unconditional Call Forward:

                        User ID:  ch1:2125551212;ch2:2125551213;ch3:2135551214;ch4:2125551215;

NOTE:  These are the phone numbers that the GXW-4104 will send to your PBX to identify which phone # is ringing when a call comes in.  In the PBX, you will set-up inbound routes with these numbers listed as your DID.  If you want all calls to be routed the same way on all lines, you could put the same number for each channel and then just create one inbound route (i.e. ch1-4:2125551212).

                        SIP Server:  ch1-4:p1;

                        Sip Destination Port:  ch1-4:5060;

PSTN to VIP Caller ID Setting:

            1.         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. Normally, Caller ID is delivered between the first and second rings, and so 2 rings should be sufficient.  If a caller ID is delivered, the system will stop waiting and pass the call immediately.  If you don’t have caller ID, you should change this to 1, so that your calls are delivered more quickly (i.e., ch1-4:1;).

T.38 Setting:

            1.         T.38 Setting:  change mode= to 2.

Channels Tab (at top of configuration screen):

Phone Number Settings:

You have two choices here:

Choice #1:  If you want each phone line to have its own trunk, you can set-up four different trunks in FreePBX, and then set-up each outbound route to specify which lines get which outgoing calls in which order.  Set the phone # settings as follows:

1. 1      GXWT1           GXWT1           password         Profile 1

2. 2      GXWT2           GXWT2           password         Profile 1

3. 3      GXWT3           GXWT3           password         Profile 1

4. 4      GXWT4           GXWT4           password         Profile 1

Choice #2:  If you want all phone lines to come in and go out on a single trunk.  This means that your PBX will have one trunk, and the GXW-4104 will decide which line to send calls out.  Generally, the GXW-4104 will send out all calls in accordance with your round-robin settings (see below), by using the highest numbered line in the round robin first.

Ch        SIP User ID     Auth. ID           Authen Pwd     Profile ID

1. 1      GXWT1           GXWT1           password         Profile 1

2. 2      GXWT1           GXWT1           password         Profile 1

3. 3      GXWT1           GXWT1           password         Profile 1

4. 4      GXWT1           GXWT1           password         Profile 1

If all lines use the same trunk, make sure that the trunk has insecure=port in the trunk settings!  If not lines 2-4 may not ring into the system.


To avoid conflicts, be sure that no other devices (phones), extensions, or trunks use these SIP User ID or Auth. ID.  Also, change “password” to whatever password you want to use for this Trunk in FreePBX.

Channel Voice Setting:

            1.         TX to PSTN Audio Gain (db):  ch1-4:0;

            2.         RX from PSTN Audio Gain (db):  ch1-4:6;

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

Channel Specific Setting:

            1.         DTMF Methods:  ch1-4:2;

Port Scheduling Schema (VOIP->PSTN)

            1.         Round-Robin and/or Flexible: 

You have two choices here:

Choice #1:  If you want each phone line to have its own trunk, you can set-up four different trunks in FreePBX, and then set-up each outbound route to specify which lines get which outgoing calls in which order.  Set Round Robin as follows:

Round-Robin and/or Flexible:  rr:1;rr:2;rr:3;rr:4;

Choice #2:  If you want all phone lines to come in and go out on a single trunk.  This means that your PBX will have one trunk, and the GXW-4104 will decide which line to send calls out.  Generally, the GXW-4104 will send out all calls in accordance with your round-robin settings (see below), by using the highest numbered line in the round robin first.  Set the Round Robin as follows:

Round-Robin and/or Flexible:  rr:1-4;

            2.         Prefix to Specify Port: 99

Dial-Plan Tab (at top of configuration screen):

Call Routing/Dial Plan (1 Stage Dialing Only) and Dial Settings

            1.         PSTN Outgoing Dial Plan:  {[x*]+}

Note:  This will allow the dialing of feature codes that begin with *.  If you want to allow leading #s, don’t make it x*#, instead separate it out:  {[x*]+|[x#]+}

            4.         DTMF Digit Length (X10ms):  ch1-4:10;

Profile 1 Tab (at top of configuration screen):

Profile Name:  FreePBX

Note:  You can name this whatever you want.

SIP Server:

Outbound Proxy:

Note:  Replace with the IP address of your PBX.

SIP Registration:  No

Note:  If the GXW-4104 will not have a static IP address, then you’ll want the GXW to register with FreePBX/Asterisk.  In that case, make SIP registration “Yes,” and change the trunk settings in FreePBX to host=dynamic.

Register Expiration:  5

 Note:  if you do enable registration, you'll want to make the registration short (like 5 minutes) so that if you reboot your PBX, the GXW-4104 will re-register quickly.


6.  Configure a Trunk in FreePBX:

General Settings

Trunk Name:  GXW4104-1

Outbound Caller ID:  2125551212

Note:  You can put whatever you want here.  It will not have any impact on your actual caller ID, but it may affect what appears in Call Detail Records.

CID Options:  Allow Any CID

Dialed Number Manipulation Rules:




Note:  Change 212 to your local area code to allow 7-digit dialing.


Outgoing Settings:

Trunk Name:  GXWT1

NOTE:  The trunk name above must match the username set in the channels tab of the GXW-4101, or calls that come in on the phone lines attached to the GXW-410x will not be accepted by Asterisk!

Peer Details:












1.  Change above to the IP address of your GXW-4104.  

2.  If you set SIP Registration in the GXW-4104 settings to “Yes,” then you should change the host setting, above to “host=dynamic” and delete the port= line. 

3.  If don’t want to program GXW with username and password, can add “insecure=invite”.

4.  If you want to use a single trunk to receive calls from all lines on the GXW, then delete port=5060 and add “insecure=port".  Otherwise, create a second trunk for Line 2, Line 3, Line 4, and so on, but replace "port=5060" with "port=5062" for line 2, "port=5064" for line 3, "port=5066" for line 4, and so on.

7.  Configure an Inbound Route in FreePBX

Description:  WhateverYouWantHere

DID Number:  2125551212

Set Destination:  WhateverYouWantHere

Note:  Change 2125551212 to whatever numbers you entered in the GXW-4104 for Channel Dialing to VOIP/1. Unconditional Call Forward.

Create an additional inbound route for each phone number you entered in that field.


8.  Configure an Outbound Route in FreePBX

Route Name:  WhateverYouWantHere

Dial Patterns:  Here enter the patterns that you will dial to reach this trunk.  See the Outbound Routes Module documentation (**ADD LINK), the Trunks Module documentation, and the tooltip that appears for this field for more details.

Trunk Sequence:  GXW4104-1

Discussions may be held at

  • No labels


  1. I just got a new GXW4108 with firmware and this guide has been helpful getting me part way to where I need to go.  I don't know how much of it is a difference between the 4104/4108 or the firmware (I believe most of these observations were the same with firmware but I figured I'd share. 

    The FXO Lines tab has been split into 2 sections, settings and dialing.  AC Termination Impedence is under Settings as is Number of Rings Before Pickup. Stage Method and min delay are under Dialing.

    Unconditional Call Forwarding, SIP server, and SIP Destination Port  have been moved to the Settings | Channels Settings as has T.38 FAX settings

    The Channels tab has been removed.  The SIP UserID Settings is now under Accounts | User Accounts

    Channel Voice Settings (Tx and Rx Audio Gain) is now under FXO Lines | Settings

    DTMF Methods has been moved to Settings | Channel Settings

    Port Scheduling is under FXO Lines | Dialing as is the dial-plan

    Profile 1 has been moved to Accounts | General Settings

    SIP registration and Registration Expiration has been moved to Accounts | SIP settings

    I have trunk PEER details set as follows:












    I am using "choice #2" from above with the first 4 channels set with the same SIP UID, Authenticate ID, and "password" with account 1.  I can dial any of the POTS lines and the call comes through (yay!) but dialing out I get a busy error.

  2. Does the Trunk Name contained in the PEER DETAILS section (NOT AT THE TOP) match the username you configured in the GXW?

    1. Yes, "GXWT1" is the trunk name in Asterisk and the SIP User ID and Authenticate ID under the SIP UserID Settings on the device.

    2. I think I finally got this thing working.  I had to replace every instance of "GXWT1" with "101".  Perhaps it is a recent change but in the gxw410x_interop_asterisk.pdf from Grandstream I found the statement:

      "The SIP account user IDs may only be numeric; otherwise the GXW410x will not register the non-numeric SIP accounts."


      1. please send your configuration [email protected]

  3. I have GXWT1 in both my Sip User ID and Auth ID fields for each channel, and mine works fine.  But, I do not have registration enabled.

    1. I don't have registration enabled either but using the name I could not make an outbound call.  Are you using firmware

  4. The username and password settings that you described only affect calls that come into the phone line attached to the GXW-410x.  Asterisk won't accept the calls unless the username and password match.

    They don't affect outgoing calls placed from Asterisk to the GXW-410x for delivery to the attached line.  

    I just tested this and confirmed it by changing the username and password so that it did not match.  I was still able to place outgoing calls, but incoming calls went unanswered.  I then changed the username and password back so that it did match what was in the FreePBX trunk settings, and incoming calls started working again.

    As I indicated earlier, I have SIP Registration disabled on the GXW-4104, and if you have it enabled, that may cause a different result.


  5. Hi all, 

    I have followed this guide, but I am unable to make outgoing calls, I am struggling with this for a whole week. I have even remove all smart routers, and used switch for my network, tested line with old plain analog telephone. Nothing. All I can see in asterisk logs is:

    [2016-08-18 00:01:37] NOTICE[2634][C-0000000f] chan_sip.c: Failed to authenticate on INVITE to '<sip:[email protected]:5160>;tag=as5a62a413'

    I am not sure where to look, or what to search for. Inbound calls are working perfectly, where when I try to call out I get "All circuits are busy".



  6. Alan,

    You've given us very limited information, but from what I can see, it looks like you didn't follow the instructions perfectly.  It appears that your PEER Details in the Trunk says:


    But, it should say


    Change that line, and it should work.

  7. Please move discussions to