Connecting GXW410X with Asterisk

  • Updated on September 14, 2023

Basic configuration of the GXW410X with Asterisk

Please note that due to the customizable nature of both the GXW410X and Asterisk and the vast deployment possibilities, these instructions should be taken as a basic tutorial sample of getting the GXW410X to work with Asterisk. Your implementation may be customized and differ from this basic configuration as according to your needs.

There are two methods to configure the GXW410X to work with Asterisk:

Method 1:

Configure the GXW410X with SIP accounts in Asterisk. This will enable you to put the GXW410X behind a NAT/firewall (used for one-stage and two-stage dialing).

Method 2:

Configure the GXW410X to function as a PEER gateway (no SIP accounts are needed; only used for one-stage dialing).

Depending on your deployment scenario, please choose one method and follow the instructions for that method below.

Configure GXW410X as Peer Gateway

In the sip.conf file, add the GXW410X:

[gxw410x]

type=peer

context=incoming

host=gxw410x_ip_address

insecure=port

On the GXW410X, enter the Asterisk server IP address or FQDN under the Profile 1 web configuration page. Set the SIP Registration setting to No.

If you are not using an outbound proxy, then it is not necessary to enter this information.

Configure GXW410X using SIP Account

In the sip.conf file, add SIP accounts for the GXW410X’s channels. The SIP account user IDs may only be numeric; otherwise the GXW410X will not register the non-numeric SIP accounts. You may add up to four or eight depending on the number of channels you have:

[101]

type=friend

secret=password

host=dynamic

context=internal

insecure=port

Repeat until all desired SIP accounts have been configured. Please note that when using two-stage dialing, the PSTN caller has as much access in the VoIP side of the system as the context the configured SIP account is in allows. This may present a security concern to some if unauthorized callers can commit toll fraud by calling in and using another trunk to make unauthorized outbound calls or gain other unauthorized system access.

On the GXW410X, enter the Asterisk server IP address or FQDN under the Profile 1 web configuration page. Set the SIP Registration setting to Yes.

Under the Channels web configuration page, enter the SIP User IDs, Authentication IDs, and Authentication passwords as well as their corresponding profiles.

Channels

SIP User ID

Authentication ID

Authentication Password

Profile ID

1

101

101

***

Profile 1

2

102

102

***

Profile 1

3

103

103

***

Profile 1

4

104

104

***

Profile 1

5

105

105

***

Profile 1

6

106

106

***

Profile 1

7

107

107

***

Profile 1

8

108

108

***

Profile 1

Table 1: Configure Channels on Web

Next, the GXW410X will need to be configured to use one-stage dialing or two-stage dialing. Please see the Frequently Asked Questions section for the definitions of one-stage and two-stage dialing. Once you have chosen your stage method, please configure Asterisk and the GXW410X using the corresponding procedure below.

Using One-stage Dialing

In the extensions.conf file, you will need to specify what numbers dialed from the VoIP side will be sent through the GXW410X. To specify ten-digit numbers and eleven-digit long-distance numbers conforming to NANPA specifications as well as 911 emergency services to be sent through the GXW410X, use the following syntax in the same context as the VoIP caller, or in an included context:

exten => _NXXNXXXXXX,1, Dial (SIP/${EXTEN}@gxw410x)

exten => _1NXXNXXXXXX,1, Dial (SIP/${EXTEN}@gxw410x)

exten => 911,1, Dial (SIP/${EXTEN}@gxw410x)

If configuring the GXW410X using SIP accounts, please replace “gxw410X” with a SIP account configured on the GXW410X channels, such as “101”.

With this dial-plan, numbers such as (626)956-0260, 1(617)566-9300, and 911 will be dialed through the GXW410X.

Calls coming into the GXW410X from the PSTN side are directly auto dialed to a VoIP extension when using one-stage dialing. On the Asterisk side, set the auto dialed extension in the extensions.conf file, within the same context that the GXW410X is in or in an included context. In this example, we forward incoming PSTN calls to extension 200, which may call a SIP device or play a greeting file (such audio files are generally stored in directory /var/lib/asterisk/sounds). Asterisk can receive the calls auto dialed to extension 200 using the following rule:

exten => 200,1, Dial (SIP/200)

or

exten => 200,1, Background (greeting_filename)

On the GXW410X, under FXO Lines web configuration page set the following:

  1. Wait for Dial-Tone(Y/N) to N.
  2. Stage Method (1/2) to 1.
  3. Unconditional Call Forward to VoIP: The user should construct a valid URI where to forward the call. The User ID can be the extension number like ch1-4:200; The SIP server will be using the IP address or FQDN indicated in the profile page, we use p1 for profile1, p2 or profile2 and p3 for profile3. The SIP destination port should be the one where the Asterisk is listening for incoming SIP communication.

