mirror of
https://github.com/jambonz/sbc-inbound.git
synced 2025-12-19 04:37:43 +00:00
fix cannot get register username/password
This commit is contained in:
@@ -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');
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user