ATA HT503 – Connecting PSTN phone line to Asterisk Server

[Encuentra la versión en español aquí ]

This article describe a procedure to connect a phone line to Asterisk server, using a Grandstream ATA HT503 gateway.

For this example, we will use the public switching telephone network number 7020806. The incoming calls from this phone, must end  on internal extensions via Asterisk IVR, or using the dialing pattern 9 + local number to do outgoing calls.

Setup ATA HT503 to PSTN line
Setup ATA HT503 to PSTN line

Asterisk Freepbx Setup


The first step is setup Asterisk (FreePBX) for incoming or outgoing calls from the PSTN phone line connected to ATA HT503.

  1.  Create a normal SIP Trunk named Claro_1, registering HT503 IP address, user context and password por incoming settings, such as is shown below:

SIP trunk for PSTN line
SIP trunk for PSTN line
  1. Create outgoing Route to sip trunk Claro_1 using the dial pattern prefix 9 + local number, such as is shown here:

Outgoing calls from extensions to PSTN Line
Outgoing calls from extensions to PSTN Line
  1. Now is created a incoming route named «Entrante_Claro1» for calls from PSTN line. These calls end to an IVR previously created, such as is shown here:

Incoming route for calls from PSTN line
Incoming route for calls from PSTN line

ATA HT503 setup


  1. To know the DHCP IP address asigned automatically, a phone must be connected to FXS port, and dial  “***”,  a voice record will say the ATA IP address.
  1. Type this IP address on a Internet Browser to setup the device:

Login HT503
Login HT503
  1. Now in the Basic Settings tab, must be typed a fixed IP address, for this example 172.18.1.10:

Fix IP for HT503
Fix IP for HT503
  1. At the end of page in “Unconditional Call Forward to VoIP” option, type the default extension where the incoming calls must be forwarded, in this example is typed the incoming route ID (CID) + SIP server IP (Asterisk server) and SIP port. The CID have an additional 1 + 7020806, because the local PSTN add the city prefix automatically, such as is shown below:

Forwarding incoming calls
Forwarding incoming calls
  1. In “FXO Port” tab is typed the Asterisk IP address  in  “Primary SIP Server”.  Below is typed the  SIP User ID, Authentication ID and Authenticate Password, according the «User Context» data named «claro-in» fom SIP trunk «Claro_1». Also must be set the parameters marked in red square:
"<yoastmark
"<yoastmark
"<yoastmark
"<yoastmark

With Apply button all changes will be saved. Normally the ATA must be rebooted to apply all configuration changes.

In Conclusion, when an incoming call is from PSTN line, the ATA HT503 receive it and route it to Asterisk server, Asterisk receive this call using an IVR to end in some internal extensions.

And for outgoing calls from the extensions, when someone dial 9 + local number, the call is routed to ATA HT503, and finally send the dialing phone data to PSTN network.

This configuration only allow one call every time, either outgoing or incoming.

This article is part of the knowledge base service of ITSoftware SAS.

Please share this article if you like it. 😉

Deja un comentario

Tu dirección de correo electrónico no será publicada.

Este sitio usa Akismet para reducir el spam. Aprende cómo se procesan los datos de tus comentarios.