You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* initial Ncco class creation
* adding optional fields, changing structure for namespacing reasons
* added pydantic as dependency
* using List type from typing module
* adding and testing Notify and Talk actions, refactoring build_ncco method
* more endpoints and tests
* added connect_endpoints.py, Endpoints types, refactored into separate modules, testing connect action and endpoint models
* placeholder validator test
* changing NCCO builder test and module structure, add Connect and Stream endpoints, starting Input endpoint
* added Input action and submodels, testing Input action, adding pay and submodels
* renaming to fix validator conflict
* adding pay prompt actions and errors, pay action testing
* adding PayPrompts tests, adding type hints
* finished Pay action, testing Ncco.build_ncco method
* removing custom URL types as they cause problems, testing NCCO builder
* adding full ncco builder test
* added voice test using ncco builder
The SDK contains a builder to help you create Call Control Objects (NCCOs) for use with the Vonage Voice API.
344
+
345
+
For more information, [check the full NCCO reference documentation on the Vonage website](https://developer.vonage.com/voice/voice-api/ncco-reference).
346
+
347
+
An NCCO is a list of "Actions": steps to be followed when a call is initiated or received.
348
+
349
+
Use the builder to construct valid NCCO actions, which are modelled in the SDK as [Pydantic](https://docs.pydantic.dev) models, and build them into an NCCO. The NCCO actions supported by the builder are:
350
+
351
+
* Record
352
+
* Conversation
353
+
* Connect
354
+
* Talk
355
+
* Stream
356
+
* Input
357
+
* Notify
358
+
* Pay
359
+
360
+
### Construct actions
361
+
362
+
```python
363
+
record = Ncco.Record(eventUrl=['https://example.com'])
364
+
talk = Ncco.Talk(text='Hello from Vonage!', bargeIn=True, loop=5, premium=True)
365
+
```
366
+
367
+
The Connect action has each valid endpoint type (phone, application, WebSocket, SIP and VBC) specified as a Pydantic model so these can be validated, though it is also possible to pass in a dict with the endpoint properties directly into the `Ncco.Connect` object.
368
+
369
+
This example shows a Connect action created with an endpoint object.
Create an NCCO from the actions with the `Ncco.build_ncco` method. This will be returned as a list of dicts representing each action and can be used in calls to the Voice API.
0 commit comments