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
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
CSeq: 1 INVITE
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce=“70ebb536”
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:+382XXXXXXXX@10.131.219.10: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
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:
context = callin_trunk_TCom
Does anybody know how to set PJSIP in freepbx to have this operational?