Unable to generate QR code

Good day,

We have a problem with generating QR codes in web gui.

When we click on “Show QR Code” for the Device on an extension the top green loading bar just keeps running and never completes.

I’m trying to figure out with web browser Developer tools what’s happening but the request is just stalled.

In Devleoper tools Payload this is the Form data:

  1. class: extensions
  2. method: ShowQR
  3. mode: view
  4. data: 10

When we tail /var/log/httpd/access_log the following errors occur:
[25/Nov/2021:09:05:19 +0000] “GET /resources/js/vendor/pdfmake.min.js.map HTTP/1.1” 404 236 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36 Edg/96.0.1054.29”
[25/Nov/2021:09:05:20 +0000] “GET /resources/css/bootstrap-colorpicker.min.css.map HTTP/1.1” 404 245 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36 Edg/96.0.1054.29”
[25/Nov/2021:09:05:20 +0000] “GET /resources/css/bootstrap.min.css.map HTTP/1.1” 404 233 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36 Edg/96.0.1054.29”
[25/Nov/2021:09:05:20 +0000] “GET /resources/js/vendor/socket.io.js.map HTTP/1.1” 404 234 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36 Edg/96.0.1054.29”

We have also tried the following commands:
vitalpbx fully-dump-conf
vitalpbx check-integrity
yum reinstall vitalpbx

We are running the following version of VitalPBX:
Version : 3.1.2-1
Asterisk : Asterisk 18.6.0
Linux Version : CentOS Linux release 7.9.2009 (Core)

Hello, I recommend that you update to the latest version of VitalPBX

Did you try a private tab in Chrome?
Did you try a different browser (Firefox)?

Ok, so yesterday we actually found what the problem was!

Our PBX are not allowed to access the internet on ports 80 or 443, only SIP and RTP traffic is allowed.

When we ran a tcpdump on our PBX checking outgoing traffic when pressing “Show QR Code” we found that it was trying to access the IP 34.117.59.81 on port 80.

Eventually we found that this IP belongs to https://ifconfig.me/ that checks your public IP.

A temporarily solution is to add this address to local hosts file pointing to 127.0.0.1.
# cat /etc/hosts
127.0.0.1 localhost
127.0.0.1 ifconfig.me

Now QR codes generate in a second!

Why do you need to check public IP when generating QR codes? Is this a bug or something else?

See below tcpdump:
07:32:05.806082 IP 192.168.10.140.40102 > 34.117.59.81.80

Not a bug. The PBX needs to know the WAN IP so it can generate a QR code with said IP.

Ok but maybe there should be a timeout after 10 seconds with a message telling the user it can’t reach internet and get public ip address?

We are just using FQDN for QR codes and do not need public ip.

I did a test this morning to let the progress bar just keep loading and after approx. 1 hour the QR code appeared. So a lower timeout would be good.

It is not common to block outgoing traffic.
You can file a feature request under #wish-list