Grandstream HT813 as PSTN Gateway


(Sepu Le Vrai) #1

Hi,

In advance, sorry for my bad english, but i’m french and… that’s it…

I’ve buying a GrandSteam HT813 to make it as a PSTN Gateway to used my Land line. But i’m experiencing some problems.

I’ve tested some solutions, but nothing to do, it’s only a echec.

This : --https–://wiki.freepbx.org/pages/viewpage.action?pageId=33293313
nothing to do.

This :
–https–://community.freepbx.org/t/grandstream-ht813-as-voip-gateway/65188
Same issue

And this :
–https–://forums.grandstream.com/t/help-configuring-ht813-as-a-trunk-to-pstn-freepbx/41487
Same crap.

I’m disapointed and i found nothing to make it work.

help me please !

PS. : I’m currently on the following setup by following this page:
–https–://wiki.freepbx.org/pages/viewpage.action?pageId=33293313


#2

More information needed. Post logs. Post configuration. But make password XXXXXX before you post.


(Sepu Le Vrai) #3

conf of, HT813 and freepbx ?


(Sepu Le Vrai) #4

There is TRUNK SIP SETTING in FreePBX

Outgoing :
user=03XXXXXXXX
type=peer
secret=XXXXXXXXXX
port=5062
host=192.168.2.14
fromuser=03XXXXXXXX
dtmfmode=rfc2833
disallow=all
context=internal-phones
canreinvite=no
authname=03XXXXXXXX
allow=ulaw&alaw

Incoming :
EMPTY

There is config in HT813 :
http://gofile.me/4GkQs/4hyX9jAKK

File expire 11th september 2020


#5

By default in FreePBX, pjsip listens on port 5060 and chan_sip is on port 5160. On the FXO tab, Primary SIP Server should be
192.168.2.243:5160
Outbound Proxy should be blank.
(If you have changed Port to Listen On for pjsip and/or Bind Port for chan_sip, please provide details.)

The Neufbox plays a non-standard dial tone that the HT may not recognize, so set Wait for Dial-Tone to No. Also set Stage Method to 1.

You have the HT registering to the PBX but also have a static configuration for the trunk. I don’t know whether that’s a conflict. I recommend using registration; registered status lets you know that basic communication between the devices is working. Please try this config:

user=03XXXXXXXX
type=friend
secret=XXXXXXXXXX
host=dynamic
dtmfmode=rfc2833
disallow=all
context=from-trunk
canreinvite=no
allow=ulaw&alaw

Also, Trunk Name on the Outgoing tab should be 03XXXXXXXX (same as username).

Reboot the HT, wait for it to come ready, its Status page should show the FXO as Registered and Idle.

If not, we will troubleshoot that first. What, if anything appears in the Asterisk log when it attempts to register?

If registration is successful, try an outgoing call. If that fails, at the Asterisk command prompt, type
sip set debug on
retry the call, paste the relevant section of the Asterisk log at pastebin.freepbx.org and post the link here. Also, report what you hear on the call attempt.

If registration is successful, try an incoming call. If that fails, post the log as above and report what the caller hears.


(Sepu Le Vrai) #6

Outgoing call ring constantly
Incoming call say after 3 ring with the FPBX voice : “the number you call doesn’t exist”

I guess, i delete all config, can you make for me a step by step config for all elements ?

FPBX is fully fonctionnal with a OVH SIP config with no problem (incoming / outgoing)
but i’ve configured incoming and outgoing config


#7

For both of these, please post logs as noted above. After enabling SIP debug and making the test call, you should be able to view the log at Reports -> Asterisk Logfiles.

I believe that your present config is fairly close and there is no reason to start over.


#8

I tried calling and indeed got “n’est pas en service” (not “n’est pas attribué”) so it’s definitely from FreePBX. I don’t see why it doesn’t match the trunk; try setting a catch-all Inbound Route (any DID any CID). If that doesn’t help, we need the log.

Regarding the 3 rings, I suspect that the FXO setting Number of Rings applies even with one-stage; try setting that to 1.


