-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SPARK-568641: Parse SIP name for guest calling (#3904)
- Loading branch information
Showing
4 changed files
with
23 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,14 +114,14 @@ describe('CallerId tests', () => { | |
const dummyCallerId = { | ||
'x-broadworks-remote-party-info': | ||
'userId="[email protected]";userDn="tel:+12142865888;ext=5888;country-code=1";externalId=69fde5ad-fb8b-4a1b-9998-b0999e95719b', | ||
'p-asserted-identity': '"Bob Marley" <sip:[email protected];user=phone>', | ||
'p-asserted-identity': '"John O\'Connor - ( Guest )" <sip:[email protected];user=phone>', | ||
from: '"Alice" <sip:[email protected]>;tag=1932136170-1654008881246', | ||
}; | ||
|
||
const output = callerId.fetchCallerDetails(dummyCallerId); | ||
|
||
/* PAI should be preferred */ | ||
expect(output.name).toStrictEqual('Bob Marley'); | ||
expect(output.name).toStrictEqual("John O'Connor - ( Guest )"); | ||
expect(output.num).toStrictEqual('5888'); | ||
await waitForMsecs(50); | ||
|
||
|
@@ -132,12 +132,11 @@ describe('CallerId tests', () => { | |
expect(callerId['callerInfo'].num).toStrictEqual('5008'); | ||
}); | ||
|
||
it(' When PA-ID ,From header is present along with x-broad-works , but name in PAI is of wrong format', async () => { | ||
it(' When PA-ID ,From header is present along with x-broad-works , but name in PAI is missing', async () => { | ||
const dummyCallerId = { | ||
'x-broadworks-remote-party-info': | ||
'userId="[email protected]";userDn="tel:+12142865888;ext=5888;country-code=1";externalId=69fde5ad-fb8b-4a1b-9998-b0999e95719b', | ||
'p-asserted-identity': | ||
'"69fde5ad-fb8b-4a1b-9998-b0999e95719b" <sip:[email protected];user=phone>', | ||
'p-asserted-identity': '<sip:[email protected];user=phone>', | ||
from: '"Alice" <sip:[email protected]>;tag=1932136170-1654008881246', | ||
}; | ||
|
||
|
@@ -156,12 +155,11 @@ describe('CallerId tests', () => { | |
expect(callerId['callerInfo'].num).toStrictEqual('5008'); | ||
}); | ||
|
||
it(' When PA-ID ,From header is present along with x-broad-works , but name in PAI is of wrong format', async () => { | ||
it(' When PA-ID ,From header is present along with x-broad-works , but name, number in PAI is missing', async () => { | ||
const dummyCallerId = { | ||
'x-broadworks-remote-party-info': | ||
'userId="[email protected]";userDn="tel:+12142865888;ext=5888;country-code=1";externalId=69fde5ad-fb8b-4a1b-9998-b0999e95719b', | ||
'p-asserted-identity': | ||
'"69fde5ad-fb8b-4a1b-9998-b0999e95719b" <sip:[email protected];user=phone>', | ||
'p-asserted-identity': '<sip:[email protected];user=phone>', | ||
from: '"Alice" <sip:[email protected]>;tag=1932136170-1654008881246', | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters