Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ee/packages/media-calls/src/sip/Session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ export class SipServerSession {
return `sip:${extension}@${host}${portStr}`;
}

public stripDrachtioServerDetails(reqOrRes: Srf.SipMessage): Record<string, any> {
const { _agent, socket: _socket, _req, _res, ...data } = reqOrRes as Record<string, any>;

return data;
}

private isEnabledOnSettings(settings: IMediaCallServerSettings): boolean {
return Boolean(settings.enabled && settings.sip.enabled && settings.sip.drachtio.host && settings.sip.drachtio.secret);
}
Expand Down
6 changes: 3 additions & 3 deletions ee/packages/media-calls/src/sip/providers/IncomingSipCall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export class IncomingSipCall extends BaseSipCall {

calleeAgent.onRemoteDescriptionChanged(this.call._id, negotiationId);

logger.debug({ msg: 'modify', method: 'IncomingSipCall.createDialog', req });
logger.debug({ msg: 'modify', method: 'IncomingSipCall.createDialog', req: this.session.stripDrachtioServerDetails(req) });
} catch (error) {
logger.error({ msg: 'An unexpected error occured while processing a modify event on an IncomingSipCall dialog', error });

Expand Down Expand Up @@ -201,7 +201,7 @@ export class IncomingSipCall extends BaseSipCall {
}

protected cancel(res: SipMessage): void {
logger.debug({ msg: 'IncomingSipCall.cancel', res });
logger.debug({ msg: 'IncomingSipCall.cancel', res: this.session.stripDrachtioServerDetails(res) });

void mediaCallDirector.hangup(this.call, this.agent, 'remote').catch(() => null);
}
Expand Down Expand Up @@ -307,7 +307,7 @@ export class IncomingSipCall extends BaseSipCall {
const negotiation = await MediaCallNegotiations.findOneById(localNegotiation.id);
// Negotiation will always exist; This is just a safe guard
if (!negotiation) {
logger.error({ msg: 'Invalid Negotiation reference on IncomingSipCall.', localNegotiation });
logger.error({ msg: 'Invalid Negotiation reference on IncomingSipCall.', localNegotiation: localNegotiation.id });
this.inboundRenegotiations.delete(localNegotiation.id);
if (localNegotiation.res) {
localNegotiation.res.send(SipErrorCodes.INTERNAL_SERVER_ERROR);
Expand Down
18 changes: 13 additions & 5 deletions ee/packages/media-calls/src/sip/providers/OutgoingSipCall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,22 @@ export class OutgoingSipCall extends BaseSipCall {
},
{
cbProvisional: (provRes) => {
logger.debug({ msg: 'OutgoingSipCall.createDialog - got provisional response', provRes });
logger.debug({
msg: 'OutgoingSipCall.createDialog - got provisional response',
provRes: provRes && this.session.stripDrachtioServerDetails(provRes),
});
},
cbRequest: (_error: unknown, req: SrfRequest) => {
logger.debug({ msg: 'OutgoingSipCall.createDialog - request initiated', req });
logger.debug({ msg: 'OutgoingSipCall.createDialog - request initiated', req: this.session.stripDrachtioServerDetails(req) });
if (req) {
this.sipDialogReq = req;
req.on('response', (res, ack) => {
logger.debug({ msg: 'OutgoingSipCall - request got a response', req, res, ack });
logger.debug({
msg: 'OutgoingSipCall - request got a response',
req: this.session.stripDrachtioServerDetails(req),
res: res && this.session.stripDrachtioServerDetails(res),
ack,
});
});
}
},
Expand Down Expand Up @@ -215,7 +223,7 @@ export class OutgoingSipCall extends BaseSipCall {

callerAgent.onRemoteDescriptionChanged(this.call._id, negotiationId);

logger.debug({ msg: 'modify', method: 'OutgoingSipCall.createDialog', req });
logger.debug({ msg: 'modify', method: 'OutgoingSipCall.createDialog', req: this.session.stripDrachtioServerDetails(req) });
} catch (error) {
logger.error({ msg: 'An unexpected error occured while processing a modify event on an OutgoingSipCall dialog', error });

Expand Down Expand Up @@ -253,7 +261,7 @@ export class OutgoingSipCall extends BaseSipCall {
const negotiation = await MediaCallNegotiations.findOneById(localNegotiation.id);
// Negotiation will always exist; This is just a safe guard
if (!negotiation) {
logger.error({ msg: 'Invalid Negotiation reference on OutgoingSipCall.', localNegotiation });
logger.error({ msg: 'Invalid Negotiation reference on OutgoingSipCall.', localNegotiation: localNegotiation.id });
this.inboundRenegotiations.delete(localNegotiation.id);
if (localNegotiation.res) {
localNegotiation.res.send(SipErrorCodes.INTERNAL_SERVER_ERROR);
Expand Down
Loading