i try to get familar with FreePBX and eventually want to introduce it to our business as a on-prem PBX solution. To be able to that i got plenty of stuff to learn but i tried to gain some knowledge about FreePBX in my spare-time over the last few weeks and even though i feel like i have made some progress i am still not able to receive inbound calls or do outbound calls myself.
I ve made the inital configuration steps ( basic configuration, whitelisting local subnets etc.) set up a couple of extensions, created a PJSIP SIP Trunk to my ISP and configured inbound and outbound routes.
According to the Asterisk logs my Trunk seems to have registered successfully but everytime i try to make a call to the “outside world” i only get this error message in my logfiles:
[2019-12-20 20:54:22] VERBOSE[C-00000001] pbx.c: Executing [[email protected]:1] NoOp(“PJSIP/10-00000000”, “TRUNK Dial failed due to CHANUNAVAIL HANGUPCAUSE: 21 - failing through to other trunks”) in new stack
[2019-12-20 20:54:22] VERBOSE[C-00000001] pbx.c: Executing [[email protected]:2] ExecIf(“PJSIP/10-00000000”, “1?Set(CALLERID(number)=10)”) in new stack
[2019-12-20 20:54:22] VERBOSE[C-00000001] pbx.c: Executing [[email protected]:7] Macro(“PJSIP/10-00000000”, “outisbusy,”) in new stack
[2019-12-20 20:54:22] VERBOSE[C-00000001] pbx.c: Executing [[email protected]:1] Progress(“PJSIP/10-00000000”, “”) in new stack
[2019-12-20 20:54:22] VERBOSE[C-00000001] pbx.c: Executing [[email protected]:2] GotoIf(“PJSIP/10-00000000”, “0?emergency,1”) in new stack
[2019-12-20 20:54:22] VERBOSE[C-00000001] pbx.c: Executing [[email protected]:3] GotoIf(“PJSIP/10-00000000”, “0?intracompany,1”) in new stack
[2019-12-20 20:54:22] VERBOSE[C-00000001] pbx.c: Executing [[email protected]:4] Playback(“PJSIP/10-00000000”, “all-circuits-busy-now&please-try-call-later, noanswer”) in new stack
I tried various things and played around with a bunch of PJSIP settings but without success so far.
Maybe you got an idea and can point me in the right direction?
Thank you in advance.
It is telling you that the trunk is not available. You need to check your trunk configuration.
Thanks for your reply.
If thats the case i assume FreePBX showing methis under Reports -> Asterisk Info -> Registries
PJSIP isnt enough to verify that the SIP Trunk is properly set up?
<Registration/ServerURI…> <Auth…> <Status…>
Deutsche_Glasfaser/sip:dg.voip.dg-w.de Deutsche_Glasfaser Registered
Objects found: 1
The Trunk is also listed as online but ith a channel count of zero. Any way to verify proper configuration without relying on the attempt to make outgoing telephone calls?
Confirm that in Asterisk SIP Settings, External Address and Local Networks are set correctly.
You could first try to get incoming calls working. If anything appears in the FreePBX log on an attempt, post that here (if it’s long, paste it at pastebin.freepbx.org and post the link). If nothing appears, try capturing with tcpdump and look for an incoming INVITE (this capture is ahead of the FreePBX firewall). If you see nothing there, either, look at the outgoing REGISTER request and confirm that the Contact header is correct.
At the Asterisk command line, type
pjsip set logger on
which will cause all SIP traffic to be logged to the console, as well as appearing in the regular Asterisk log, along with the normal entries.
If you still have trouble, post a screenshot of your trunk settings, masking any personal info such as account numbers, phone numbers and passwords. Also, post a link to the ISP’s documentation for the trunk settings.
If the forum prevents you from posting links because you are a new user, replace the last dot in the URL with %2E, for example change
Confirm that in Asterisk SIP Settings, External Address and Local Networks are set correctly.
I double checked and the IPv4 under Settings -> Asterisk SIP Settings -> NAT Settings is set correctly.
I also added all my local networks as well.
You could first try to get incoming calls working.
Incoming calls are working properly.
If i try to make an outbound call on the other hand, this is what i get in realtime, when pjsip logging is enabled in the asterisk cli.
One thing i found out while enabling pjsip logging to the console was that occasionally a
SIP/2.0 405 Method Not Allowed appears.
If you still have trouble, post a screenshot of your trunk settings
(Sorry, using the link feature didn`t work for me like you said, even though i tried replacing the last dot
in the URL. I hope the way i did it is fine as well.)
This is the only official documentation for configuring SIP from my ISP i could find.
- SIP based VoiP RFC3261
- G711 alaw/ulaw codec
- DTMF transmission: RTP or InBand (RFC2833)
Sorry, I focused on incoming based on your original post. Is incoming working properly now?
This is normal. When you set Qualify for a trunk, Asterisk sends OPTIONS requests to test whether the trunk is still alive. Although Glasfaser doesn’t support that request, the error they send back still tells Asterisk that the connection is working and all is well.
Unfortunately, the log segment you posted for the outgoing call is not useful; at the first line
== Everyone is busy/congested at this time (1:0/0/1)
Asterisk has already decided that the call attempt failed.
The data logged for an outgoing call usually starts with a line containing something like
pbx.c: -- Executing [[email protected]:1]
Also, please view the log at Reports -> Asterisk Log Files (or directly from /var/log/asterisk/full). This includes timestamps, which are often useful diagnostic information.
I would expect the log for a call attempt to contain at least one INVITE request and its response, though it’s possible that no SIP was sent out, e.g. because a DNS lookup failed.
With luck, a complete log for the call attempt should help determine what is wrong.
Sorry for the confusion. At first, when i started with setting up FreePBX a couple of weeks back, incoming calls didn`t work indeed. To be honest i was a little bit surprised myself when i tested it several times today, finding out that incoming calls went through properly. Apparently i made a few adjustments to my configuration that solved the problems with incoming calls without even noticing, cause i was so focused on outgoing calls.
I started asterisk -gvvv from the ssh console, enabled pjsip logging like you described earlier and immediately made a call. The following pastebin contains everything this time, right from the beginning where i enaled pjsip logging to the call being rejected. I hope this includes the information you asked for.
Thanks Stewart, much appreciated.
OK, so on line 282, the provider rejected the request before even asking for authentication. Without any documentation from them, it’s hard to tell why.
First, they may not accept destination numbers in local format. For example, if you are calling Oelde (guessing from your IP address), they might expect 02522956232, 492522956232 or +492522956232. Most likely, they will accept the same format that they use for the From header on an incoming call, so try that.
Next, the number in the From header (which I assume is an account number) may need to be your phone number (using the account number only for auth ID), or something different. Do you have an example of a configuration for another device or system that works properly with your ISP?
What can i say Stewart1, it works.
Local numbers were fine but it was the “from-user” setting under pjsip settings/advanced i had to change to my (local) telephone number, applied the changes and all of a sudden i was able to make outbound calls.
Thank you very much for your help and for pointing me in the right direction.
I’m glad that you got it working.
I noticed two things that may be problems for commercial use.
Were you testing on your business internet connection? If so, be aware that you don’t have a dedicated public IP address – Glasfaser is running CGN (Carrier Grade NAT). Your router’s WAN interface gets a 100.68.x.x address, which is not a public IP; your external 185.22.x.x address is at the ISP and shared by many customers. This means that (unless they have a portal where you can set up port forwarding), inbound connections to the PBX will not be possible, even with a VPN. This would prevent you from having external extensions (mobile SIP apps, teleworkers, branch office phones, etc.) or from remotely maintaining the system with the web GUI or SSH, though you could use a connection via TeamViewer or similar as a workaround. Your ISP may provide a dedicated public IP upon request, possibly for an additional monthly fee. The dedicated address may not be static, in which case you would also need to set up dynamic DNS.
The trunk is not presently sending any caller ID information with outbound calls. You may want this if the business has multiple incoming numbers, or to send the number of the original caller on calls forwarded to user mobiles. Providers differ on what headers are required and how they need to be formatted. With luck, your ISP will have some documentation on how this should be set up.
Yes i am aware of CGNAT and its consequences and unfortunately there is no way around it other than using external portmapping services. DG only offers static IPV4 for business plans, which are way to expensive for private use.
But in my case its just a matter of learning the ropes with FreePBX so that eventually i will be able to introduce it to our business which at the moment has a DTAG SIP Trunk (Deutsche Telekom AG SIP Trunk aka Deutschland LAN)
I am just using it for a few internal phones and a SIP client, more or less as kind of a lab enironment. Even FreePBX runs virtualized at the moment. Afaik the DTAG offers better documentation of how to set up a SIP Trunk.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.