Contacts App Loading Issue on Yealink Phones Solved

This is in reference to a problem I had a while back. You can read my original post to understand the issue better, it is linked above. With the help of ChatGPT, I was able to find a satisfactory workaround for my issue. I can confirm that this is an issue with Yealink phones, more specifically the T46S phones and below. I am not sure if newer models are affected. There is an issue with the Yealink firmware on how it requests the contact information. You are able to view the contact list, but when you try to get info for a specific contact, you are presented with a “Loading Error” on the phone. The phone needs to include linestate= in its request to FreePBX and it isn’t doing that. Apparently, the latest firmware is still using an older method to request that informatiuon, which was changed with FreePBX 17. If you are experiencing this issue, here is what I did to fix it. Hope this helps someone else.

  1. Back up sangoma.conf

cp -a /etc/apache2/sites-enabled/sangoma.conf
/etc/apache2/sites-enabled/sangoma.conf.bak-$(date +%Y%m%d-%H%M%S)

  1. Add the rule inside the *:82 vhost by editing this file in nano /etc/apache2/sites-enabled/sangoma.conf

Change the following:

<VirtualHost *:82>
RewriteEngine on
RewriteRule (^.|/.) - [F]
DocumentRoot /var/www/html/restapps/

To this:

<VirtualHost *:82>
RewriteEngine On

RewriteRule (^.|/.) - [F]

#Yealink T46S / FreePBX RestApps Contact Manager workaround.
#The T46S omits linestate from the contact entry request.
RewriteCond %{QUERY_STRING} !(^|&)linestate=
RewriteRule ^/applications.php/contactmanager/entry$ /applications.php/contactmanager/entry?linestate= [END,QSA,NE]

DocumentRoot /var/www/html/restapps/

  1. Test Apache with this command: apache2ctl configtest

You should receieve Syntax OK

  1. If test was successful, reload apache with this command: systemctl reload apache2

  2. Document your file

#Yealink T46S 66.86.0.15 compatibility workaround.
#T46S Contact Manager requests omit linestate, while the FreePBX
#Contact Manager handler expects the parameter to exist.