I can't connect FreePBX 14 / Asterisk with Grandstream GXW4108

Hello friends, I am trying to configure a FreePBX 14 server with asterisk for local calls within the company (this works perfect) and send and receive calls to and from the outside (I have not been able to configure it) and I already saw this tutorial

https://wiki.freepbx.org/display/FOP/Configuring+a+Grandstream+GXW-410X+Device+to+act+as+an+FXO+Gateway?focusedCommentId=54526082#comment-54526082

I currently have an asterisk server (with IP 10.5.1.8) as with 10 years old and it is working perfectly with the GXW4108 grandstream gateway, but I want to update it to FreePBX and I have not been able to operate it with the GXW4108 grandstream gateway.

The grandstream GXW4108 gateway has 8 ports, currently as I am testing the freepbx in parallel with the asterisk production server, enable 2 of the 8 ports of the grandstream GXW4108 gateway, for the FreePBX.

in the FreePBX (with ip 10.5.1.88) I make a query

pjsip show contacts

and it shows me as if the GXW4108 (with ip 10.5.1.16) connected to extensions 1886 and 1887.

The company has a unique number for the public #### 1000, when you call this number, the GXW4108 responds with any of the lines, #### 1001, #### 1002, #### 1003, ## # # 1004, #### 1005, #### 1006, #### 1007, #### 1008, and these are sent to an extension number that is customer service and to call from the inside out, You can call from any extension.

If I make a call to the phone number that is connected to one of the ports that enable FreePBX on the GXW4108, it rings and rings but nobody answers and in the CLI I don’t see any connection.

I also connected the FreePBX server with the old asterisk and it works quite well, I could even create an outbound route from the freepbx to the asterisk and could make outgoing calls, but I want to use the freepbx independently since the old asterisk will shut down.

If nothing shows up in the Asterisk log on an incoming call, at the Asterisk command prompt type
pjsip set logger on
and see whether the GXW sends an INVITE seen by FreePBX. If so, check why it is not being routed correctly.

If not, run tcpdump on the PBX and see whether INVITE packets come in on a call attempt. If so, the packets may be sent to the wrong port (pjsip default port to listen on is 5060), or being blocked by FreePBX firewall (test with it disabled).

If they don’t even show up in tcpdump capture, there is a config problem in the GXW (sending to wrong IP, etc.)

Although I see no reason why you can’t get it to work, it seems strange that you have configured the GXW as extensions rather than a trunk, as outbound calls would require 2-stage dialing or some other unusual connections.

Currently on each FXO channel of the GXW4108, an extension is configured, these extensions are dedicated only for the GXW4108.

Channel(s) SIP User ID Authenticate ID Authen Password Profile ID
1 880 880 Profile 1
2 881 881 Profile 1
3 882 882 Profile 1
4 883 883 Profile 1
5 884 884 Profile 1
6 885 885 Profile 1
7 1886 1886 Profile 2
8 1887 1887 Profile 2

I executed the command and started receiving notifications.

apparently if he is connecting, but I do not receive calls, if I call the hotline at extension 1886 or 1887.

If I make a call from the old asterisk server to any of those extensions, then the IVR answers me and transfers the call to the extension enabled for customer service

The SIP you posted was OPTIONS requests sent from Asterisk to GXW, and the replies. That’s how qualify works. It is not what I was looking for, but does show that it is almost certainly not a firewall issue.

In addition to the OPTIONS (which occur every minute by default), there should also be an INVITE sent by the GXW when a call comes in. If you don’t see that, I’m guessing that Profile 2 is not set up correctly.

If you can’t spot the problem visually, the GXW has a good syslog feature that will show what it is doing when a call comes in.

I just noticed a configuration that has the GXW4108, which calls the old asterisk server, by the extension 800

look in the extensions.conf file of the old asterisk and I saw these lines that I suppose the forwarding does, but I don’t know how to replicate it in FreePBX since I saw that it is not a common extension

exten => 800,1,Set(foo=${DB(PBX/NightMode)})
exten => 800,n,Gotoif($["${foo}" = “1”]?3:4)
exten => 800,n(dial1),Goto(9001,1)
exten => 800,n(dial2),Goto(*800,1)
exten => 800,n,Hangup()

exten => *800,1,Answer
exten => *800,n,WaitMusicOnHold(3)
exten => *800,n,Background,/var/lib/asterisk/sounds/ar/preatendedor
exten => *800,n,PlayBack,/var/lib/asterisk/sounds/ar/if-u-know-ext-dial
exten => *800,n,WaitExten(8|m)
;exten => *800,n,WaitMusicOnHold(5)
exten => *800,n,Queue(Latin|r)
exten => *800,n,Hangup

exten => 9001,1,Answer()
exten => 9001,n,WaitMusicOnHold(3)
exten => 9001,n,PlayBack,/var/lib/asterisk/sounds/ar/nocturno
exten => 9001,n,Voicemail,[email protected]
exten => 9001,n,Hangup()

See


p.17.

I’m guessing that you want Unconditional Call Forward to VoIP as:
User ID: ch1-6:800;ch7:1886;ch8:1887;
Sip Server: ch1-6;p1;ch7-8:p2;
Sip Destination Port: ch1-8:5060;

Thanks for your help, I could already receive calls from abroad, I also had to fix some rules in FreePBX.

Now I tried to make a rule to make outgoing calls, but I used lines 1-6 and not 7-8 that were assigned to FreePBX, what can I do? What is the best method to do this correctly?

IMO you should set up the GXW in FreePBX as a trunk. With it set as an extension, you can set Stage Method to 2 for ch7-8 and then calling the extension you should hear a dial tone from the GXW and can dial a number.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.