Skip to content

Commit 0570460

Browse files
Fix wrong call id on hangup busy
1 parent fb8a769 commit 0570460

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

MatrixSDK/VoIP/MXCall.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
#import "MXCallStackCall.h"
2626
#import "MXCallHangupEventContent.h"
27+
#import "MXCallInviteEventContent.h"
2728

2829
NS_ASSUME_NONNULL_BEGIN
2930

@@ -125,6 +126,12 @@ extern NSString *const kMXCallSupportsTransferringStatusDidChange;
125126
*/
126127
- (void)handleCallEvent:(MXEvent *)event;
127128

129+
/**
130+
Update call id from invite content
131+
132+
@param event the call event coming from the event stream.
133+
*/
134+
- (void)updateCallId:(MXCallInviteEventContent*)invite;
128135

129136
#pragma mark - Controls
130137
/**

MatrixSDK/VoIP/MXCall.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#import "MXSDKOptions.h"
2727
#import "MXEnumConstants.h"
2828

29-
#import "MXCallInviteEventContent.h"
3029
#import "MXCallAnswerEventContent.h"
3130
#import "MXCallSelectAnswerEventContent.h"
3231
#import "MXCallCandidatesEventContent.h"
@@ -1102,6 +1101,10 @@ - (void)callStackCallDidConnect:(id<MXCallStackCall>)callStackCall
11021101

11031102
#pragma mark - Event Handlers
11041103

1104+
- (void)updateCallId:(MXCallInviteEventContent*)invite {
1105+
_callId = invite.callId;
1106+
}
1107+
11051108
- (void)handleCallInvite:(MXEvent *)event
11061109
{
11071110
MXLogDebug(@"[MXCall][%@] handleCallInvite", _callId)
@@ -1121,7 +1124,7 @@ - (void)handleCallInvite:(MXEvent *)event
11211124
return;
11221125
}
11231126

1124-
_callId = callInviteEventContent.callId;
1127+
[self updateCallId: callInviteEventContent];
11251128
_callerId = event.sender;
11261129
_callerName = [callManager.mxSession userWithUserId:_callerId].displayname;
11271130
MXRoom *signalingRoom = [callManager.mxSession roomWithRoomId:event.roomId];

MatrixSDK/VoIP/MXCallManager.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,8 @@ - (void)handleCallInvite:(MXEvent *)event
502502

503503
if (_callKitAdapter.maximumActiveCalls != -1 && runningCalls >= _callKitAdapter.maximumActiveCalls) {
504504

505+
MXCallInviteEventContent* callInviteEventContent = [MXCallInviteEventContent modelFromJSON:event.content];
506+
[call updateCallId: callInviteEventContent];
505507
[call hangupWithReason: MXCallHangupReasonUserBusy];
506508

507509
return;

0 commit comments

Comments
 (0)