File tree 2 files changed +27
-2
lines changed
2 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,16 @@ export default [
36
36
{
37
37
action : NCCOActions . TALK ,
38
38
text : "I'll always dial the K for you" ,
39
+ bargeIn : false ,
40
+ } ,
41
+ {
42
+ payload : {
43
+ room_name : 'my-room' ,
44
+ id : 'CON-00000000-0000-0000-0000-000000000000' ,
45
+ } ,
46
+ eventUrl : [ 'https://example.com/event' ] ,
47
+ eventMethod : 'POST' ,
48
+ action : 'notify' ,
39
49
} ,
40
50
] ,
41
51
random_from_number : false ,
@@ -80,6 +90,16 @@ export default [
80
90
{
81
91
action : NCCOActions . TALK ,
82
92
text : "I'll always dial the K for you" ,
93
+ bargeIn : false ,
94
+ } ,
95
+ {
96
+ payload : {
97
+ room_name : 'my-room' ,
98
+ id : 'CON-00000000-0000-0000-0000-000000000000' ,
99
+ } ,
100
+ eventUrl : [ 'https://example.com/event' ] ,
101
+ eventMethod : 'POST' ,
102
+ action : 'notify' ,
83
103
} ,
84
104
] ,
85
105
randomFromNumber : false ,
Original file line number Diff line number Diff line change 1
1
import { AuthenticationType , Client , FileClient } from '@vonage/server-client' ;
2
- import { NCCOActions } from './enums' ;
3
2
import {
4
3
GetCallDetailsParameters ,
5
4
CallPageResponse ,
@@ -12,6 +11,7 @@ import {
12
11
Action ,
13
12
TalkAction ,
14
13
OutboundCall ,
14
+ CallWithNCCO ,
15
15
} from './types' ;
16
16
17
17
import { ResponseTypes } from '@vonage/vetch' ;
@@ -237,9 +237,14 @@ export class Voice extends Client {
237
237
* ```
238
238
*/
239
239
async createOutboundCall ( call : OutboundCall ) : Promise < CallResult > {
240
+ const callRequest = Client . transformers . snakeCaseObjectKeys ( call , true ) ;
241
+ if ( ( call as CallWithNCCO ) . ncco ) {
242
+ callRequest . ncco = ( call as CallWithNCCO ) . ncco ;
243
+ }
244
+
240
245
const resp = await this . sendPostRequest < CreateCallResponse > (
241
246
`${ this . config . apiHost } /v1/calls` ,
242
- Client . transformers . snakeCaseObjectKeys ( call , true ) ,
247
+ callRequest ,
243
248
) ;
244
249
const result = Client . transformers . camelCaseObjectKeys (
245
250
resp . data ,
You can’t perform that action at this time.
0 commit comments