Skip to content

Commit 154b9bc

Browse files
author
Tony Bedford
committed
Building block for join-outbound-calls
1 parent 67e6334 commit 154b9bc

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

voice/join-outbound-calls.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env python3
2+
from flask import Flask, request, jsonify
3+
4+
app = Flask(__name__)
5+
6+
@app.route("/webhooks/answer")
7+
def answer_call():
8+
ncco = [
9+
{
10+
"action": "connect",
11+
"from": "NEXMO_NUMBER",
12+
"endpoint": [{
13+
"type": 'phone',
14+
"number": "RECIPIENT_NUMBER_1"
15+
}]
16+
},
17+
{
18+
"action": "connect",
19+
"from": "NEXMO_NUMBER",
20+
"endpoint": [{
21+
"type": 'phone',
22+
"number": "RECIPIENT_NUMBER_2"
23+
}]
24+
}
25+
]
26+
return jsonify(ncco)
27+
28+
if __name__ == '__main__':
29+
app.run(port=3000)

0 commit comments

Comments
 (0)