Endpoint Manager - XML-API choice missing from BLF for T54w

Created a bug report: [FREEPBX-23378] Endpoint Manager does not create y000000000096.cfg + Missing XML-API in BLF type for Yealink T54W - Sangoma Issue Tracker

Phone Apps, including login/out are not supported on this device:
https://wiki.freepbx.org/display/FPG/Phone+Apps-Supported+Devices

Nice cop out answer. None of the current Yealink lineup is on that list.

1 Like

Ok… Any plans on adding the newer models ? I mean, pretty much all Yealink phones work the same way, so getting Endpoint manager to generate the y000000000096.cfg file and allowing the creation of XML-API blf is probably not very hard.

We have a customer who’s waiting to buy a 500USD commercial module from Sangoma, and if it works, we’re probably have a few more.

Oh well… I guess I’m not the first one who finds out the hard way that EPM supported phone doesn’t mean Phone Apps supported phone. That dates back from more than a year ago.

We bought some Sangoma s705 phone to test them out with phone apps. Everything is fine so far, except for a language issue Phone Apps Language on Sangoma s705

Our customer who has around 50 Yealink T54w phones wants to be able to do some hotdesking from any phone, so replacing only a few of them with Sangoma phones is not a good option. We would have to replace them all.

Has anyone been able to work around the Phone Apps limitation on T54W phones ? I’ve tried to manually program the logout BLF with basefile edit but the value of the BLF is dynamic, with a token and an extension number, so it doesn’t work.

We might sell Sangoma phones to our future customers to work around this, but not being able to use Phone Apps on the latest generation of Yealink phones is a real bummer.

You cannot do it with a BLF to my knowledge, but you can easily make a URL string with a Yelaink phone to match whatever the normal logout link it.

Not sure that will work. In the past the apps look to EPM to get information on the device based on Mac to lookup permissions in User Manager and also verify the model is a supported model for apps. It has a bunch of belt and suspenders built into it.

It will work just fine. You just do not use the EPM variable.

I don’t have the logout syntax handy but this should work if you fix the URL.

linekey.1.value = http://pbx.domain.com:82/applications.php/endpoint/logout?user=$active_user

Source: Page 465 of the 85.X PDF

Not sure login will work like that as it has to interact with EPM to build configs and handle logouts but adding a login button. At least in the past it would not. Maybe something has changed.

Not sure why you are arguing. this is manually replacing the logout button URL that already exists and does all the right things, except with a Yealink variable instead of the one generated by EPM.

All the EPM parts will still work like always because it is the EPM script.

Because the URL also requires the token for the user not just the extension number.

Secondly because on logout the app needs EPM to write out a new config and it does that from the template but since that is not a model that supports it the config won’t have the needed info to login again. Again my knowledge is a couple years dated on this but that is how it always worked before.

Also the apps do a user agent check to make sure the model and brand is supported so it knows what to return for the app screens since models and brands are different.

Thanks Sorvani, I’m trying this right now.

Thanks for that, you made me remember the rest of the details from 2019.

I wrote my own script to use fwconsole epm commands for this at a site because their login/logout was more complex than the default EPM process. The current login/logout method was designed with on CHAN_SIP in mind.

That site uses EPM for the -1 as per normal, but then uses the custom script to login / logout a device on the -2 profile. They use old Aastra phones, but I tinkered with a Yealink in case they wanted to start replacing phones.

Edit: found a code snippet. I do not have access to the client server atm and am not sure if this is what I ended up with or not.

# custom/aastra/login.php
  // Create the configuration file on the PBX.
  // fwconsole epm addmapping 2113-2 --brand=aastra --mac=000XXXXXXXXX --template=chicago --model=57i --account=account1
  $header = Aastra_decode_HTTP_header();
  $model = substr($header['model'],6);
  $mac = strtolower($header['mac']);
  $fwconsole = "fwconsole endpoint addmapping ";
  $fwconsole .= $extension."-".$desktype." ";
  $fwconsole .= "--brand=aastra ";
  $fwconsole .= "--mac=".$mac." ";
  $fwconsole .= "--template=chicago ";
  $fwconsole .= "--model=".$model." ";
  $fwconsole .= "--account=account1";
  file_put_contents ("user_agent.log", "begin var_dump: \n", FILE_APPEND);
  file_put_contents ("user_agent.log", "Command: ".$fwconsole." \n", FILE_APPEND);
  file_put_contents ("user_agent.log", "end var_dump \n", FILE_APPEND);

  $result = shell_exec($fwconsole);
  syslog(LOG_INFO,"Configuration file for ".str_replace("\n", "", $result));
  $fwconsole = "fwconsole endpoint rebuild ";
  $fwconsole .= $extension."-2 ";
  $result = shell_exec($fwconsole);
  syslog(LOG_INFO,"Configuration file for ".str_replace("\n", "", $result));

And the full logout file

# custom/aastra/logout.php
<?php

  // fwconsole epm remove 2113-2
  // Get the extension that was passed on the URL.
  $extension = $_GET["ext"];
  $fwconsole = "fwconsole epm remove ";
  $fwconsole .= $extension."-2 ";
  $result = shell_exec($fwconsole);
  syslog(LOG_INFO,"Configuration file for ".str_replace("\n", "", $result));

  // Erase and reboot the phone
  $xmlout = "<?xml version='1.0' encoding='UTF-8' standalone='no' ?>\n";
  $xmlout .= "<AastraIPPhoneExecute destroyOnExit='yes' Beep='yes' >\n";
  // Reboot the phone
  // $xmlout .= "  <ExecuteItem URI='Command: Reset' />\n";
  // Clear the phone's config and reboot
  $xmlout .= "  <ExecuteItem URI='Command: ClearLocal' />\n";
  $xmlout .= "</AastraIPPhoneExecute>\n";
  print $xmlout;

It work perfectly for me ! Thanks a lot.
The only thing I had to change in your string was the port: I use 82 (Phone Apps) instead of 84 (Provisionning).

I wonder what the token string is used for, because it doesn’t seem to be required for the phones to be able to login/provision logout/un-provision.

1 Like

Fixed my post for any future searchers.

Well the token was used for auth when phone apps were originally built otherwise anyone could use the apps by just passing any ext in the url and have no real auth. That is scary that if someone opens up port 84 for a remote phone they have full access to any app just by guessing a valid exit on the system.

Any app? Dunno.
Logically, login can not have a token by its very nature.
Log out could, but /shrug who knows.

Jared you are probably correct on the login app about token. I can not believe I spaced that part out. But the other apps would require a token for auth or at-least did in the past.

On my systems, port 82 is restricted to a single IP in the firewall so I’m not too worried.