mirror of
https://gitlab.linphone.org/BC/public/flexisip-account-manager.git
synced 2026-01-17 01:58:07 +00:00
Fix #44 Add display name in the provisioning XML
This commit is contained in:
parent
54b9c2a3f3
commit
006ddaca5f
5 changed files with 14 additions and 3 deletions
|
|
@ -173,6 +173,15 @@ class Account extends Authenticatable
|
|||
return $this->attributes['username'] . '@' . $this->attributes['domain'];
|
||||
}
|
||||
|
||||
public function getFullIdentifierAttribute()
|
||||
{
|
||||
$displayName = $this->attributes['display_name']
|
||||
? '"' . $this->attributes['display_name'] . '" '
|
||||
: '';
|
||||
|
||||
return $displayName . '<sip:' . $this->getIdentifierAttribute() . '>';
|
||||
}
|
||||
|
||||
public function getRealmAttribute()
|
||||
{
|
||||
return config('app.realm');
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ class ProvisioningController extends Controller
|
|||
$section = $dom->createElement('section');
|
||||
$section->setAttribute('name', 'proxy_' . $proxyConfigIndex);
|
||||
|
||||
$entry = $dom->createElement('entry', '<sip:' . $account->identifier . '>');
|
||||
$entry = $dom->createElement('entry', $account->fullIdentifier);
|
||||
$entry->setAttribute('name', 'reg_identity');
|
||||
$section->appendChild($entry);
|
||||
|
||||
|
|
@ -228,7 +228,7 @@ class ProvisioningController extends Controller
|
|||
$section = $dom->createElement('section');
|
||||
$section->setAttribute('name', 'proxy_' . $proxyConfigIndex);
|
||||
|
||||
$entry = $dom->createElement('entry', '<sip:' . $externalAccount->identifier . '>');
|
||||
$entry = $dom->createElement('entry', $externalAccount->fullIdentifier);
|
||||
$entry->setAttribute('name', 'reg_identity');
|
||||
$section->appendChild($entry);
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ class AccountFactory extends Factory
|
|||
{
|
||||
return [
|
||||
'username' => $this->faker->username,
|
||||
'display_name' => $this->faker->username,
|
||||
'domain' => config('app.sip_domain'),
|
||||
'email' => $this->faker->email,
|
||||
'user_agent' => $this->faker->userAgent,
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@ class AccountProvisioningTest extends TestCase
|
|||
->assertStatus(200)
|
||||
->assertHeader('Content-Type', 'application/xml')
|
||||
->assertSee($password->account->username)
|
||||
->assertSee($password->account->display_name)
|
||||
->assertSee('ha1');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#%define _datadir %{_datarootdir}
|
||||
#%define _docdir %{_datadir}/doc
|
||||
|
||||
%define build_number 153
|
||||
%define build_number 154
|
||||
%define var_dir /var/opt/belledonne-communications
|
||||
%define opt_dir /opt/belledonne-communications/share/flexisip-account-manager
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue