Setting up Grandstream HT813 IVR for PSTN

Hello,

I first of all want to say thank you for the warm welcome. This is my second post on this forum for my new phone system project. (I appreciate your patience LOL)
I’m in the process of setting up an IVR with FREEPBX, all of this on a POTS line. I already have designed the IVR map with the prompts & responses the caller will hear. I recently acquired the Grandstream HT813 Gateway to be able to set it up. I have browsed the forum / google looking at previous problems & solutions provided, & I have learned plenty of topics and terms regarding the setup process, however even after following literal step by step on the other threads, I have not yet been succesfull in having Freepbx recognize my gateway, hence its not picking up any calls. On a side note, I have FreePBX running in a Linux environment on a virtual machine installed on a windows desktop PC (which will be considered like a dedicated server). I have successfully configured all the network ports on such Virtual Machine so all the connections made are also transmitted to it.
I have the following settings:

FREEPBX IP: 192.168.1.131
Binding port: 5160
HT813 IP: 192.168.2.1
POTS Number (for reference only): 111-222-3333

Chan_SIP Trunk settings for outgoing:
host=192.168.2.1
port=5062
user=1112223333
type=friend
secret=1112223333
dtmfmode=rfc2833
disallow=all
context=from-trunk
canreinvite=no
allow=ulaw&alaw

Incoming: Blank

HT813 Settings:
Ring on FXS: Off

FXS Account NOT Active

FXO Account tab:

I believe I added all the info needed. :open_mouth:
I greatly appreciate the help in advanced!

You should be using bridged networking on your VM, so the FreePBX IP is on the same subnet as the Windows host and the HT813. With bridged networking, the default would pass all ports so there are no network ports to configure. If you still have trouble in this area, post details (Hyper-V, Virtualbox, VMWare, etc.).

Except possibly for testing, Unconditional Call Forward to PSTN should be left blank, so FreePBX can specify the number to be called.

In Unconditional Call Forward to VOIP, the SIP Server address will likely change, since FreePBX will have a new address with bridged networking.

Set Number of Rings to 2 (to get caller ID passed to FreePBX). Set Stage Method to 1.

If you still have trouble, make a test call in from your mobile. If anything appears in the Asterisk log, paste that at pastebin.freepbx.org and post the link here.

If nothing in the Asterisk log, run sngrep on the PBX and see whether the INVITEs appear there. If so, the call is likely blocked by FreePBX firewall; mark the HT813 address as Trusted.

If also nothing in sngrep, run Wireshark on the host PC and report whether INVITEs from the HT appear and whether they are sent to the correct IP and port.

2 Likes

Stewart,

I greatly appreciate your prompt response!

You should be using bridged networking on your VM, so the FreePBX IP is on the same subnet as the Windows host and the HT813. With bridged networking, the default would pass all ports so there are no network ports to configure. If you still have trouble in this area, post details (Hyper-V, Virtualbox, VMWare, etc.).

Apologies for the confusion. I set it up as a bridged connection. I’m currently running my virtual machine on the Virtualbox software.

Except possibly for testing, Unconditional Call Forward to PSTN should be left blank, so FreePBX can specify the number to be called.
In Unconditional Call Forward to VOIP, the SIP Server address will likely change, since FreePBX will have a new address with bridged networking.

Would you know how to retrieve the correct server address? I’m currently using the address the root interface gave me,

Set Number of Rings to 2 (to get caller ID passed to FreePBX). Set Stage Method to 1.

Got it, & updated it.

If you still have trouble, make a test call in from your mobile. If anything appears in the Asterisk log, paste that at pastebin.freepbx.org and post the link here.
If nothing in the Asterisk log, run sngrep on the PBX and see whether the INVITEs appear there. If so, the call is likely blocked by FreePBX firewall; mark the HT813 address as Trusted.

Nothing on these 2 :frowning:
I downloaded Wireshark on the host Windows PC & tried to look at the results being given back. It seems the gateway does communicate with the Computer, but cannot seem to find much for FreePBX. It could also be I’m not too familiar with Wireshark lol.

Thanks in advanced!

The network setup seems incorrect, unless Virtualbox creates the Host-Only interface even if not being used, or it created it for a VM other than your FreePBX. See
https://www.virtualbox.org/manual/ch06.html
and confirm that the FreePBX VM is Bridged, attached to your Ethernet interface. This assumes you have a wired connection from the host to your router/firewall. If the host is connected via Wi-Fi, it may be difficult or impossible to get this to work, provide details.

To keep this simple, the host, FreePBX and the HT813 should all be on the same LAN subnet that your router/firewall is using. That would likely be 192.168.1.x or 192.168.2.x, but not both. (If both, please explain). For each of the 3 devices, the IP address should either be assigned by the router with DHCP, or statically configured with an IP address within the subnet but outside of the range that the DHCP server hands out. If this is working correctly, you should be able to access both the FreePBX GUI and the HT GUI from the host, and you should be able to ping the HT from a shell prompt on FreePBX.

