2021-03-23 15:49:08 -07:00
|
|
|
import {
|
|
|
|
INodeProperties,
|
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const callOperations: INodeProperties[] = [
|
2021-03-23 15:49:08 -07:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2021-03-23 15:49:08 -07:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'call',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Make',
|
|
|
|
value: 'make',
|
|
|
|
description: 'Make a voice call',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Make a call',
|
2021-03-23 15:49:08 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'make',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2021-03-23 15:49:08 -07:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const callFields: INodeProperties[] = [
|
2021-03-23 15:49:08 -07:00
|
|
|
// ----------------------------------
|
|
|
|
// call: make
|
|
|
|
// ----------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'From',
|
|
|
|
name: 'from',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
placeholder: '+14156667777',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Caller ID for the call to make',
|
2021-03-23 15:49:08 -07:00
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'call',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'make',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'To',
|
|
|
|
name: 'to',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
placeholder: '+14156667778',
|
|
|
|
required: true,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Phone number to make the call to',
|
2021-03-23 15:49:08 -07:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'call',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'make',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Answer Method',
|
|
|
|
name: 'answer_method',
|
|
|
|
type: 'options',
|
|
|
|
required: true,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'HTTP verb to be used when invoking the Answer URL',
|
2021-03-23 15:49:08 -07:00
|
|
|
default: 'POST',
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'GET',
|
|
|
|
value: 'GET',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'POST',
|
|
|
|
value: 'POST',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'call',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'make',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Answer URL',
|
|
|
|
name: 'answer_url',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2021-11-25 09:10:06 -08:00
|
|
|
description: 'URL to be invoked by Plivo once the call is answered. It should return the XML to handle the call once answered.',
|
2021-03-23 15:49:08 -07:00
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'call',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'make',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|