Skip to content

Commit

Permalink
Merge commit for 4.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaian committed Feb 29, 2024
2 parents 4e58152 + 84b82b9 commit 36686bb
Show file tree
Hide file tree
Showing 66 changed files with 552 additions and 168 deletions.
20 changes: 20 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
Wed, 28 Feb 2024 14:21:59 +0100 IvozProvider Team <[email protected]>

* IvozProvider 4.0.1 released

* Portals
- Fixed tooltips displaying obsolete information
- Fixed some Retail Account fields not being displayed in edit screen
- Fixed External Call Filters Out of schedule number fields display issues
- Fixed Outgoing Routing Carrier field that prevented saving existing routes
- Added download button to incoming faxes PDF files

* Proxies
- Fixed endpoint identification issues on Retail Call forwards

* Application Server
- Fixed send and receive faxes not being properly converted from/to PDF

* Other
- Added missing Users CDR mixer systemd service

Wed, 07 Feb 2024 12:59:02 +0100 IvozProvider Team <[email protected]>

* IvozProvider 4.0.0 released
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ If you want to test an [standalone](https://irontec.github.io/ivozprovider/en/ar
| oldoldstable (oasis 1.7) | [![iso http](web/admin/public/images/iso-http-green.png)](https://packages.irontec.com/isos/ivozprovider-1.7.1-oasis-amd64.iso) | [![iso http](web/admin/public/images/iso-http-green.png)](https://packages.irontec.com/isos/ivozprovider-1.7.1-oasis-i386.iso)|
| oldstable (artemis 2.23.0) | [![iso http](web/admin/public/images/iso-http-green.png)](https://packages.irontec.com/isos/ivozprovider-2.23~2.23.0-artemis-amd64.iso) | |
| stable (halliday 3.4.1) | [![iso http](web/admin/public/images/iso-http-green.png)](https://packages.irontec.com/isos/ivozprovider-3.4~3.4.1-halliday-amd64.iso) | |
| testing (tempest 4.0.0) | [![iso http](web/admin/public/images/iso-http-green.png)](https://packages.irontec.com/isos/ivozprovider-4.0~4.0.0-tempest-amd64.iso) | |
| testing (tempest 4.0.1) | [![iso http](web/admin/public/images/iso-http-green.png)](https://packages.irontec.com/isos/ivozprovider-4.0~4.0.0-tempest-amd64.iso) | |


You can read about differences between releases [here](https:/irontec/ivozprovider/blob/bleeding/FAQ.md#what-release-should-i-use).
Expand Down
5 changes: 3 additions & 2 deletions asterisk/agi/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@
"irontec/ivoz-provider-bundle": "^2.5",
"irontec/replacements": "^1.0",
"php-mime-mail-parser/php-mime-mail-parser": "^7.0",
"symfony/proxy-manager-bridge": "^5.3",
"symfony/flex": "^1.9"
"symfony/flex": "^1.9",
"symfony/process": "^5.4",
"symfony/proxy-manager-bridge": "^5.3"
},
"extra": {
"symfony-assets-install": "relative",
Expand Down
43 changes: 42 additions & 1 deletion asterisk/agi/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions asterisk/agi/config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@ services:

Agi\Action\FaxReceiveStatusAction:
lazy: true
arguments:
$mailer: '@mailer'
arguments: ~

Agi\Action\FriendCallAction:
lazy: true
Expand Down
3 changes: 3 additions & 0 deletions asterisk/agi/symfony.lock
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,9 @@
"symfony/polyfill-php81": {
"version": "1.23-dev"
},
"symfony/process": {
"version": "v5.4.28"
},
"symfony/property-access": {
"version": "v3.4.44"
},
Expand Down
8 changes: 7 additions & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
ivozprovider (4.0~4.0.0) UNRELEASED; urgency=medium
ivozprovider (4.0~4.0.1) UNRELEASED; urgency=medium

* Version bump to 4.0.1

-- Irontec IvozProvider Team <[email protected]> Wed, 28 Feb 2024 15:30:53 +0100

ivozprovider (4.0~4.0.0) unstable; urgency=medium

* Version bump to 4.0.0

Expand Down
15 changes: 8 additions & 7 deletions kamailio/users/config/kamailio.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -1191,7 +1191,7 @@ route[DISPATCH_TO_AS] {
send_reply("500", "Internal Server Error [DTA]");
exit;
}
$var(sorcery) = $var(sorcery) + "_" + $fU;
$var(sorcery) = $var(sorcery) + "_" + $avp(endpointName);
append_hf("X-Info-Endpoint: $var(sorcery)\r\n");

# Static routing to specific AS?
Expand Down Expand Up @@ -1777,7 +1777,7 @@ route[GET_ENDPOINT] {
# cached?
if ($sht(aors=>$var(aor)) != $null) {
$xavp(endpoint) = $null;
sql_xquery("cb", "SELECT T.id, T.password FROM $sht(aors=>$var(aor)) T JOIN Domains D ON D.id=T.domainId WHERE T.name='$var(username)' AND D.domain='$var(domain)'", "endpoint");
sql_xquery("cb", "SELECT T.id, T.password, T.name FROM $sht(aors=>$var(aor)) T JOIN Domains D ON D.id=T.domainId WHERE T.name='$var(username)' AND D.domain='$var(domain)'", "endpoint");
if ($xavp(endpoint=>id) != $null) {
$var(found) = 1;
break;
Expand All @@ -1787,7 +1787,7 @@ route[GET_ENDPOINT] {

# terminal
$xavp(endpoint) = $null;
sql_xquery("cb", "SELECT T.id, T.password FROM Terminals T JOIN Domains D ON D.id=T.domainId WHERE T.name='$var(username)' AND D.domain='$var(domain)'", "endpoint");
sql_xquery("cb", "SELECT T.id, T.password, T.name FROM Terminals T JOIN Domains D ON D.id=T.domainId WHERE T.name='$var(username)' AND D.domain='$var(domain)'", "endpoint");
if ($xavp(endpoint=>id) != $null) {
$sht(aors=>$var(aor)) = "Terminals";
$var(found) = 1;
Expand All @@ -1796,7 +1796,7 @@ route[GET_ENDPOINT] {

# retail
$xavp(endpoint) = $null;
sql_xquery("cb", "SELECT T.id, T.password FROM RetailAccounts T JOIN Domains D ON D.id=T.domainId WHERE T.name='$var(username)' AND D.domain='$var(domain)'", "endpoint");
sql_xquery("cb", "SELECT T.id, T.password, T.name FROM RetailAccounts T JOIN Domains D ON D.id=T.domainId WHERE T.name='$var(username)' AND D.domain='$var(domain)'", "endpoint");
if ($xavp(endpoint=>id) != $null) {
$sht(aors=>$var(aor)) = "RetailAccounts";
$var(found) = 1;
Expand All @@ -1805,7 +1805,7 @@ route[GET_ENDPOINT] {

# friend
$xavp(endpoint) = $null;
sql_xquery("cb", "SELECT T.id, T.password FROM Friends T JOIN Domains D ON D.id=T.domainId WHERE T.name='$var(username)' AND D.domain='$var(domain)'", "endpoint");
sql_xquery("cb", "SELECT T.id, T.password, T.name FROM Friends T JOIN Domains D ON D.id=T.domainId WHERE T.name='$var(username)' AND D.domain='$var(domain)'", "endpoint");
if ($xavp(endpoint=>id) != $null) {
$sht(aors=>$var(aor)) = "Friends";
$var(found) = 1;
Expand All @@ -1814,7 +1814,7 @@ route[GET_ENDPOINT] {

# residential
$xavp(endpoint) = $null;
sql_xquery("cb", "SELECT T.id, T.password FROM ResidentialDevices T JOIN Domains D ON D.id=T.domainId WHERE T.name='$var(username)' AND D.domain='$var(domain)'", "endpoint");
sql_xquery("cb", "SELECT T.id, T.password, T.name FROM ResidentialDevices T JOIN Domains D ON D.id=T.domainId WHERE T.name='$var(username)' AND D.domain='$var(domain)'", "endpoint");
if ($xavp(endpoint=>id) != $null) {
$sht(aors=>$var(aor)) = "ResidentialDevices";
$var(found) = 1;
Expand All @@ -1832,9 +1832,10 @@ route[GET_ENDPOINT] {

$avp(endpointType) = $sht(aors=>$var(aor));
$avp(endpointId) = $xavp(endpoint=>id);
$avp(endpointName) = $xavp(endpoint=>name);
$avp(password) = $xavp(endpoint=>password);

xinfo("[$dlg_var(cidhash)] GET-ENDPOINT: $avp(endpointType)#$avp(endpointId)");
xinfo("[$dlg_var(cidhash)] GET-ENDPOINT: $avp(endpointType)#$avp(endpointId)#$avp(endpointName)");
}

route[BAD_CREDENTIALS] {
Expand Down
48 changes: 0 additions & 48 deletions library/Ivoz/Kam/Domain/Model/UsersCdr/UsersCdrDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,4 @@

class UsersCdrDto extends UsersCdrDtoAbstract
{
/**
* @inheritdoc
* @codeCoverageIgnore
*/
public static function getPropertyMap(string $context = '', string $role = null): array
{
if ($context === self::CONTEXT_COLLECTION) {
$response = [
'id' => 'id',
'startTime' => 'startTime',
'endTime' => 'endTime',
'duration' => 'duration',
'direction' => 'direction',
'caller' => 'caller',
'callee' => 'callee',
];

if ($role !== 'ROLE_COMPANY_USER') {
$response += [
'userId' => 'user',
'friendId' => 'friend'
];
}
} else {
$response = parent::getPropertyMap(...func_get_args());
}

if ($role === 'ROLE_BRAND_ADMIN') {
unset($response['brandId']);
} elseif ($role === 'ROLE_COMPANY_ADMIN') {
unset($response['companyId']);
}

return $response;
}

public function denormalize(array $data, string $context, string $role = ''): void
{
$contextProperties = self::getPropertyMap($context, $role);
if ($role === 'ROLE_BRAND_ADMIN') {
$contextProperties['brandId'] = 'brand';
}

$this->setByContext(
$contextProperties,
$data
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ public function toDto(EntityInterface $residentialDevice, int $depth = 0, string
return $dto;
}

$dto->setDomainName(
$domain->getDomain()
);
if ($context === ResidentialDeviceDto::CONTEXT_STATUS) {
$dto->setDomainName(
$domain->getDomain()
);
}

$userLocations = $this
->usersLocationRepository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,15 @@ public function toDto(EntityInterface $retailAccount, int $depth = 0, string $co
return $dto;
}

$dto->setDomainName(
$domain->getDomain()
);
$statusContexts = [
RetailAccountDto::CONTEXT_STATUS,
RetailAccountDto::CONTEXT_STATUS_ITEM
];
if (in_array($context, $statusContexts, true)) {
$dto->setDomainName(
$domain->getDomain()
);
}

$userLocations = $this
->usersLocationRepository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ interface CompanyRepository extends RepositoryInterface
*/
public function findIdsByBrandId($id);

/**
* @return array<array-key, int>
*/
public function findDomainIdsByBrandId(int $id): array;

/**
* Used by brand API access controls
* @inheritdoc
Expand Down
54 changes: 45 additions & 9 deletions library/Ivoz/Provider/Domain/Model/Domain/DomainDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,30 @@ class DomainDto extends DomainDtoAbstract
public static function getPropertyMap(string $context = '', string $role = null): array
{
if ($context === self::CONTEXT_COLLECTION) {
if ($role === 'ROLE_COMPANY_ADMIN') {
return [
'id' => 'id',
'domain' => 'domain',
];
}

return [
$response = [
'id' => 'id',
'domain' => 'domain',
'pointsTo' => 'pointsTo',
'brandName' => 'brandName',
'companyName' => 'companyName'
];
} else {
$response = parent::getPropertyMap(...func_get_args());
}

return parent::getPropertyMap(...func_get_args());
if ($role === 'ROLE_BRAND_ADMIN') {
return self::filterFieldsForBrandAdmin(
$response,
);
}

if ($role === 'ROLE_COMPANY_ADMIN') {
return self::filterFieldsForCompanyAdmin(
$response,
);
}

return $response;
}

public function setBrandName(string $name): void
Expand All @@ -51,4 +58,33 @@ public function toArray(bool $hideSensitiveData = false): array

return $response;
}

/**
* @param array<array-key, mixed> $response
* @return array<array-key, mixed>
*/
private static function filterFieldsForBrandAdmin(array $response): array
{
return self::filterFieldsForCompanyAdmin($response);
}

/**
* @param array<array-key, mixed> $response
* @return array<array-key, mixed>
*/
private static function filterFieldsForCompanyAdmin(array $response): array
{
$allowedFields = [
'id',
'domain',
];

return array_filter(
$response,
function ($key) use ($allowedFields): bool {
return in_array($key, $allowedFields, true);
},
ARRAY_FILTER_USE_KEY
);
}
}
10 changes: 10 additions & 0 deletions library/Ivoz/Provider/Domain/Model/FaxesInOut/FaxesInOut.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ public function getChangeSet(): array
return parent::getChangeSet();
}

/**
* {@inheritDoc}
*/
protected function sanitizeValues(): void
{
if (!$this->getStatus()) {
$this->setStatus(self::STATUS_PENDING);
}
}

/**
* @return array
*/
Expand Down
Loading

0 comments on commit 36686bb

Please sign in to comment.