-
Notifications
You must be signed in to change notification settings - Fork 0
VAPI-3165 Add Refer BXML verb support #118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
s-aher
wants to merge
14
commits into
main
Choose a base branch
from
VAPI-3165
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+76
−0
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
c72c181
VAPI-3165 Add Refer BXML verb implementation and tests
s-aher 2b31ce6
Merge branch 'main' of github.com:Bandwidth/node-sdk into VAPI-3165
s-aher 95909f7
VAPI-3165 Update bandwidth.yaml and models for sip refer
s-aher e139ddd
Merge branch 'main' into VAPI-3165
s-aher d3414d9
Merge remote-tracking branch 'origin/VAPI-3165' into VAPI-3165
s-aher 785428c
VAPI-3165 fixed review comments
s-aher 29d1572
Merge branch 'main' into VAPI-3165
s-aher 0ed1e59
Remove ReferCompleteCallback and ReferSipUri, reuse Transfer's SipUri…
stampercasey 4d0bcb2
Merge branch 'main' into VAPI-3165
stampercasey f283249
Remove orphaned ReferCallStatus model and referCompleteCallback schema
stampercasey 5f66020
Merge remote-tracking branch 'origin/VAPI-3165' into VAPI-3165
stampercasey efe8e42
Fix TS2527 build error blocking CI: annotate createRequestFunction's …
stampercasey 3eb87e9
Address review feedback: constructor arg order, drop hand-patched com…
stampercasey ba133bd
Merge branch 'main' into VAPI-3165
ckoegel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| import { NestableVerb } from '../NestableVerb'; | ||
| import { SipUri } from './SipUri'; | ||
|
|
||
| export interface ReferAttributes { | ||
| referCompleteUrl?: string; | ||
| referCompleteMethod?: string; | ||
| tag?: string; | ||
| } | ||
|
|
||
| /** | ||
| * @export | ||
| * @class Refer | ||
| * @extends {NestableVerb} | ||
| * Represents a Refer verb. | ||
| */ | ||
| export class Refer extends NestableVerb { | ||
| attributes: ReferAttributes; | ||
|
|
||
| /** | ||
| * Creates an instance of Refer | ||
| * @param {ReferAttributes} attributes The attributes to add to the element | ||
| * @param {SipUri} sipUri The SipUri to refer to | ||
| */ | ||
| constructor(attributes?: ReferAttributes, sipUri?: SipUri) { | ||
| super('Refer', undefined, attributes, sipUri); | ||
| } | ||
|
|
||
| /** | ||
| * Set the SipUri for this Refer verb | ||
| * @param {SipUri} sipUri The SipUri to refer to | ||
| */ | ||
| setSipUri(sipUri: SipUri): void { | ||
| this.nestedVerbs = [sipUri]; | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| import { Verb } from '../../../../../models/bxml/Verb'; | ||
| import { SipUri } from '../../../../../models/bxml/verbs/SipUri'; | ||
| import { Refer, ReferAttributes } from '../../../../../models/bxml/verbs/Refer'; | ||
|
|
||
| describe('Refer', () => { | ||
| const attributes: ReferAttributes = { | ||
| referCompleteUrl: 'https://initial.com', | ||
| referCompleteMethod: 'POST', | ||
| tag: 'initialTag' | ||
| }; | ||
|
|
||
| const sipUri = new SipUri('sip:alice@atlanta.example.com'); | ||
| const newSipUri = new SipUri('sip:bob@biloxi.example.com'); | ||
|
|
||
| test('should create a Refer Verb', () => { | ||
| const refer = new Refer(attributes); | ||
| const expected = '<Refer referCompleteUrl="https://initial.com" referCompleteMethod="POST" tag="initialTag"/>'; | ||
|
|
||
| expect(refer).toBeInstanceOf(Refer); | ||
| expect(refer).toBeInstanceOf(Verb); | ||
| expect(refer.toBxml()).toBe(expected); | ||
| }); | ||
|
|
||
| test('should create a Refer Verb with a nested SipUri', () => { | ||
| const refer = new Refer(attributes, sipUri); | ||
| const expected = '<Refer referCompleteUrl="https://initial.com" referCompleteMethod="POST" tag="initialTag"><SipUri>sip:alice@atlanta.example.com</SipUri></Refer>'; | ||
|
|
||
| expect(refer).toBeInstanceOf(Refer); | ||
| expect(refer).toBeInstanceOf(Verb); | ||
| expect(refer.toBxml()).toBe(expected); | ||
| }); | ||
|
|
||
| test('should test the setSipUri method', () => { | ||
| const refer = new Refer(attributes, sipUri); | ||
| const expected = '<Refer referCompleteUrl="https://initial.com" referCompleteMethod="POST" tag="initialTag"><SipUri>sip:bob@biloxi.example.com</SipUri></Refer>'; | ||
|
|
||
| refer.setSipUri(newSipUri); | ||
| expect(refer.toBxml()).toBe(expected); | ||
| }); | ||
| }); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.