Skip to content

Commit

Permalink
Merge pull request #2811 from irontec/PROVIDER-2079-hint-sip-alg-term…
Browse files Browse the repository at this point in the history
…inales-broken

Hint sip alg terminales broken
  • Loading branch information
cruzccl authored Nov 7, 2024
2 parents de58583 + 7a8a16e commit a54ee89
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions library/Ivoz/Provider/Domain/Model/Terminal/TerminalDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public static function getPropertyMap(string $context = '', string $role = null)
'publicReceived',
'expires',
'userAgent',
'publicContact'
]]
];

Expand Down Expand Up @@ -94,6 +95,7 @@ public static function getPropertyMap(string $context = '', string $role = null)
'publicReceived',
'expires',
'userAgent',
'publicContact'
]];
}

Expand Down
5 changes: 2 additions & 3 deletions web/portal/client/src/entities/RetailAccount/Field/Status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,14 @@ const Status: StatusIconProps = (props): JSX.Element | null => {
const publicReceived = row.publicReceived;
const expires = row.expires;
const userAgent = row.userAgent;
const contact = row.contact.match(/sips?:([^@]+@)?(.+)/)?.pop();
const contact = row.contact.match(/sips?:([^@]+@)?([^;]+)/)?.pop();
const publicContact = row.publicContact;

let hintMsg: string | React.ReactElement = '';
if (!received) {
hintMsg = publicContact
? _('No NAT with public Contact (hint: SIP ALG / STUN)')
: _('No NAT with private Contact (hint: internal routing)');
} else if (contact === received) {
hintMsg = _('Regular NAT detected');
} else if (publicReceived && !publicContact) {
hintMsg = _('Regular NAT detected');
} else {
Expand Down Expand Up @@ -134,6 +132,7 @@ const Status: StatusIconProps = (props): JSX.Element | null => {
</Tooltip>
{hintMsg}
</div>
{status.length - 1 !== key && <br />}
</div>
);
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Feature: Retrieve terminals status
"status": [
{
"contact": "sip:[email protected]:5060",
"publicContact": false,
"received": "sip:212.64.172.23:5060",
"publicReceived": true,
"expires": "2031-01-01 00:59:59",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ Feature: Retrieve terminals
"status": [
{
"contact": "sip:[email protected]:5060",
"publicContact": false,
"received": "sip:212.64.172.23:5060",
"publicReceived": true,
"expires": "2031-01-01 00:59:59",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Feature: Retrieve terminals status
"status": [
{
"contact": "sip:[email protected]:5060",
"publicContact": false,
"received": "sip:212.64.172.23:5060",
"publicReceived": true,
"expires": "2031-01-01 00:59:59",
Expand Down

0 comments on commit a54ee89

Please sign in to comment.