feat: add metadata to create call as tag

This commit is contained in:
Quan HL
2023-05-07 06:59:35 +07:00
parent 9948592080
commit 252ad2d07f
3 changed files with 74 additions and 51 deletions

View File

@@ -13,6 +13,7 @@ class CallInfo {
this.direction = opts.direction;
this.traceId = opts.traceId;
this.callTerminationBy = undefined;
this.metadata = opts.metadata;
if (opts.req) {
const u = opts.req.getParsedHeader('from');
const uri = parseUri(u.uri);
@@ -91,6 +92,7 @@ class CallInfo {
this.from = from || req.callingNumber;
this.to = to;
if (tag) this._customerData = tag;
if (this.metadata) this._customerData = {...this._customerData , ...this.metadata}
}
this.localSipAddress = srf.locals.localSipAddress;