Grandstream GXW4104 PSTN Gateway confioguración PJSIP

Tengo un Grandstream GXW4104 PSTN Gateway quisiera que me indiquen como se configura en una una troncal PJSIP para que pueda funcionar en FreePBX 17 con Asterisk v21

Please excuse my writing in English. Try these settings:

Trunk Name: (matches SIP User ID and Authentication ID for the GXW account)
Secret: (matches Authen Password for the GXW Account)
Authentication: Both
Registration: Receive
Match Inbound Authentication: Auth Username
Rewrite Contact: Yes

If you have trouble, report whether the GXW registers ok, and what happens on inbound and outbound call attempts. Also report: Was this GXW set up previously (with chan_sip or another PBX)? Screenshots of the GXW settings would be useful, as well as the relevant sections of the Asterisk log for attempted registration or calls, with pjsip logger turned on. Paste the log at pastebin.com and post the link here.

sorry for using translation:

  1. The problem persists, the message is “all lines are busy”.

  2. I have followed the configuration recommendation and it generates the following error: “[2024-08-20 01:11:57] ERROR[15604] pjproject: sip_inv.c …Error parsing/validating SDP body: Missing SDP rtpmap for dynamic payload type (PJMEDIA_SDP_EMISSINGRTPMAP)” send Screenshots

Yes, I configured it with chain-sip and it works perfectly in a freepbx 16 installation

The GXW is not a SIP server and it is not possible for Asterisk to register to it.

I had suggested:

(Registro: Recibir)
where you set up the GXW to register to Asterisk.
IMO, this is more robust – it will work if the GXW is behind a NAT, running over a VPN, in a different country, etc.

However, it is also possible to set a static configuration where the GXW is configured to not register and you have Registro: Nada on the FreePBX side.

If you still have trouble, at the Asterisk command prompt type
pjsip set logger on
make a failing call (or failing registration attempt), paste the relevant section of the Asterisk log (it is in /var/log/asterisk/full) at pastebin.com and post the link here. Please do not post screenshots of logs – that makes it hard for the reader to search for a string, or quote lines that define the problem.

28145 m=audio 5016 RTP/AVP 0 8 18 4 2 103 101
I believe that the problem is the payload type 103, but don’t know whether that is related to an audio codec, and event codec, or something else. So please try these three things; I hope that one will help:

  1. In the Preferred Vocoder section, set all eight entries to either G.711 A-law or G.711 U-law, whichever is normally used in your country. Also enable only that codec (alaw or ulaw) in the trunk.
  2. Set DTMF Method to RFC2833
  3. Set Video Surveillance to No.

If no luck, please paste another log.

Thanks for the directions: outgoing calls now work; Now I have the problem that incoming calls do not work, the message is “the person in extension # is not available”

Were incoming calls working before you made the latest changes?

If you call the extension that your Inbound Route points to from another extension, is the call successful?

It never worked; if I call from another extension from my cell phone with a bria mobile softphone and I try to call another extension it sounds busy and says 401 unauthorized and from the desk phone 503 service not available

Please paste the Asterisk log for a failing call between extensions (with pjsip logger turned on) at pastebin.com and post the link here.

Extension 1021 is misconfigured. It is apparently trying to send calls as ‘anonymous’ (block caller ID), which is incompatible with the way Asterisk works. Try to find that setting, turn it off, retest, and paste another log (this is not the only problem, because it wouldn’t affect incoming).

If you actually want your outbound calls to be anonymous, because of the way the GXW works, you must prefix the number with the code that your PSTN provider requires to send a call anonymously.

Thank you, I have made the corrections between extensions and it works for outgoing calls on the Grandstream. Now it does not allow outgoing calls on a Pure SIP trunk and says the message “ALL LINES ARE BUSY” and generates this error: ERROR[189750] res_pjsip_header_funcs.c: No headers had been previously added to this session. How do I correct this error so that it allows me to make outgoing calls.

On line 146 Netvoice rejected the call with a ‘500’ error, unfortunately not a useful diagnostic. Possibly, it’s related to the long list of codecs you are presenting. In the trunk settings, enable only alaw and ulaw and disable the others.

If that doesn’t help, sorry but I know nothing about the Ecuador phone system. Were you dialing 104?

If not, there is a problem with your Outbound Route or trunk manipulation rules. If you can’t easily find the trouble, paste a new log, this time starting from the beginning of the call.

If you were dialing 104, what service is that? Telephone numbers in Ecuador - Wikipedia shows only 101 and 102 for police and fire. It’s common for SIP trunking providers to not support short codes for non-emergency services.

If you dial a regular landline or mobile number on the Netvoice trunk, do you have the same trouble? If so, possibly there is a more informative error; call a number you don’t have to redact, for example +593 4-370-3100 (McDonald’s in Quito) and paste a log.

Another thought: Possibly Netvoice is expecting a different format in the From header.
You are sending 5932392xxxx. They may expect +5932392xxxx, 02392xxxx or even an account number.

If incoming calls from Netvoice are working, look at the To header. It’s a good bet that they will accept from you, the same format they are sending.