Skip to content

Instantly share code, notes, and snippets.

@jurgob
Last active September 27, 2019 10:27
Show Gist options
  • Save jurgob/35159a4c9af74e90e5fa3bd131190146 to your computer and use it in GitHub Desktop.
Save jurgob/35159a4c9af74e90e5fa3bd131190146 to your computer and use it in GitHub Desktop.
//current:
/*
I m gonna take a simple ncco with is doing a pstn connect.
I m gonna propose how we can instruct it in order to use an exesting converation called "nexmo-permanent-conversation"
*/
/** TODAY */
[
{
"action": "connect",
"eventUrl": ["https://example.com/events"],
"from":"447700900000",
"endpoint": [
{
"type": "phone",
"number": "447700900001"
}
]
}
]
/**
proposal 1:
eventUrl in the connection action
notes:
- this is inspired to how the "input" action is working today.
**/
{
"action": "conversation",
"name": "nexmo-permanent-conversation",
"eventUrl": ["https://example.com/myNCCO"]
}
// https://example.com/myNCCO
[
{
"action": "connect",
"eventUrl": ["https://example.com/events"],
"from":"447700900000",
"endpoint": [
{
"type": "phone",
"number": "447700900001"
}
]
}
]
/**
proposal 2:
eventUrl in the connection action
notes:
- it should still be possible to specify an ncco with just with []
**/
{
"context": {
"conversation" : "nexmo-permanent-conversation"
},
"ncco": [
{
"action": "connect",
"eventUrl": ["https://example.com/events"],
"from":"447700900000",
"endpoint": [
{
"type": "phone",
"number": "447700900001"
}
]
}
]
}
/**
proposal 3:
context action
- the context action can be ONLY the first question.
- NCCO should be considered "invalid" if the position is different then 0 or there's more then one action
**/
[
{
"action": "context",
"conversation": "nexmo-permanent-conversation"
},
{
"action": "connect",
"eventUrl": ["https://example.com/events"],
"from":"447700900000",
"endpoint": [
{
"type": "phone",
"number": "447700900001"
}
]
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment