Skip to content
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

[Bug]: phone endpoint should support dtmfAnswer and onAnswer #978

Closed
nakaakist opened this issue Jan 10, 2025 · 5 comments
Closed

[Bug]: phone endpoint should support dtmfAnswer and onAnswer #978

nakaakist opened this issue Jan 10, 2025 · 5 comments
Assignees
Labels
bug A defect in the code types Some issue with the types from Typescript

Comments

@nakaakist
Copy link

Node Version

20.x

Platform

Mac (Apple Silcon)

SDK Version

"@vonage/voice": "1.16.1"

Code Sample

client.transferCallWithNCCO(uuid, [
  {
    action: NCCOActions.CONNECT,
    from: 'xxx',
    endpoint: [
      {
        type: 'phone',
        dtmfAnswer: '1234',
        onAnswer: {
          url: 'https://example.com/answer',
          ringbackTone: 'http://example.com/ringbackTone.wav',
        },
      },
    ],
  },
]);
client.createOutboundCall({
  to: [
    {
      type: 'phone',
      number: 'xxx',
      dtmfAnswer: '1234',
    },
  ],
  from: {
    type: 'phone',
    number: 'yyy',
  },
  answerUrl: ['https://example.com'],
});

Expected Behavior

The two examples provided include dtmfAnswer and onAnswer (onAnswer is only in NCCO) and should pass type checks. This is because these properties are documented in the official references: NCCO Reference and Voice API Reference

Actual Behavior

dtmfAnswer and onAnswer are not included in the type definitions, resulting in type errors.

@nakaakist nakaakist added bug A defect in the code Triage Issue needs to be triaged labels Jan 10, 2025
@manchuck manchuck added types Some issue with the types from Typescript and removed Triage Issue needs to be triaged labels Jan 10, 2025
@manchuck
Copy link
Contributor

@nakaakist I will add onAnswer to the NCCO type and let the team know about the API spec. Since there is a discrepancy, I want to verify with the Voice team the correct properties.

@manchuck
Copy link
Contributor

@nakaakist I opened #979, which addresses the missing types. When I added answer to NCCO, I did not get any type errors. Can you provide me with the error from Typescript so I can track it?

@nakaakist
Copy link
Author

@manchuck Following is the type error.

Object literal may only specify known properties, and 'onAnswer' does not exist in type 'PhoneEndpoint'.

175                 onAnswer: {
                    ~~~~~~~~

@manchuck
Copy link
Contributor

Thank you for that. I figured out why the test did not fail. Thanks for the help with that. Once the PR is approved I will cut a release

@manchuck
Copy link
Contributor

This has been released with 3.19.4 of the server-sdk (or if you are using the standalone)1.17.1 of @vonage/voice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A defect in the code types Some issue with the types from Typescript
Projects
None yet
Development

No branches or pull requests

4 participants