SIP trunk From Provider

Dear Friends,

Recently I had a hard task again… to configure SIP trunk with a local telecom. Before all… I have tried to do this long time ago but never did it successfully.
While the same trunk with same details works from the start on Yeastar or 3CX, I am not really able to make it work in FreePBX and I will have to.

First, the telecom comes with a dedicated interface for this and it is connected on a dedicated LAN port. Static routes are added and CHANSIP trunk can register. Status for peer is ok and registry has status as registered.

Here are the settings for it

PEER

username=+382XXXXXXXX
type=peer
secret=password
qualify=yes
host=10.179.23.180
fromdomain=ims.telekom.me
dtmfmode=rfc2833
disallow=all
[email protected]
allow=alaw,ulaw,g729

INCOMING

[email protected]:password:[email protected]@10.179.23.180/+382XXXXXXXX

Register string is like this and it actually registers with it.

With this, I am able to receive calls but sometimes not which is really confusing. Maybe something happens due to frequent changes that I make in the trunk settings.
I am NOT able to place any outbound calls and when I try to call I don’t see any invite was sent to telecom. I only hear
“ALL CIRCUITS ARE BUSY NOW…”
This is the reason listed in the logs
“TRUNK Dial failed due to CHANUNAVAIL HANGUPCAUSE: 20 - failing through to other trunks”

Incoming calls are possible but this changes from time to time and I am not able to make it work by reverting the working settings. It seems that freepbx keeps the old configuration for some reason.
Incoming calls sometimes gives the message :
“THE NUMBER YOU HAVE DIALED IS NOT IN SERVICE…”
Log shows that there is an unknown sip connection rejected from IPADDRESS which is providers IP address. Also in the trunk as host.
The other issue for incoming is this:

00:48:33.909498 IP (tos 0x60, ttl 64, id 2146, offset 0, flags [none], proto UDP (17), length 643)
10.131.219.10.5160 > 10.179.23.180.5060: [udp sum ok] SIP, length: 615
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 10.179.23.180:5060;branch=z9hG4bKc9hhli204oa15roe00q1.1;received=10.179.23.180;rport=5060
From: sip:[email protected];user=phone;tag=p65540t1555368513m894213c672013610s1_1942228557-317199830
To: sip:[email protected];user=phone;tag=as6e250386
Call-ID: p65540t1555368513m894213c672013610s2
CSeq: 1 INVITE
Server: FPBX-14.0.8.4(13.22.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce=“70ebb536”
Content-Length: 0

00:48:33.919157 IP (tos 0xa0, ttl 125, id 0, offset 0, flags [none], proto UDP (17), length 455)
10.179.23.180.5060 > 10.131.219.10.5160: [udp sum ok] SIP, length: 427
ACK sip:[email protected]:5160;useradd=10.131.219.10;userport=5160 SIP/2.0
Via: SIP/2.0/UDP 10.179.23.180:5060;branch=z9hG4bKc9hhli204oa15roe00q1.1
CSeq: 1 ACK
To: sip:[email protected];user=phone;tag=as6e250386
From: sip:[email protected];user=phone;tag=p65540t1555368513m894213c672013610s1_1942228557-317199830
Call-ID: p65540t1555368513m894213c672013610s2
Max-Forwards: 64
Content-Length: 0

PJSIP never worked whatever I did. In Yeastar PJSIP works from the first setup…
Here is a working PJSIP config file from yeastar which is asterisk based:

trunk-TCom-endpoint
context = callin_trunk_TCom
outbound_auth=trunk-TCom-auth
aors=trunk-TCom-aor
media_encryption=no
allow=ulaw,alaw,g729
from_domain=ims.telekom.me
from_user=
dtmf_mode=rfc4733
outbound_proxy=sip:10.179.23.180:5060;transport=udp;lr
force_privacyid=no
language=en
istrunk=1
fax_detect=yes
t38_udptl=no
t38_noattr=no
language=en
set_var=SRCTRUNKNAME=TCom
set_var=SRCTRUNKDOMAIN=ims.telekom.me
set_var=SRCTRUNKTYPE=REG
set_var=ENABLEJB=no
set_var=OBADDDIVERSION=no
set_var=OBDIVERSION=
set_var=TFADDDIVERSION=yes
set_var=TFDIVERSION=default
set_var=OBADDRPID=no
set_var=OBRPID=
set_var=TFADDRPID=no
set_var=TFRPID=
set_var=OBADDPAI=no
set_var=OBPAI=
set_var=TFADDPAI=no
set_var=TFPAI=
set_var=TFFROM=default
set_var=FROMUSER=
set_var=USERNAME=+382XXXXXXXX
endpttype=trunk
user_eq_phone=no
inband_progress=no

Does anybody know how to set PJSIP in freepbx to have this operational?
Or SIP…

Dear All,

Nobody replied but I have resolved this problem… After a few hours looking in TCPDUMP and AsteriskCLI I have found a way to make it work.
For all those who may encounter this problem, here are the working settings:

PEER :

[email protected]
type=friend
secret=password
insecure=invite
qualify=no
outboundproxy=10.179.23.180
host=ims.telekom.me
fromdomain=ims.telekom.me
dtmfmode=rfc2833
disallow=all
allow=alaw,ulaw,g729

REGISTER STRING

[email protected]:password:[email protected]@10.179.23.180/+382XXXXXXXX

In the hosts file, if using CHAN_SIP, it is necessary to add
10.179.23.180 ims.telekom.me

These parameters were taken from Huawei HG8245 router. For reference, I will attach screenshots of HG8245 VoIP settings.
Anyone who want further help, please ping me here.

Best Regards.

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