mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
include service_provider_sid in call webhook
This commit is contained in:
@@ -34,6 +34,7 @@ router.post('/:partner', async(req, res) => {
|
|||||||
carrier: req.params.partner,
|
carrier: req.params.partner,
|
||||||
messageSid: app.messageSid,
|
messageSid: app.messageSid,
|
||||||
accountSid: app.accountSid,
|
accountSid: app.accountSid,
|
||||||
|
serviceProviderSid: account.service_provider_sid,
|
||||||
applicationSid: app.applicationSid,
|
applicationSid: app.applicationSid,
|
||||||
from: req.body.from,
|
from: req.body.from,
|
||||||
to: req.body.to,
|
to: req.body.to,
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ module.exports = function(srf, logger) {
|
|||||||
const {span} = rootSpan.startChildSpan('lookupAccountDetails');
|
const {span} = rootSpan.startChildSpan('lookupAccountDetails');
|
||||||
try {
|
try {
|
||||||
req.locals.accountInfo = await lookupAccountDetails(account_sid);
|
req.locals.accountInfo = await lookupAccountDetails(account_sid);
|
||||||
|
req.locals.service_provider_sid = req.locals.accountInfo?.account?.service_provider_sid;
|
||||||
span.end();
|
span.end();
|
||||||
if (!req.locals.accountInfo.account.is_active) {
|
if (!req.locals.accountInfo.account.is_active) {
|
||||||
logger.info(`Account is inactive or suspended ${account_sid}`);
|
logger.info(`Account is inactive or suspended ${account_sid}`);
|
||||||
@@ -273,7 +274,9 @@ module.exports = function(srf, logger) {
|
|||||||
}
|
}
|
||||||
/* retrieve the application to execute for this inbound call */
|
/* retrieve the application to execute for this inbound call */
|
||||||
const params = Object.assign(['POST', 'WS'].includes(app.call_hook.method) ? {sip: req.msg} : {},
|
const params = Object.assign(['POST', 'WS'].includes(app.call_hook.method) ? {sip: req.msg} : {},
|
||||||
req.locals.callInfo, {
|
req.locals.callInfo,
|
||||||
|
{service_provider_sid: req.locals.service_provider_sid},
|
||||||
|
{
|
||||||
defaults: {
|
defaults: {
|
||||||
synthesizer: {
|
synthesizer: {
|
||||||
vendor: app.speech_synthesis_vendor,
|
vendor: app.speech_synthesis_vendor,
|
||||||
|
|||||||
Reference in New Issue
Block a user