Skip to content
Open
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
11 changes: 10 additions & 1 deletion ios/RTCPjSip/PjSipEndpoint.m
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,10 @@ -(PjSipCall *) makeCall:(PjSipAccount *) account destination:(NSString *)destina

PjSipCall *call = [PjSipCall itemConfig:callId];
self.calls[@(callId)] = call;


UIDevice *device = [UIDevice currentDevice];
if(device.proximityMonitoringEnabled == NO) [[UIDevice currentDevice] setProximityMonitoringEnabled:YES];

return call;
}

Expand Down Expand Up @@ -382,6 +385,9 @@ static void onCallReceived(pjsua_acc_id accId, pjsua_call_id callId, pjsip_rx_da
PjSipCall *call = [PjSipCall itemConfig:callId];
endpoint.calls[@(callId)] = call;

UIDevice *device = [UIDevice currentDevice];
if(device.proximityMonitoringEnabled == NO) [[UIDevice currentDevice] setProximityMonitoringEnabled:YES];

[endpoint emmitCallReceived:call];
}

Expand All @@ -402,6 +408,9 @@ static void onCallStateChanged(pjsua_call_id callId, pjsip_event *event) {
if (callInfo.state == PJSIP_INV_STATE_DISCONNECTED) {
[endpoint.calls removeObjectForKey:@(callId)];
[endpoint emmitCallTerminated:call];

UIDevice *device = [UIDevice currentDevice];
if(device.proximityMonitoringEnabled == YES) [[UIDevice currentDevice] setProximityMonitoringEnabled:NO];
} else {
[endpoint emmitCallChanged:call];
}
Expand Down