handle missing callerId property for anonymous calls

This commit is contained in:
Dave Horton
2023-05-25 13:28:42 -04:00
parent 863c4dfa34
commit 90468ffe48
2 changed files with 3 additions and 2 deletions

View File

@@ -470,7 +470,7 @@ class TaskDial extends Task {
* check if number matches any existing numbers
* */
if (t.type === 'phone' && !t.trunk) {
const str = this.callerId || req.callingNumber;
const str = this.callerId || req.callingNumber || '';
const callingNumber = str.startsWith('+') ? str.substring(1) : str;
const voip_carrier_sid = await lookupCarrierByPhoneNumber(req.body.account_sid, callingNumber);
this.logger.info(