Add the Vcard4 provisioning URL in the provisioning XML

Fix the Vcard4 format to comply with liblinphone
This commit is contained in:
Timothée Jaussoin 2021-11-03 16:54:18 +01:00
parent 48323477cf
commit 913b4d64bc
6 changed files with 27 additions and 16 deletions

View file

@ -231,11 +231,11 @@ class Account extends Authenticatable
$vcard = 'BEGIN:VCARD
VERSION:4.0
KIND:individual
MEMBER:'.$this->getIdentifierAttribute();
IMPP:sip:'.$this->getIdentifierAttribute();
if (!empty($this->attributes['display_name'])) {
$vcard . '
NAME:'.$this->attributes['display_name'];
FN:'.$this->attributes['display_name'];
}
if ($this->types) {

View file

@ -115,6 +115,15 @@ class ProvisioningController extends Controller
->first();
}
$section = $dom->createElement('section');
$section->setAttribute('name', 'misc');
$entry = $dom->createElement('entry', route('account.contacts.vcard.index'));
$entry->setAttribute('name', 'contacts-vcard-list');
$section->appendChild($entry);
$config->appendChild($section);
if ($account && !$account->activationExpired()) {
$section = $dom->createElement('section');
$section->setAttribute('name', 'proxy_' . $proxyConfigIndex);

21
flexiapi/composer.lock generated
View file

@ -1038,16 +1038,16 @@
},
{
"name": "laravel/framework",
"version": "v8.68.1",
"version": "v8.69.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "abe985ff1fb82dd04aab03bc1dc56e83fe61a59f"
"reference": "545181da688db64fed6d8427e55f630a90ca0d32"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/abe985ff1fb82dd04aab03bc1dc56e83fe61a59f",
"reference": "abe985ff1fb82dd04aab03bc1dc56e83fe61a59f",
"url": "https://api.github.com/repos/laravel/framework/zipball/545181da688db64fed6d8427e55f630a90ca0d32",
"reference": "545181da688db64fed6d8427e55f630a90ca0d32",
"shasum": ""
},
"require": {
@ -1206,7 +1206,7 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2021-10-27T12:31:46+00:00"
"time": "2021-11-02T13:53:22+00:00"
},
{
"name": "laravel/serializable-closure",
@ -1759,16 +1759,16 @@
},
{
"name": "nesbot/carbon",
"version": "2.53.1",
"version": "2.54.0",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
"reference": "f4655858a784988f880c1b8c7feabbf02dfdf045"
"reference": "eed83939f1aed3eee517d03a33f5ec587ac529b5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/f4655858a784988f880c1b8c7feabbf02dfdf045",
"reference": "f4655858a784988f880c1b8c7feabbf02dfdf045",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/eed83939f1aed3eee517d03a33f5ec587ac529b5",
"reference": "eed83939f1aed3eee517d03a33f5ec587ac529b5",
"shasum": ""
},
"require": {
@ -1779,6 +1779,7 @@
"symfony/translation": "^3.4 || ^4.0 || ^5.0"
},
"require-dev": {
"doctrine/dbal": "^2.0 || ^3.0",
"doctrine/orm": "^2.7",
"friendsofphp/php-cs-fixer": "^3.0",
"kylekatarnls/multi-tester": "^2.0",
@ -1849,7 +1850,7 @@
"type": "tidelift"
}
],
"time": "2021-09-06T09:29:23+00:00"
"time": "2021-11-01T21:22:20+00:00"
},
{
"name": "nikic/php-parser",

View file

@ -36,8 +36,8 @@ Route::group(['middleware' => 'auth.digest_or_key'], function () {
Route::get('provisioning/me', 'Account\ProvisioningController@me')->name('provisioning.me');
// Vcard 4.0
Route::get('contacts/vcard/{sip}', 'Account\ContactVcardController@show');
Route::get('contacts/vcard', 'Account\ContactVcardController@index');
Route::get('contacts/vcard/{sip}', 'Account\ContactVcardController@show')->name('account.contacts.vcard.show');
Route::get('contacts/vcard', 'Account\ContactVcardController@index')->name('account.contacts.vcard.index');
});
Route::get('provisioning/qrcode/{confirmation}', 'Account\ProvisioningController@qrcode')->name('provisioning.qrcode');

View file

@ -57,7 +57,8 @@ class AccountProvisioningTest extends TestCase
->get($this->accountRoute)
->assertStatus(200)
->assertHeader('Content-Type', 'application/xml')
->assertSee('ha1');
->assertSee('ha1')
->assertSee('contacts-vcard-list');
// And then twice
$response = $this->keyAuthenticated($password->account)

View file

@ -8,7 +8,7 @@
#%define _datadir %{_datarootdir}
#%define _docdir %{_datadir}/doc
%define build_number 110
%define build_number 111
%define var_dir /var/opt/belledonne-communications
%define opt_dir /opt/belledonne-communications/share/flexisip-account-manager