Skip to content

Commit a7bc627

Browse files
committed
Add start an outbound call example
1 parent 0d2389f commit a7bc627

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,21 @@ else:
119119
print 'Error:', response['error_text']
120120
```
121121

122+
### Start an outbound call
123+
124+
Use Nexmo's [Call API][doc_call] to initiate an outbound voice call by calling
125+
the initiate_call method with the number to call and the URL to a VoiceXML
126+
resource for controlling the call:
127+
128+
```python
129+
response = client.initiate_call(to='447525856424', answer_url='http://example.com/call.xml')
130+
131+
if response['status'] == '0':
132+
print 'Started call', response['call-id']
133+
else:
134+
print 'Error:', response['error-text']
135+
```
136+
122137

123138
License
124139
-------
@@ -128,4 +143,5 @@ This library is released under the [MIT License][license]
128143
[signup]: https://dashboard.nexmo.com/sign-up?utm_source=DEV_REL&utm_medium=github&utm_campaign=python-client-library
129144
[doc_sms]: https://docs.nexmo.com/messaging/sms-api?utm_source=DEV_REL&utm_medium=github&utm_campaign=python-client-library
130145
[doc_verify]: https://docs.nexmo.com/verify/api-reference?utm_source=DEV_REL&utm_medium=github&utm_campaign=python-client-library
146+
[doc_call]: https://docs.nexmo.com/voice/call?utm_source=DEV_REL&utm_medium=github&utm_campaign=python-client-library
131147
[license]: LICENSE.txt

0 commit comments

Comments
 (0)