[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.
Asterisk Freepbx Setup
The first step is setup Asterisk (FreePBX) for incoming or outgoing calls from the PSTN phone line connected to ATA HT503.
- Create a normal SIP Trunk named Claro_1, registering HT503 IP address, user context and password por incoming settings, such as is shown below:
- Create outgoing Route to sip trunk Claro_1 using the dial pattern prefix 9 + local number, such as is shown here:
- 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:
ATA HT503 setup
- 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.
- Type this IP address on a Internet Browser to setup the device:
- Now in the Basic Settings tab, must be typed a fixed IP address, for this example 172.18.1.10:
- 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:
- 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:
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.