Skip to content

Commit

Permalink
Merge pull request #786 from wazo-platform/ma_1511_fix_call_id_early_…
Browse files Browse the repository at this point in the history
…media

[MA-1511] Fix getSipSessionId for earlyMedia dialog
  • Loading branch information
manuquentin authored Sep 18, 2024
2 parents cdeda6b + 9e88251 commit 3657ba7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/web-rtc-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import type { InvitationRejectOptions } from 'sip.js/lib/api/invitation-reject-o
import type { InviterCancelOptions } from 'sip.js/lib/api/inviter-cancel-options';
import type { SessionByeOptions } from 'sip.js/lib/api/session-bye-options';
import type { InvitationAcceptOptions } from 'sip.js/lib/api/invitation-accept-options';
import type { SessionDialog } from 'sip.js/lib/core/dialogs/session-dialog';
import type { IncomingRequestMessage } from 'sip.js/lib/core/messages/incoming-request-message';
import type { SessionDescriptionHandlerFactoryOptions } from 'sip.js/lib/platform/web/session-description-handler/session-description-handler-factory-options';
import type { SessionDescriptionHandlerConfiguration } from 'sip.js/lib/platform/web/session-description-handler/session-description-handler-configuration';
Expand All @@ -18,6 +17,7 @@ import { C } from 'sip.js/lib/core/messages/methods/constants';
import { URI } from 'sip.js/lib/grammar/uri';
import { UserAgent } from 'sip.js/lib/api/user-agent';
import { holdModifier, stripVideo } from 'sip.js/lib/platform/web/modifiers/modifiers';
import { SessionDialog } from 'sip.js/lib/core/dialogs/session-dialog';

import { Messager } from 'sip.js/lib/api/messager';
import { RegistererState } from 'sip.js/lib/api/registerer-state';
Expand Down Expand Up @@ -1624,6 +1624,13 @@ export default class WebRTCClient extends Emitter {
return sipSession.incomingInviteRequest.message.callId;
}

// For EarlyMedia
// @ts-ignore: private
if (sipSession instanceof SessionDialog) {
// @ts-ignore: private
return sipSession.dialogState.callId;
}

return '';
}

Expand Down

0 comments on commit 3657ba7

Please sign in to comment.