Note that if a device gets its address via DHCP, you can configure your router/firewall to assign a static address, so it will stay on a known address.

After this is working properly, repeat the tests. If nothing shows in the Asterisk log or in sngrep, a Wireshark capture on the Ethernet interface should show the incoming INVITEs from the HT.

Thanks once again for the reply. Indeed, there was an instance of a host-only interface running; I believe this happened as the first time I created my machine, it was set as a local host only instead of bridged. I deleted such interface and the IP of my FREEPBX Server changed to 192.168.2.101

On FREEPBX’s console, I was able to ping the gateway succesfully, yet I can’t get them to send & receive the calls in between them.

When running Wireshark, I see the invites from the gateway, yet there seems to be a failure coming from FREEPBX. Any insight? My network adapter is for sure bridged. :slight_smile:

Feel we are getting close.

adding the ping results:

image

You don’t show any on your screenshots. Are you sure that there was an incoming call in the interval you are displaying?

Sorry, I See what you mean. Whenever I Call, nothing happens on wireshark neither PBX. I wonder if the gateway is not forwarding calls then?

Sorry, so lost. :frowning:

Is it connected to the POTS line correctly? What does the HT Status page show for the FXO port?

Yes, POTS line is currently connected to the FXO gray port on the gateway. Please see the below for the gateway status:

Something I did notice is that when a call comes in, the FXO port does not display a “RING” status. It stays as IDLE all the time.

I’m very puzzled. Confirm that in the HT, Unconditional forward to VoIP has the correct FreePBX address (I assume 192.168.2.101). Try connecting an analog phone in place of the HT FXO port, using the same cord and confirm that it rings when you call in.

Try setting up syslog on the HT:
Syslog Server: 192.168.2.101
Syslog Level: Extra Debug
Send SIP Log: Yes

With Wireshark capturing on the PC, reboot the HT and you should see lots of syslog messages. Then, call in and report what, if anything, shows up on syslog.

Got it!

I went ahead and enabled SYSLOG on the HT, and made a couple test calls. The following was recorded by wireshark:

When I hang up, thats when SYSLOG displayed the tone stopped.

Definitely calls my attention the “Port unreachable” log.

After restarting, Wireshark populates the following:

The Port Unreachable errors are not a problem. From the point of view of the Windows OS, there is no syslog server listening on UDP port 514 so it responds to each incoming syslog packet with the ICMP error. Wireshark ‘snooping’ the traffic does not count as ‘listening’ for this purpose.

I believe what is actually wrong is that the HT will talk SIP only on its WAN interface. Connect the WAN port to your regular router/firewall. Either configure it with a static 192.168.1.x address (outside the range your router’s DHCP server assigns), or let it get its address by DHCP but configure the router so it is static. The Windows host and the VM should also be connected to the router and have 192.168.1.x addresses. If you don’t have a spare router or switch port, the HT Device Mode can be set to Bridge and you can then plug the computer into the HT LAN port.

You will have to change the trunk config, HT FXO page and syslog setting to use the new 192.168.1.x addresses.

If you still have trouble but something is logged by Asterisk, paste it as described earlier. If not, paste the complete syslog data for a call: In Wireshark, select one syslog packet. Right-click and choose Follow -> UDP Stream. A new window will open showing all the syslog text. Click Save as and save it as a .txt file. Paste that at pastebin.freepbx.org and post the link here.

Thanks Stewart.

I found an old router I had, & as you mentioned, the IP Addresses were automatically set as described below:

HT: 192.168.1.4
FreePBX: 192.168.1.3
Host PC: 192.168.1.2

When making a call, It doesnt seem to populate on asterisk, however the following message does come up:

https://pastebin.freepbx.org/view/89cfcc7d

Also, on Wireshark The call does come up now, please see the below:

https://pastebin.freepbx.org/view/034b6667

I think it may be a port issue at this point?

The following is what comes up under sngrep:

This is really strange. The PBX is attempting to register to the HT. The HT is not a SIP server and that won’t work. But it is apparently a pjsip trunk, yet your config is for a chan_sip trunk and the word ‘pjsip’ (until now) didn’t even appear in this thread.

Also, the HT is attempting to register to the PBX port 5160 (which I assume is chan_sip, if you haven’t changed bind port numbers), but your HT config shows SIP Registration set to No and shows a static config for your chan_sip trunk.

OK, so you need to use pjsip or chan_sip, not both. You can use registration (from HT to PBX), or you can configure statically (the PBX trunk is manually configured with the address of the HT).

Please explain how you are trying to set this up.

Thanks for the continued support.

It might have shown that as I was making a few tests to see how it worked the best.

In your opinion, Will Chan_sip be the best route?

I followed the chan SIP Route, i See the invite to register from the HT to FreePBX, yet it seems that its being blocked, could it be fireall issues? I already listed the address as trusted:

pjsip is simplest and the way of the future, but still has some quirks that make it difficult to use both the FXS and FXO ports on the same device. If you don’t plan to use the FXS, either is fine.