-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
179 additions
and
418 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,21 @@ | ||
require('dotenv').config({ path: __dirname + '/../.env' }); | ||
const { FileClient } = require('@vonage/server-client'); | ||
|
||
const VONAGE_PRIVATE_KEY = __dirname +'/../'+ process.env.VONAGE_PRIVATE_KEY; | ||
const VONAGE_APPLICATION_ID = process.env.VONAGE_APPLICATION_ID; | ||
|
||
const RECORDING_URL = process.env.RECORDING_URL; | ||
const FILE_PATH = process.env.FILE_PATH; | ||
|
||
const { FileClient } = require('@vonage/server-client'); | ||
const VOICE_RECORDING_URL = process.env.VOICE_RECORDING_URL; | ||
const VOICE_RECORDING_DESTINATION = process.env.VOICE_RECORDING_DESTINATION; | ||
|
||
const fileClient = new FileClient({ | ||
applicationId: VONAGE_APPLICATION_ID, | ||
privateKey: VONAGE_PRIVATE_KEY, | ||
}); | ||
|
||
fileClient.downloadFile( | ||
RECORDING_URL, | ||
FILE_PATH, | ||
VOICE_RECORDING_URL, | ||
VOICE_RECORDING_DESTINATION, | ||
) | ||
.then(() => console.log(`File Downloaded to ${FILE_PATH}`)) | ||
.then(() => console.log(`File Downloaded to ${VOICE_RECORDING_DESTINATION}`)) | ||
.catch((error) => console.error(error)); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
require('dotenv').config({ path: __dirname + '/../.env' }); | ||
const { Vonage } = require('@vonage/server-sdk'); | ||
|
||
const VONAGE_APPLICATION_ID = process.env.VONAGE_APPLICATION_ID; | ||
const VONAGE_PRIVATE_KEY = process.env.VONAGE_PRIVATE_KEY; | ||
const VOICE_TO_NUMBER = process.env.VOICE_TO_NUMBER; | ||
const VONAGE_VIRTUAL_NUMBER = process.env.VONAGE_VIRTUAL_NUMBER; | ||
const VOICE_ANSWER_URL = process.env.VOICE_ANSWER_URL; | ||
|
||
const vonage = new Vonage({ | ||
applicationId: VONAGE_APPLICATION_ID, | ||
privateKey: VONAGE_PRIVATE_KEY, | ||
}); | ||
|
||
vonage.voice.createOutboundCall({ | ||
to: [ | ||
{ | ||
type: 'phone', | ||
number: VOICE_TO_NUMBER, | ||
}, | ||
], | ||
from: { | ||
type: 'phone', | ||
number: VONAGE_VIRTUAL_NUMBER, | ||
}, | ||
answer_url: [VOICE_ANSWER_URL], | ||
}) | ||
.then((resp) => console.log(resp)) | ||
.catch((error) => console.error(error)); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.