Skip to content

Commit

Permalink
[ios]: fix a crash on receiving a message during a call
Browse files Browse the repository at this point in the history
  • Loading branch information
YuliaGrigorieva committed Aug 29, 2023
1 parent 57d1e1f commit 30c2873
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions ios/Classes/VICallModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -426,14 +426,14 @@ - (void)callDidReconnect:(VICall *)call {
- (void)call:(VICall *)call didConnectWithHeaders:(NSDictionary *)headers {
[self sendEvent:@{
@"event" : @"callConnected",
@"headers" : headers
@"headers" : headers ? headers : [NSNull null]
}];
}

- (void)call:(VICall *)call startRingingWithHeaders:(NSDictionary *)headers {
[self sendEvent:@{
@"event" : @"callRinging",
@"headers" : headers
@"headers" : headers ? headers : [NSNull null]
}];
}

Expand All @@ -444,15 +444,14 @@ - (void)call:(VICall *)call didFailWithError:(NSError *)error headers:(NSDiction
@"event" : @"callFailed",
@"code" : @(error.code),
@"description" : error.localizedDescription,
@"headers" : headers
@"headers" : headers ? headers : [NSNull null]
}];
}

- (void)call:(VICall *)call didReceiveMessage:(NSString *)message headers:(NSDictionary *)headers {
[self sendEvent:@{
@"event" : @"messageReceived",
@"message" : message,
@"headers" : headers
}];
}

Expand All @@ -461,7 +460,7 @@ - (void)call:(VICall *)call didReceiveInfo:(NSString *)body type:(NSString *)typ
@"event" : @"sipInfoReceived",
@"type" : type,
@"body" : body,
@"headers" : headers
@"headers" : headers ? headers : [NSNull null]
}];
}

Expand All @@ -470,7 +469,7 @@ - (void)call:(VICall *)call didDisconnectWithHeaders:(NSDictionary *)headers ans
[self.callManager callHasEnded:call.callId];
[self sendEvent:@{
@"event" : @"callDisconnected",
@"headers" : headers,
@"headers" : headers ? headers : [NSNull null],
@"answeredElsewhere" : answeredElsewhere
}];
}
Expand Down

0 comments on commit 30c2873

Please sign in to comment.