(Sepu Le Vrai) #9

Are you… french ?


#10

I’m American but live part time in Paris. I have “Red by SFR” there so am familiar with Neufbox. However, the FXO device is Obihai OBi110 and I’m just guessing about the equivalent settings for Grandstream.


(Sepu Le Vrai) #11

Okay :wink:

I’m very happy you help me.

I’m going to make meal for my children and the “mama” :slight_smile:

Ses ya later


(Sepu Le Vrai) #12

a multi-faceted home system administrator including that of the culinary establishment


(Sepu Le Vrai) #13

Hey !

Incoming call to the HT813 : OK (but don’t see the correct Number, i see only the number of the land line)
Outgoing call through the HT813 : “toutes nos lignes sont occupées, merci de réessayer plus tard” and the log :

[2020-09-08 07:54:27] WARNING[30649] res_pjsip_registrar.c: Endpoint ‘anonymous’ has no configured AORs
[2020-09-08 07:55:06] WARNING[12009][C-00000100] chan_sip.c: Received response: “Forbidden” from ‘<sip:03xxxxxxxx@192.168.2.243:5160>;tag=as5d2b8508’


(Sepu Le Vrai) #14

In Asterix SIP INFO / PEERS i see that :

Name/username Host Dyn Forcerport Comedia ACL Port Status Description
OVHOUT/00333XXXXXXXX xx.xx.xx.xx Yes Yes 5060 OK (14 ms)
SFR_OUT (Unspecified) Yes Yes 0 Unmonitored
2 sip peers [Monitored: 1 online, 0 offline Unmonitored: 0 online, 1 offline]


(Sepu Le Vrai) #15

small subtlety, when I make an outgoing call and I look at the status of the ports in the GrandStream, it is the FXS which is “ringing”


#16

On incoming, in the HT change Number of Rings to 2 and Caller ID Scheme to ETSI-FSK during ringing. If no luck, report whether caller ID appears in the incoming INVITE’s From header.

For outgoing, I don’t know why the HT sent a 403 Forbidden. With SIP debug on, make a test call, paste the complete Asterisk log for the call at pastebin.freepbx.org and post the link here.

This is very strange, as I would guess that the 403 Forbidden was sent by the HT within milliseconds of receiving the INVITE, so it would be very unlikely that you would see anything not in the idle state. However, the log might show activity on the FXS side.

Also strange. It happened 39 seconds before the Forbidden, so it’s likely unrelated to the failed outgoing call. At the Asterisk command prompt, type
pjsip set logger on
(in addition to the chan_sip debug), so we can see what activity triggers the warning.


(Sepu Le Vrai) #17

I think I know why the FXS is ringing on an outgoing call, indeed FreePBX apparently uses port 5060 to go out on a SIP call. and when I force the port in the trunk configuration to use port 5062 nothing happens (as configured in the FXO page of the HT)

In Asterix info, I now have in the Chan_Sip Peers part:

Name / username Host Dyn Forcerport Comedia ACL Port Status Description
OVHOUT / 00333XXXXXXXX xx.xx.xx.xx Yes Yes 5060 OK (14 ms)
SFROUT / 03XXXXXXXX 192.168.2.14 Yes Yes 5060 Unmonitored
2 sip peers [Monitored: 1 online, 0 offline Unmonitored: 1 online, 0 offline]

In the logs i have regulary this errors :
[2020-09-09 04:17:29] WARNING[26282] res_pjsip_registrar.c: Endpoint ‘anonymous’ has no configured AORs
[2020-09-09 04:37:32] WARNING[11020] res_pjsip_registrar.c: Endpoint ‘anonymous’ has no configured AORs
[2020-09-09 04:57:36] WARNING[26282] res_pjsip_registrar.c: Endpoint ‘anonymous’ has no configured AORs
[2020-09-09 05:17:38] WARNING[26282] res_pjsip_registrar.c: Endpoint ‘anonymous’ has no configured AORs
[2020-09-09 05:37:41] WARNING[30649] res_pjsip_registrar.c: Endpoint ‘anonymous’ has no configured AORs
[2020-09-09 05:57:45] WARNING[2904] res_pjsip_registrar.c: Endpoint ‘anonymous’ has no configured AORs
[2020-09-09 06:17:47] WARNING[26282] res_pjsip_registrar.c: Endpoint ‘anonymous’ has no configured AORs

