Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Commit

Permalink
When ringtone.wav present, use that as a ringtone (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob Voorneveld authored and Redmer Loen committed Jan 18, 2017
1 parent e3c29f1 commit f05a3ef
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Example/Podfile.lock
Expand Up @@ -10,7 +10,7 @@ PODS:
- OCMock (3.3.1)
- Reachability (3.2)
- Vialer-pjsip-iOS (1.1.0)
- VialerSIPLib (2.2.0):
- VialerSIPLib (2.3.0):
- CocoaLumberjack
- Reachability
- Vialer-pjsip-iOS
Expand All @@ -30,7 +30,7 @@ SPEC CHECKSUMS:
OCMock: f3f61e6eaa16038c30caa5798c5e49d3307b6f22
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
Vialer-pjsip-iOS: ced3608a20ffdcdf4afdc84a8e381c57525f8f25
VialerSIPLib: 0f5c476dfbd6b0eadb84e07a761c273c7ddd321c
VialerSIPLib: 1e7e022232f57a4e84f3e270aa029505347e5017

PODFILE CHECKSUM: 0f7b04fb045caf39ed7c2486524959b2d2be90e8

Expand Down
5 changes: 5 additions & 0 deletions Pod/Classes/CallKitProviderDelegate.m
Expand Up @@ -52,6 +52,11 @@ - (CXProviderConfiguration *)providerConfiguration {
providerConfiguration.maximumCallsPerCallGroup = 1;
providerConfiguration.supportsVideo = false;

NSString *ringtoneFileName = [[NSBundle mainBundle] pathForResource:@"ringtone" ofType:@"wav"];
if (ringtoneFileName) {
providerConfiguration.ringtoneSound = @"ringtone.wav";
}

providerConfiguration.supportedHandleTypes = [NSSet setWithObject:[NSNumber numberWithInt:CXHandleTypePhoneNumber]];

return providerConfiguration;
Expand Down
12 changes: 5 additions & 7 deletions Pod/Classes/VSLCall.m
Expand Up @@ -225,13 +225,11 @@ - (void)startWithCompletion:(void (^)(NSError * error))completion {
NSError *error;
if (status != PJ_SUCCESS) {
VSLLogError(@"Error creating call");
if (error != NULL) {
error = [NSError VSLUnderlyingError:nil
localizedDescriptionKey:NSLocalizedString(@"Could not setup call", nil)
localizedFailureReasonError:[NSString stringWithFormat:NSLocalizedString(@"PJSIP status code: %d", nil), status]
errorDomain:VSLCallErrorDomain
errorCode:VSLCallErrorCannotCreateCall];
}
error = [NSError VSLUnderlyingError:nil
localizedDescriptionKey:NSLocalizedString(@"Could not setup call", nil)
localizedFailureReasonError:[NSString stringWithFormat:NSLocalizedString(@"PJSIP status code: %d", nil), status]
errorDomain:VSLCallErrorDomain
errorCode:VSLCallErrorCannotCreateCall];
}
completion(error);
}
Expand Down

0 comments on commit f05a3ef

Please sign in to comment.