A building block that shows how to handle an inbound call that joins a conference call
-
You must specify one endpoint must be on the path
/webhooks/answer
-
Your endpoint must be accessible on
GET
and onPOST
requests -
Your endpoint must listen on port
3000
-
Your response should return a 200 status code
-
The
eventURL
should be likehttp://127.0.0.1:3000/webhooks/recording
orhttps://demo.ngrok.io/webhooks/recording
and should be dynamically made up of:- The request protocol
- The request hostname
- The request port (only if present)
-
/webhooks/recording
-
Your response should be JSON NCCO with the the following or equivalent body:
-
GET
request
$ curl "http://127.0.0.1:3000/webhooks/answer"
-
POST
request
$ curl -X "POST" "http://127.0.0.1:3000/webhooks/answer"
Should both result in the response:
[ { "action": "talk", "text": "Please leave a message after the tone, then press pound." }, { "action": "record", "endOnKey": "#", "beepStart": "true", "eventUrl":[ "http://127.0.0.1:3000/webhooks/recording" ] }, { "action": "talk", "text": "Thank you for your message." } ]
-
-
The following requests should log out
https://example.com
and return a 204 status code:-
GET
request
$ curl "http://127.0.0.1:3000/webhooks/recording?recording_url=https://example.com"
-
POST
request
$ curl -X "POST" "http://127.0.0.1:3000/webhooks/recording?recording_url=https://example.com"
-
POST
+ JSON request
$ curl -X "POST" "http://127.0.0.1:3000/webhooks/recording" \ -H 'Content-Type: application/json; charset=utf-8' \ -d $'{"recording_url": "https://example.com"}'
-
-
Code examples should include a GitHub link to the file
-
Code examples should include the line numbers used from the linked file
-
All code examples must be present in the
master
branch of the relevant quickstart repo -
All code examples must be tested to work (manual testing is fine)
- Fork this gist
- Edit the gist and the building block files to match the specification
- Return Gist as a comment in the original issue