In case the Hot Desking device is reset to the factory while it was still logged in to the extension when provisioned again, device will register as %MAC% and will not be able to log back into its extension as the system will think that there is still a device logged in to that extension.
To fix that, the device must be manually logged off from extension by changing an entry in MySQL table pbxware_users_hotdesk, which can be accomplished by removing the extension number entry in the ext field in the table.
mysql> update admin_site.pbxware_users_hotdesk set ext = ' ' where mac = (Enter MAC);
In my case, all Hot desking devices on tenant 564 (id - 103) had this issue and had to be logged off so I filtered devices by server id
NOTE: To check the tenant's ID, log into PBXware GUI and select the tenant you are working with. With tenant selected, check your browsers address bar, and search for server=XX
In my case this is what I had:
https://192.168.200.60/?app=pbxware&p=&e=&t=dashboard&v=dashboard&server=103
select * from pbxware_users_hotdesk where server = 103;
+-------+----------+------------------------+------------+--------+------------------------+--------------+-------------------+
| id | server | mac | device | ext | logout_timeout | location | lastcall |
+-------+----------+------------------------+------------+--------+------------------------+---------------+-------------------+
| 167 | 103 | 001565d50b1f | 196 | 200 | 0 | remote | 1525879444 |
| 171 | 103 | 001565d51331 | 196 | 210 | 0 | remote | 1525252786 |
| 164 | 103 | 001565d51432 | 196 | 207 | 0 | remote | 1526559483 |
| 159 | 103 | 001565d5149f | 196 | 206 | 0 | remote | 1526561395 |
| 162 | 103 | 001565d514a6 | 196 | 212 | 0 | remote | 1526303081 |
| 169 | 103 | 001565d514f8 | 196 | 202 | 0 | remote | 1526564947 |
| 165 | 103 | 001565d5151a | 196 | 208 | 0 | remote | 1526571791 |
| 163 | 103 | 001565d51551 | 196 | 204 | 0 | remote | 1526303075 |
| 166 | 103 | 001565d5155c | 196 | 209 | 0 | remote | 1526310474 |
| 168 | 103 | 001565d515da | 196 | 205 | 0 | remote | 1526563815 |
| 170 | 103 | 001565d515db | 196 | 211 | 0 | remote | 1525968312 |
| 160 | 103 | 001565d5161d | 196 | 203 | 0 | remote | 1526483035 |
| 161 | 103 | 001565d51630 | 196 | 201 | 0 | remote | 1526572454 |
+-------+----------+------------------------+------------+--------+-------------------------+--------------+-------------------+
And removed ext entry for all devices on this tenant:
mysql> update pbxware_users_hotdesk set ext = '' where server = 103;
Query OK, 13 rows affected (0.01 sec)
Rows matched: 13 Changed: 13 Warnings: 0
To confirm all devices are logged out of extension repeat the query:
mysql> select * from pbxware_users_hotdesk where server = 103;
+-------+----------+------------------------+------------+--------+------------------------+--------------+-------------------+
| id | server | mac | device | ext | logout_timeout | location | lastcall |
+-------+----------+------------------------+------------+--------+------------------------+---------------+-------------------+
| 167 | 103 | 001565d50b1f | 196 | | 0 | remote | 1525879444 |
| 171 | 103 | 001565d51331 | 196 | | 0 | remote | 1525252786 |
| 164 | 103 | 001565d51432 | 196 | | 0 | remote | 1526559483 |
| 159 | 103 | 001565d5149f | 196 | | 0 | remote | 1526561395 |
| 162 | 103 | 001565d514a6 | 196 | | 0 | remote | 1526303081 |
| 169 | 103 | 001565d514f8 | 196 | | 0 | remote | 1526564947 |
| 165 | 103 | 001565d5151a | 196 | | 0 | remote | 1526571791 |
| 163 | 103 | 001565d51551 | 196 | | 0 | remote | 1526303075 |
| 166 | 103 | 001565d5155c | 196 | | 0 | remote | 1526310474 |
| 168 | 103 | 001565d515da | 196 | | 0 | remote | 1526563815 |
| 170 | 103 | 001565d515db | 196 | | 0 | remote | 1525968312 |
| 160 | 103 | 001565d5161d | 196 | | 0 | remote | 1526483035 |
| 161 | 103 | 001565d51630 | 196 | | 0 | remote | 1526572454 |
+-------+----------+------------------------+------------+--------+-------------------------+--------------+-------------------+