Hi irfan,
Sorry for delay. Thanks for your configuration info. After several try, I managed to get my 3CX Gateway for inbound and outbound. Just to share with you my configuration
3CX Server - Add Gateway
General Tab
Type of Authentication - Do not require - IP Based
Authentication ID - 10000
Password: XXXXXXX
DID Tab
Add all your connected phone line no
e.g. 12345678, 13456789, ....
Options Tab
Allow inbound call - Yes
Allow outbound call - Yes
PBX Delivers Audio - Yes
Support Re-Invite - Yes
Remark:
1) Create Inbound Rules for Each available DID.
2) Create outbound dial plan
-----------------------------------------------------------------
Grandstream GXW4108 Settings (FW 1.4.1.5)
Accounts Tab
Account 1 - General Settings
- Account Active : Yes
- Account Name : AnyName
- SIP Server:
3CX Server IP
- Outbound Proxy : 3CX Server IP
Account 1 - Network Settings
Use DNS SRV : No
NAT Traveral (STUN) : No
Proxy-Require: empty
Use OBP in Route: No
Account 1 - SIP Settings
SIP Registration: No (Yes option will also work provided 3CX -> Type of Authentication = Register/Account Based)
*** The rest all default ***
Account 1 - Call Settings
- User ID is phone number : No
Accounts - User Account
Channel(s) - SIP User ID - Authenticate ID - Authen Password - SIP Account
1 - 10000 - 10000 - XXXXX - Account 1
2 - 10000 - 10000 - XXXXX - Account 1
3 - 10000 - 10000 - XXXXX - Account 1
4 - 10000 - 10000 - XXXXX - Account 1
...
Settings - Channel Settings
Calling to Voip : Unconditional Call Forward to Following:
- User ID:
ch1:12345678;ch2:13456789;ch3:xxx;ch4:xxxx;ch5-8:; <This the DID to 3CX Inbound>
- SIP Server: ch1-8

1 (
*** I try to split the ch to second SIP server using p2 it works. e.g ch1-2 to p2, ch3-4 to p1)
- SIP Destination Port: ch1-8:5060
FXO Lines - Dialing
Wait for Dial-Tone(Y/N): ch1-8:N; *** Y will not work in my case
Stage Method(1/2) : ch1-8:1;
Round-robin and/or Flexible : rr:1-8;
My 3CX are fully functional with inbound and outbound !
Cheers !!