i check with pjsip set logger on in addition to chan_sip debug and i paste here later.

many thanks for your help


(Sepu Le Vrai) #18

Outgoing call make no log entry…
incoming call is OK.

the last problem is only outgoing call… damn


(Sepu Le Vrai) #19

And there is Chan_PJSip Endpoints

Endpoint:  <Endpoint/CID.....................................>  <State.....>  <Channels.>
I/OAuth:  <AuthId/UserName...........................................................>
Aor:  <Aor............................................>  <MaxContact>
Contact:  <Aor/ContactUri..........................> <Hash....> <Status> <RTT(ms)..>
Transport:  <TransportId........>  <Type>  <cos>  <tos>  <BindAddress..................>
Identify:  <Identify/Endpoint.........................................................>
Match:  <criteria.........................>
Channel:  <ChannelId......................................>  <State.....>  <Time.....>
Exten: <DialedExten...........>  CLCID: <ConnectedLineCID.......>
==========================================================================================

Endpoint:  1001/1001                                            Not in use    0 of inf
InAuth:  1001-auth/1001
Aor:  1001                                               1
Contact:  1001/sip:1001@192.168.2.7:5060             36cef49d0b Avail        21.972

Endpoint:  1002/1002                                            Not in use    0 of inf
InAuth:  1002-auth/1002
Aor:  1002                                               1
Contact:  1002/sip:1002@192.168.2.7:5060             4777fc16da Avail        24.250

Endpoint:  1003/1003                                            Not in use    0 of inf
InAuth:  1003-auth/1003
Aor:  1003                                               1
Contact:  1003/sip:1003@192.168.2.9:5060             c1cb890f92 Avail        13.825

Endpoint:  1004/1004                                            Not in use    0 of inf
InAuth:  1004-auth/1004
Aor:  1004                                               1
Contact:  1004/sip:1004@192.168.2.13:5060            d07f0410af Avail        12.593

Endpoint:  anonymous                                            Unavailable   0 of inf

Endpoint:  dpma_endpoint                                        Unavailable   0 of inf


Objects found: 6

#20

There is some confusion here. Although it is sometimes necessary to have separate incoming and outgoing trunks for the same provider or resource, IMO it is not necessary for the HT’s FXO port. The chan_sip configuration in my first post of this thread should work for both incoming and outgoing calls.

In any case, when an external number is dialed, it must match an Outbound Route, otherwise you get a ‘cannot be completed as dialed’ message. If it matches more than one, the first one that matches is used. In your case, it must have matched a route because the call was sent to the HT and there was a Forbidden response. Now, the selected route specifies one or more trunks to be used. In your case, I assume only one. If that trunk is pjsip, then the pjsip driver will be used. If it’s chan_sip, the chan_sip driver will be used. Port numbers do not affect which driver is selected for an outgoing call.

Each SIP packet has a source port and a destination port. On an outbound INVITE, with default settings, the source port for pjsip is 5060 and for chan_sip is 5160. The destination port is determined by the selected trunk. In the case of the chan_sip trunk from my first post, there is no explicit port setting; host=dynamic means that the HT registers to Asterisk. In this case, the REGISTER request comes from port 5062, Asterisk remembers that and when you make an outgoing call on that trunk, the INVITE will have a destination port of 5062. I assume that the HT status page does show that the FXO port is registered.

In any case, the HT won’t send Forbidden by itself – it is sent as a response to INVITE. So, either pjsip or chan_sip must have sent the INVITE. If both sip debug and pjsip logger are on, your log should show that INVITE. Please paste the complete log for the attempted outbound call at pastebin.freepbx.org and post the link here.