Skip to content

Commit d338f37

Browse files
authored
updating NCCO info (#253)
* updating NCCO info * updating ncco builder tests
1 parent 70b7209 commit d338f37

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,11 @@ response = client.voice.create_call({
402402
pprint(response)
403403
```
404404

405+
### Note on from_ parameter in connect action
406+
407+
When using the `connect` action, use the parameter `from_` to specify the recipient (as `from` is a reserved keyword in Python!)
408+
409+
405410
## Verify API
406411

407412
### Search for a Verification request

src/vonage/ncco_builder/ncco.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Conversation(Action):
4242
while preserving the communication context.
4343
Using conversation with the same name reuses the same persisted conversation."""
4444

45-
action = Field('notify', const=True)
45+
action = Field('conversation', const=True)
4646
name: str
4747
musicOnHoldUrl: Optional[Union[List[str], str]]
4848
startOnEnter: Optional[bool]

tests/test_ncco_builder/ncco_samples/ncco_action_samples.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
record_add_split = '{"action": "record", "split": "conversation", "channels": 4}'
66

7-
conversation_basic = '{"action": "notify", "name": "my_conversation"}'
7+
conversation_basic = '{"action": "conversation", "name": "my_conversation"}'
88

9-
conversation_full = '{"action": "notify", "name": "my_conversation", "musicOnHoldUrl": ["http://example.com/music.mp3"], "startOnEnter": true, "endOnExit": true, "record": true, "canSpeak": ["asdf", "qwer"], "canHear": ["asdf"]}'
9+
conversation_full = '{"action": "conversation", "name": "my_conversation", "musicOnHoldUrl": ["http://example.com/music.mp3"], "startOnEnter": true, "endOnExit": true, "record": true, "canSpeak": ["asdf", "qwer"], "canHear": ["asdf"]}'
1010

11-
conversation_mute_option = '{"action": "notify", "name": "my_conversation", "mute": true}'
11+
conversation_mute_option = '{"action": "conversation", "name": "my_conversation", "mute": true}'
1212

1313
connect_phone = '{"action": "connect", "endpoint": [{"type": "phone", "number": "447000000000", "dtmfAnswer": "1p2p3p#**903#", "onAnswer": {"url": "https://example.com/answer", "ringbackTone": "http://example.com/ringbackTone.wav"}}]}'
1414

tests/test_ncco_builder/ncco_samples/ncco_builder_samples.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171

7272
insane_ncco = [
7373
{'action': 'record', 'eventUrl': ['http://example.com/events']},
74-
{'action': 'notify', 'name': 'my_conversation'},
74+
{'action': 'conversation', 'name': 'my_conversation'},
7575
{
7676
'action': 'connect',
7777
'endpoint': [{'number': '447000000000', 'type': 'phone'}],

0 commit comments

Comments
 (0)