Other Phone Service, or Telecommuter, allows a developer to create an application which can make and receive calls through any device which can be externally dialed. Such devices can be a user's home, hotel or mobile number. Functionality supported include:
For example, to make an outgoing call Client SDK calls the Other Phone number configured by user. Once the call is answered on the Other Phone, then another call is placed towards the dialed number. Once the call is answered on the dialed endpoint, a media path will be established between the Other Phone and the dialed endpoint.
There are limitations in Other Phone Mode:
Other Phone mode can be activated using Other Phone Service.
The CSOtherPhoneService object is obtained from the Client SDK's CSUser object. Start by obtaining it.
CSOtherPhoneService *otherPhoneService = user.otherPhoneService;
Then define an object that implements the <CSOtherPhoneServiceDelegate> protocol and add this delegate to the CSOtherPhoneService in order to track activation status.
@interface AppOtherPhoneServiceHandler()
...
@end
@implementation AppOtherPhoneServiceHandler
- (void)otherPhoneServiceDidActivate:(CSOtherPhoneService*)otherPhoneService {
NSLog(@"Other Phone mode Activation successful");
}
- (void)otherPhoneServiceDidDeactivate:(CSOtherPhoneService*)otherPhoneService {
NSLog(@"Other Phone mode Dectivation successful");
}
...
@end
You can instantiate a Other Phone service handler (AppOtherPhoneServiceHandler) and add it as a delegate to the CSOtherPhoneService instance.
AppOtherPhoneServiceHandler* otherPhoneServiceHandler =
[[AppOtherPhoneServiceHandler alloc] init];
otherPhoneService.otherPhoneServiceDelegate = otherPhoneServiceHandler;
Once you have obtained the OtherPhoneService instance, you are ready to activate Other Phone Mode. Call the activateOtherPhoneModeWithNumber:completionHandler: method of the CSOtherPhoneService instance providing Other Phone number.
[otherPhoneService activateOtherPhoneModeWithNumber:otherPhoneNumber
completionHandler:^(NSError *error) {
if (error) {
NSLog(@"Other phone mode activation failed: %@", error);
} else {
NSLog(@"Other phone mode activation succeeded.");
}
}
];
After Other Phone Mode activation completes, you can make or answer calls using CSCallService API as usual to originate and answer calls.
To deactivate Other Phone Mode, call the deactivateOtherPhoneModeWithCompletionHandler: method of the CSOtherPhoneService instance.
[otherPhoneService deactivateOtherPhoneModeWithCompletionHandler:
^(NSError *error) {
if (error) {
NSLog(@"Other phone mode deactivation failed: %@", error);
} else {
NSLog(@"Other phone mode deactivation succeeded.");
}
}
];