-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update victorops-twilio.js #28
base: master
Are you sure you want to change the base?
Conversation
Adjustments to accommodate Twilio's Dialverb changes. Also updated rebranding from VictorOps to Splunk On-Call
victorops-twilio.js
Outdated
noTeam: (team) => `Team ${team} does not exist. Please contact your administrator to fix the problem.` | ||
voCallNotAnswered: (caller) => `Missed call from ${caller}.`, | ||
voCallCompleted: (user, caller, log) => `${user} answered a call from ${caller}. ${log}`, | ||
noTeam: (team) => `Team ${team} does not exist. Please contact your administrator to fix the problem.` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: extra space
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
victorops-twilio.js
Outdated
@@ -544,7 +545,7 @@ function buildOnCallList (twiml, context, payload) { | |||
// Creates a list of phone numbers based on the first 3 escalation policies | |||
const escPolicyUrlArray = createEscPolicyUrls(context, teamsArray[0].slug); | |||
const phoneNumberArray = escPolicyUrlArray.map(url => getPhoneNumbers(context, url, teamsArray[0].name, teamsArray[0].escPolicyName)); | |||
|
|||
phoneNumberArray.length = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete this, it was added so we wouldn't have to wait through multiple calls for testing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
victorops-twilio.js
Outdated
const {callerId, firstCall, goToVM, phoneNumbers, teamsArray, voice} = payload; | ||
let {detailedLog, realCallerId} = payload; | ||
let phoneNumber; | ||
|
||
let phoneNumber; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: trailing space
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
victorops-twilio.js
Outdated
phoneNumber.phone | ||
); | ||
} | ||
return postToVictorOps(event,context,payload); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
return postToVictorOps(event, context, payload);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
victorops-twilio.js
Outdated
} | ||
else{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
} else {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
victorops-twilio.js
Outdated
detailedLog, | ||
phoneNumber, | ||
phoneNumbers, | ||
realCallerId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicated realCallerId, delete second one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
victorops-twilio.js
Outdated
`${messages.attemptTranscription} ${messages.goodbye}` | ||
); | ||
if (DialCallStatus == 'completed' && DialBridged == 'true') { | ||
return postToVictorOps(event,context,payload); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
return postToVictorOps(event, context, payload);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
victorops-twilio.js
Outdated
); | ||
if (DialCallStatus == 'completed' && DialBridged == 'true') { | ||
return postToVictorOps(event,context,payload); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
} else {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
victorops-twilio.js
Outdated
} else { | ||
resolve(''); | ||
return; | ||
} | ||
|
||
//console.log(alert) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
{voice}, | ||
`${messages.attemptTranscription} ${messages.goodbye}` | ||
); | ||
if (DialCallStatus == 'completed' && DialBridged == 'true') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (DialCallStatus === 'completed' && DialBridged == 'true') {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using === prevents recovery alerts when the callee hangs up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whatever gets the result we want :)
{voice}, | ||
`${messages.otherPartyDisconnect} ${messages.goodbye}` | ||
); | ||
resolve(DialCallStatus == 'completed' && TranscriptionStatus !== 'failed' ? twiml : ''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolve(DialCallStatus === 'completed' && TranscriptionStatus !== 'failed' ? twiml : '');
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using === prevents recovery alerts when the callee hangs up.
Performed further testing and revised the code
Addresses Twilio's upcoming Dialverb changes, VOSE-1461, and VOSE-1463
Adjustments to accommodate Twilio's Dialverb changes. Also updated branding from VictorOps to Splunk On-Call