mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
major revamp of http client functionalit
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
const {CallDirection, CallStatus} = require('../utils/constants');
|
||||
const uuidv4 = require('uuid/v4');
|
||||
|
||||
/**
|
||||
* @classdesc Represents the common information for all calls
|
||||
* that is provided in call status webhooks
|
||||
*/
|
||||
class CallInfo {
|
||||
constructor(opts) {
|
||||
this.direction = opts.direction;
|
||||
@@ -48,11 +52,20 @@ class CallInfo {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* update the status of the call
|
||||
* @param {string} callStatus - current call status
|
||||
* @param {number} sipStatus - current sip status
|
||||
*/
|
||||
updateCallStatus(callStatus, sipStatus) {
|
||||
this.callStatus = callStatus;
|
||||
if (sipStatus) this.sipStatus = sipStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* associate customer-provided data with the call information.
|
||||
* this information will be provided with every call status callhook
|
||||
*/
|
||||
set customerData(obj) {
|
||||
this._customerData = obj;
|
||||
}
|
||||
@@ -84,6 +97,7 @@ class CallInfo {
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = CallInfo;
|
||||
|
||||
Reference in New Issue
Block a user