Using Two-stage Dialing

This can only be used when configuring GXW410X with SIP accounts.

Using two-stage dialing, the VoIP users simply need to be able to dial the SIP accounts configured on the channels of the GXW410X. For example, if one of the SIP accounts is SIP/101, we add this line in the extensions.conf file, within the same context as the VoIP caller or in an included context:

exten => 101,1, Dial (SIP/101)

With this rule, VoIP users may dial extension 101 and the call will be connected with the corresponding GXW410X channel, where they will receive the PSTN dial tone to make PSTN calls.

On the GXW410X, under FXO Lines web configuration page set the following:

  1. Wait for Dial-Tone(Y/N) to N.
  2. Stage Method (1/2) to 2.
  3. Unconditional Call Forward to VoIP does not need to be set as it is not used. Incoming PSTN calls will simply receive VoIP dial tone, where the PSTN caller can then dial a VoIP number.

Most settings on the GXW410X web configuration pages are set to default values. However, some settings should be configured according to the local environment if necessary.

Other General Settings

PSTN Settings

The following fields need to be set according to the PSTN Service provider (or PSTN PBX):

  1. Call Progress Tones: Under the Channels web configuration page (Dial Tone, Ring-back Tone, Busy Tone, Reorder Tone).

These should be set according to the PSTN service provider or analog PBX that you are using with the gateway. The format and syntax are shown on the web configuration page. By default, they are set according to North American PSTN settings.

Please remember that the time in ms for the cadences is multiplied by a factor of 10ms. Remember that no carrier uses both current disconnect and tone disconnect at the same time to signals the disconnection of a call.

For a detailed list of the worldwide database of call progress tones in the world please check:

http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf

  1. Caller ID Scheme: Under the FXO Lines web configuration page There are eleven different options to choose from:
    1. – Bellcore/Telcordia, (USA)
    2. – ETSI-FSK during ringing
    3. – ETSI-FSK prior to ringing with DTAS (dual tone alert signal)
    4. – ETSI-FSK prior to ringing with LR (line reversal)
    5. – ETSI-FSK prior to ringing with RP (ring pulse)
    6. – ETSI-DTMF during ringing
    7. – ETSI-DTMF prior to ringing with DTAS
    8. – ETSI-DTMF prior to ringing with LR
    9. – ETSI-DTMF prior to ringing with RP
    10. – SIN 227 – BT (UK)
    11. – NTT, Japan type

DTMF Methods

This is used only for PSTN to VoIP calls, not for VoIP to PSTN.

The gateway allows several combinations of DTMF sending methods from PSTN to VoIP.

Settings

DTMF Method

1

In-audio

2

RTP (RFC2833)

3

In-audio + RTP (RFC2833)

4

SIP INFO

5

In-audio + SIP INFO

6

RTP (RFC2833) + SIP INFO

7

In-audio + RTP (RFC2833) + SIP INFO

Table 2: DTMF Methods

For example, to set all channels to use RFC2833, find the DTMF Method field under the Channels web configuration page and set it to the following:

DTMF Method (1-7): ch1-8:2

Please make sure the DTMF methods you set match those enabled on Asterisk. RFC2833 is the recommended method, which can be set under the [general] area in the sip.conf file with this line:

dtmfmode=rfc2833

NAT Settings

If you are planning to place the gateway within a private network separated from the Asterisk server from behind a firewall, we recommend using a STUN Server. In the STUN Server field under the Advanced Settings web configuration page, enter a STUN server IP or FQDN. You can find free public STUN servers on the internet. Set NAT Traversal (STUN) under the Profile web configuration pages to Yes.

Depending on your network settings, you may set the Use Random Port setting under the Advanced Settings web configuration page to Yes or No. If using a public IP address, set this setting to No.

Preferred Vocoder (Codec)

Under the Profile web configuration pages, you can choose from five different codecs:

PCMU (or G.711 u-law)

PCMA (or G.711 a-law)

G.729A/B

G.723.1

GSM

Please make sure that the codecs you set match those enabled on Asterisk. Codecs may be enabled system-wide in Asterisk or for specific users. For example, to enable PCMU and GSM system-wide, place the following lines under the [general] settings in the sip.conf file:

allow=ulaw

allow=gsm

You should now reload the chan_sip.so module and the extensions in Asterisk, or simply restart the service. The commands vary depending on the version of Asterisk. Update the changes made to the GXW410X and reboot the device. You may now place inbound and outbound test calls to test your configuration.

Please send any comments or suggestions regarding this document to support@grandstream.com.

Was this article helpful?

Related Articles

Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
Contact Support

Leave a Comment