fix cannot get register username/password

This commit is contained in:
Hoan HL
2025-11-20 13:12:35 +07:00
parent 3422a1f9ce
commit fab1d8da42
2 changed files with 19 additions and 11 deletions

View File

@@ -280,13 +280,6 @@ class CallSession extends Emitter {
const {uas, uac} = await this.srf.createB2BUA(this.req, this.res, uri, {
proxy,
headers,
// passing gateway outbound auth that sbc-inbound can send RE-INVITE with authentication process on UAS side
...(gateway.register_username && gateway.register_password && {
auth: {
username: gateway.register_username,
password: gateway.register_password
}
}),
responseHeaders,
proxyRequestHeaders: [
'all',
@@ -340,6 +333,14 @@ class CallSession extends Emitter {
},
});
// passing gateway outbound auth that sbc-inbound can send RE-INVITE with authentication process on UAS side
if (gateway.register_username && gateway.register_password) {
this.logger.info('passing outbound gateway auth to CallSession for reinvite processing');
uas.auth = {
username: gateway.register_username,
password: gateway.register_password
};
}
// successfully connected
this.logger.info('call connected successfully to feature server');
debug('call connected successfully to feature server');

View File

@@ -310,7 +310,9 @@ module.exports = (srf, logger) => {
name: gw.name,
service_provider_sid: gw.service_provider_sid,
account_sid: gw.account_sid,
application_sid: gw.application_sid
application_sid: gw.application_sid,
register_username: gw.register_username,
register_password: gw.register_password
};
});
/* remove duplicates, winnow down to voip_carriers, not gateways */
@@ -331,7 +333,8 @@ module.exports = (srf, logger) => {
service_provider_sid: gw.service_provider_sid,
account_sid: gw.account_sid,
application_sid: gw.application_sid,
pad_crypto: gw.pad_crypto
register_username: gw.register_username,
register_password: gw.register_password
};
});
/* remove duplicates */
@@ -464,7 +467,9 @@ module.exports = (srf, logger) => {
service_provider_sid: gw.service_provider_sid,
account_sid: gw.account_sid,
application_sid: gw.application_sid,
pad_crypto: gw.pad_crypto
pad_crypto: gw.pad_crypto,
register_username: gw.register_username,
register_password: gw.register_password
};
});
/* remove duplicates, winnow down to voip_carriers, not gateways */
@@ -484,7 +489,9 @@ module.exports = (srf, logger) => {
service_provider_sid: gw.service_provider_sid,
account_sid: gw.account_sid,
application_sid: gw.application_sid,
pad_crypto: gw.pad_crypto
pad_crypto: gw.pad_crypto,
register_username: gw.register_username,
register_password: gw.register_password
};
});
/* remove duplicates */