mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
Merge remote-tracking branch 'public/master' into 3.0.x
This commit is contained in:
commit
f26fc22ffc
138 changed files with 817 additions and 624 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -12,3 +12,6 @@ WORK
|
|||
Makefile
|
||||
OUTPUT
|
||||
git-clang-format.diff
|
||||
submodules/tunnel
|
||||
submodules/binaries/dummy-*.a
|
||||
linphone-iphone.ipa
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -77,7 +77,7 @@
|
|||
<rect key="frame" x="0.0" y="0.0" width="700" height="60"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
<accessibility key="accessibilityConfiguration" label="Enter a address"/>
|
||||
<accessibility key="accessibilityConfiguration" label="Enter an address"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<fontDescription key="fontDescription" name="Helvetica" family="Helvetica" pointSize="36"/>
|
||||
<textInputTraits key="textInputTraits" autocorrectionType="no" keyboardType="emailAddress"/>
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -58,9 +58,10 @@
|
|||
|
||||
// also append transient upload messages because they are not in history yet!
|
||||
for (FileTransferDelegate *ftd in [[LinphoneManager instance] fileTransferDelegates]) {
|
||||
if (linphone_chat_room_get_peer_address(linphone_chat_message_get_chat_room(ftd.message)) ==
|
||||
linphone_chat_room_get_peer_address(chatRoom) &&
|
||||
linphone_chat_message_is_outgoing(ftd.message)) {
|
||||
const LinphoneAddress *ftd_peer =
|
||||
linphone_chat_room_get_peer_address(linphone_chat_message_get_chat_room(ftd.message));
|
||||
const LinphoneAddress *peer = linphone_chat_room_get_peer_address(chatRoom);
|
||||
if (linphone_address_equal(ftd_peer, peer) && linphone_chat_message_is_outgoing(ftd.message)) {
|
||||
LOGI(@"Appending transient upload message %p", ftd.message);
|
||||
self->messageList = ms_list_append(self->messageList, linphone_chat_message_ref(ftd.message));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,8 +50,8 @@
|
|||
|
||||
#pragma mark - ViewController Functions
|
||||
|
||||
- (void)viewDidAppear:(BOOL)animated {
|
||||
[super viewDidAppear:animated];
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
[super viewWillAppear:animated];
|
||||
self.tableView.accessibilityIdentifier = @"ChatRoom list";
|
||||
[self loadData];
|
||||
}
|
||||
|
|
@ -75,8 +75,8 @@ static int sorted_history_comparison(LinphoneChatRoom *to_insert, LinphoneChatRo
|
|||
|
||||
- (MSList *)sortChatRooms {
|
||||
MSList *sorted = nil;
|
||||
MSList *unsorted = linphone_core_get_chat_rooms([LinphoneManager getLc]);
|
||||
MSList *iter = unsorted;
|
||||
const MSList *unsorted = linphone_core_get_chat_rooms([LinphoneManager getLc]);
|
||||
const MSList *iter = unsorted;
|
||||
|
||||
while (iter) {
|
||||
// store last message in user data
|
||||
|
|
@ -174,8 +174,7 @@ static void chatTable_free_chatrooms(void *data) {
|
|||
[ftd cancel];
|
||||
}
|
||||
}
|
||||
linphone_chat_room_delete_history(chatRoom);
|
||||
linphone_chat_room_unref(chatRoom);
|
||||
linphone_core_delete_chat_room(linphone_chat_room_get_lc(chatRoom), chatRoom);
|
||||
data = ms_list_remove(data, chatRoom);
|
||||
|
||||
// will force a call to [self loadData]
|
||||
|
|
|
|||
|
|
@ -79,14 +79,12 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
- (void)startChatRoom {
|
||||
// Push ChatRoom
|
||||
LinphoneChatRoom *room =
|
||||
linphone_core_get_or_create_chat_room([LinphoneManager getLc], [addressField.text UTF8String]);
|
||||
linphone_core_get_chat_room_from_uri([LinphoneManager getLc], [addressField.text UTF8String]);
|
||||
if (room != nil) {
|
||||
ChatRoomViewController *controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance] changeCurrentView:[ChatRoomViewController compositeViewDescription] push:TRUE],
|
||||
ChatRoomViewController);
|
||||
if (controller != nil) {
|
||||
LinphoneChatRoom *room =
|
||||
linphone_core_get_or_create_chat_room([LinphoneManager getLc], [addressField.text UTF8String]);
|
||||
[controller setChatRoom:room];
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -627,7 +627,7 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe
|
|||
ChatRoomViewController);
|
||||
if (controller != nil) {
|
||||
LinphoneChatRoom *room =
|
||||
linphone_core_get_or_create_chat_room([LinphoneManager getLc], [dest UTF8String]);
|
||||
linphone_core_get_chat_room_from_uri([LinphoneManager getLc], [dest UTF8String]);
|
||||
[controller setChatRoom:room];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -232,11 +232,8 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
}
|
||||
|
||||
- (IBAction)onChatClick:(id)event {
|
||||
LinphoneAddress *addr;
|
||||
addr = linphone_call_log_get_remote_address(callLog);
|
||||
|
||||
char *lAddress = linphone_address_as_string_uri_only(addr);
|
||||
if (lAddress == NULL)
|
||||
const LinphoneAddress *addr = linphone_call_log_get_remote_address(callLog);
|
||||
if (addr == NULL)
|
||||
return;
|
||||
// Go to ChatRoom view
|
||||
[[PhoneMainView instance] changeCurrentView:[ChatViewController compositeViewDescription]];
|
||||
|
|
@ -244,10 +241,9 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
[[PhoneMainView instance] changeCurrentView:[ChatRoomViewController compositeViewDescription] push:TRUE],
|
||||
ChatRoomViewController);
|
||||
if (controller != nil) {
|
||||
LinphoneChatRoom *room = linphone_core_get_or_create_chat_room([LinphoneManager getLc], lAddress);
|
||||
LinphoneChatRoom *room = linphone_core_get_chat_room([LinphoneManager getLc], addr);
|
||||
[controller setChatRoom:room];
|
||||
}
|
||||
ms_free(lAddress);
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -179,9 +179,8 @@
|
|||
}
|
||||
} else {
|
||||
if (!instance.isTesting) {
|
||||
NSUInteger notifTypes = UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound |
|
||||
UIRemoteNotificationTypeBadge |
|
||||
UIRemoteNotificationTypeNewsstandContentAvailability;
|
||||
NSUInteger notifTypes =
|
||||
UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeBadge;
|
||||
[app registerForRemoteNotificationTypes:notifTypes];
|
||||
}
|
||||
}
|
||||
|
|
@ -318,7 +317,7 @@
|
|||
}
|
||||
|
||||
- (LinphoneChatRoom *)findChatRoomForContact:(NSString *)contact {
|
||||
MSList *rooms = linphone_core_get_chat_rooms([LinphoneManager getLc]);
|
||||
const MSList *rooms = linphone_core_get_chat_rooms([LinphoneManager getLc]);
|
||||
const char *from = [contact UTF8String];
|
||||
while (rooms) {
|
||||
const LinphoneAddress *room_from_address = linphone_chat_room_get_peer_address((LinphoneChatRoom *)rooms->data);
|
||||
|
|
@ -446,7 +445,7 @@
|
|||
[self application:application didReceiveLocalNotification:notification];
|
||||
} else if ([identifier isEqualToString:@"mark_read"]) {
|
||||
NSString *from = [notification.userInfo objectForKey:@"from_addr"];
|
||||
LinphoneChatRoom *room = linphone_core_get_or_create_chat_room(lc, [from UTF8String]);
|
||||
LinphoneChatRoom *room = linphone_core_get_chat_room_from_uri(lc, [from UTF8String]);
|
||||
if (room) {
|
||||
linphone_chat_room_mark_as_read(room);
|
||||
[[PhoneMainView instance] updateApplicationBadgeNumber];
|
||||
|
|
|
|||
|
|
@ -191,6 +191,8 @@ typedef struct _LinphoneManagerSounds {
|
|||
|
||||
- (void)silentPushFailed:(NSTimer*)timer;
|
||||
|
||||
- (void)removeAllAccounts;
|
||||
|
||||
@property (readonly) BOOL isTesting;
|
||||
@property (readonly, strong) FastAddressBook* fastAddressBook;
|
||||
@property Connectivity connectivity;
|
||||
|
|
|
|||
|
|
@ -1382,28 +1382,14 @@ static BOOL libStarted = FALSE;
|
|||
connectivity = none;
|
||||
|
||||
ms_init(); // Need to initialize mediastreamer2 before loading the plugins
|
||||
|
||||
// Load plugins if available in the linphone SDK - otherwise these calls will do nothing
|
||||
libmsilbc_init();
|
||||
#if defined(HAVE_SILK)
|
||||
libmssilk_init();
|
||||
#endif
|
||||
#ifdef HAVE_AMR
|
||||
libmsamr_init(); // load amr plugin if present from the liblinphone sdk
|
||||
#endif
|
||||
#ifdef HAVE_X264
|
||||
libmsx264_init(); // load x264 plugin if present from the liblinphone sdk
|
||||
#endif
|
||||
#ifdef HAVE_OPENH264
|
||||
libmsopenh264_init(); // load openh264 plugin if present from the liblinphone sdk
|
||||
#endif
|
||||
|
||||
#if HAVE_G729
|
||||
libmsbcg729_init(); // load g729 plugin
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_WEBRTC
|
||||
libmsamr_init();
|
||||
libmsx264_init();
|
||||
libmsopenh264_init();
|
||||
libmsbcg729_init();
|
||||
libmswebrtc_init();
|
||||
#endif
|
||||
|
||||
// Set audio assets
|
||||
const char *lRing =
|
||||
|
|
@ -1840,6 +1826,7 @@ static void audioRouteChangeListenerCallback(void *inUserData, // 1
|
|||
}
|
||||
|
||||
- (void)call:(NSString *)address displayName:(NSString *)displayName transfer:(BOOL)transfer {
|
||||
// First verify that network is available, abort otherwise.
|
||||
if (!linphone_core_is_network_reachable(theLinphoneCore)) {
|
||||
UIAlertView *error = [[UIAlertView alloc]
|
||||
initWithTitle:NSLocalizedString(@"Network Error", nil)
|
||||
|
|
@ -1848,96 +1835,92 @@ static void audioRouteChangeListenerCallback(void *inUserData, // 1
|
|||
@"There is no network connection available, enable WIFI or WWAN prior to place a call",
|
||||
nil)
|
||||
delegate:nil
|
||||
cancelButtonTitle:NSLocalizedString(@"Continue", nil)
|
||||
cancelButtonTitle:NSLocalizedString(@"Cancel", nil)
|
||||
otherButtonTitles:nil];
|
||||
[error show];
|
||||
return;
|
||||
}
|
||||
|
||||
// Then check that no GSM calls are in progress, abort otherwise.
|
||||
CTCallCenter *callCenter = [[CTCallCenter alloc] init];
|
||||
if ([callCenter currentCalls] != nil) {
|
||||
LOGE(@"GSM call in progress, cancelling outgoing SIP call request");
|
||||
UIAlertView *error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Cannot make call", nil)
|
||||
message:NSLocalizedString(@"Please terminate GSM call", nil)
|
||||
delegate:nil
|
||||
cancelButtonTitle:NSLocalizedString(@"Continue", nil)
|
||||
otherButtonTitles:nil];
|
||||
UIAlertView *error =
|
||||
[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Cannot make call", nil)
|
||||
message:NSLocalizedString(@"Please terminate GSM call first.", nil)
|
||||
delegate:nil
|
||||
cancelButtonTitle:NSLocalizedString(@"Cancel", nil)
|
||||
otherButtonTitles:nil];
|
||||
[error show];
|
||||
return;
|
||||
}
|
||||
|
||||
LinphoneProxyConfig *proxyCfg;
|
||||
// get default proxy
|
||||
linphone_core_get_default_proxy(theLinphoneCore, &proxyCfg);
|
||||
LinphoneCallParams *lcallParams = linphone_core_create_default_call_parameters(theLinphoneCore);
|
||||
if ([self lpConfigBoolForKey:@"edge_opt_preference"]) {
|
||||
bool low_bandwidth = self.network == network_2g;
|
||||
if (low_bandwidth) {
|
||||
LOGI(@"Low bandwidth mode");
|
||||
}
|
||||
linphone_call_params_enable_low_bandwidth(lcallParams, low_bandwidth);
|
||||
}
|
||||
LinphoneCall *call = NULL;
|
||||
|
||||
BOOL addressIsASCII = [address canBeConvertedToEncoding:[NSString defaultCStringEncoding]];
|
||||
|
||||
if ([address length] == 0)
|
||||
return; // just return
|
||||
if (!addressIsASCII) {
|
||||
UIAlertView *error =
|
||||
[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Invalid SIP address", nil)
|
||||
message:NSLocalizedString(@"The address should only contain ASCII data", nil)
|
||||
delegate:nil
|
||||
cancelButtonTitle:NSLocalizedString(@"Continue", nil)
|
||||
otherButtonTitles:nil];
|
||||
LinphoneAddress *addr = NULL;
|
||||
// Continue by checking that the provided address is a valid SIP address, abort otherwise.
|
||||
if ([address length] == 0) {
|
||||
// no address provided... nothing to do
|
||||
} else if (![address canBeConvertedToEncoding:[NSString defaultCStringEncoding]]) {
|
||||
UIAlertView *error = [[UIAlertView alloc]
|
||||
initWithTitle:NSLocalizedString(@"Invalid SIP address", nil)
|
||||
message:NSLocalizedString(
|
||||
@"Some invalid characters where found in the given SIP address. Please correct it.",
|
||||
nil)
|
||||
delegate:nil
|
||||
cancelButtonTitle:NSLocalizedString(@"Cancel", nil)
|
||||
otherButtonTitles:nil];
|
||||
[error show];
|
||||
}
|
||||
LinphoneAddress *linphoneAddress =
|
||||
linphone_core_interpret_url(theLinphoneCore, [address cStringUsingEncoding:[NSString defaultCStringEncoding]]);
|
||||
|
||||
if (linphoneAddress) {
|
||||
|
||||
if (displayName != nil) {
|
||||
linphone_address_set_display_name(linphoneAddress,
|
||||
[displayName cStringUsingEncoding:[NSString defaultCStringEncoding]]);
|
||||
}
|
||||
if ([[LinphoneManager instance] lpConfigBoolForKey:@"override_domain_with_default_one"])
|
||||
linphone_address_set_domain(
|
||||
linphoneAddress, [[[LinphoneManager instance] lpConfigStringForKey:@"domain" forSection:@"wizard"]
|
||||
cStringUsingEncoding:[NSString defaultCStringEncoding]]);
|
||||
if (transfer) {
|
||||
linphone_core_transfer_call(theLinphoneCore, linphone_core_get_current_call(theLinphoneCore),
|
||||
[address cStringUsingEncoding:[NSString defaultCStringEncoding]]);
|
||||
} else {
|
||||
call = linphone_core_invite_address_with_params(theLinphoneCore, linphoneAddress, lcallParams);
|
||||
}
|
||||
linphone_address_destroy(linphoneAddress);
|
||||
|
||||
} else {
|
||||
|
||||
} else if ((addr = linphone_core_interpret_url(
|
||||
theLinphoneCore, [address cStringUsingEncoding:[NSString defaultCStringEncoding]])) == NULL) {
|
||||
UIAlertView *error = [[UIAlertView alloc]
|
||||
initWithTitle:NSLocalizedString(@"Invalid SIP address", nil)
|
||||
message:NSLocalizedString(@"Either configure a SIP proxy server from settings prior to place a "
|
||||
@"call or use a valid SIP address (I.E sip:john@example.net)",
|
||||
nil)
|
||||
delegate:nil
|
||||
cancelButtonTitle:NSLocalizedString(@"Continue", nil)
|
||||
cancelButtonTitle:NSLocalizedString(@"Cancel", nil)
|
||||
otherButtonTitles:nil];
|
||||
[error show];
|
||||
}
|
||||
} else {
|
||||
// Finally we can make the call
|
||||
LinphoneProxyConfig *proxyCfg;
|
||||
linphone_core_get_default_proxy(theLinphoneCore, &proxyCfg);
|
||||
LinphoneCallParams *lcallParams = linphone_core_create_default_call_parameters(theLinphoneCore);
|
||||
if ([self lpConfigBoolForKey:@"edge_opt_preference"] && (self.network == network_2g)) {
|
||||
LOGI(@"Enabling low bandwidth mode");
|
||||
linphone_call_params_enable_low_bandwidth(lcallParams, YES);
|
||||
}
|
||||
if (displayName != nil) {
|
||||
linphone_address_set_display_name(addr,
|
||||
[displayName cStringUsingEncoding:[NSString defaultCStringEncoding]]);
|
||||
}
|
||||
if ([[LinphoneManager instance] lpConfigBoolForKey:@"override_domain_with_default_one"]) {
|
||||
linphone_address_set_domain(
|
||||
addr, [[[LinphoneManager instance] lpConfigStringForKey:@"domain" forSection:@"wizard"]
|
||||
cStringUsingEncoding:[NSString defaultCStringEncoding]]);
|
||||
}
|
||||
|
||||
if (call) {
|
||||
// The LinphoneCallAppData object should be set on call creation with callback
|
||||
// - (void)onCall:StateChanged:withMessage:. If not, we are in big trouble and expect it to crash
|
||||
// We are NOT responsible for creating the AppData.
|
||||
LinphoneCallAppData *data = (__bridge LinphoneCallAppData *)linphone_call_get_user_data(call);
|
||||
if (data == nil)
|
||||
LOGE(@"New call instanciated but app data was not set. Expect it to crash.");
|
||||
/* will be used later to notify user if video was not activated because of the linphone core*/
|
||||
else
|
||||
data->videoRequested = linphone_call_params_video_enabled(lcallParams);
|
||||
if (transfer) {
|
||||
char *caddr = linphone_address_as_string(addr);
|
||||
linphone_core_transfer_call(theLinphoneCore, linphone_core_get_current_call(theLinphoneCore), caddr);
|
||||
ms_free(caddr);
|
||||
} else {
|
||||
LinphoneCall *call = linphone_core_invite_address_with_params(theLinphoneCore, addr, lcallParams);
|
||||
if (call) {
|
||||
// The LinphoneCallAppData object should be set on call creation with callback
|
||||
// - (void)onCall:StateChanged:withMessage:. If not, we are in big trouble and expect it to crash
|
||||
// We are NOT responsible for creating the AppData.
|
||||
LinphoneCallAppData *data = (__bridge LinphoneCallAppData *)linphone_call_get_user_data(call);
|
||||
if (data == nil) {
|
||||
LOGE(@"New call instanciated but app data was not set. Expect it to crash.");
|
||||
/* will be used later to notify user if video was not activated because of the linphone core*/
|
||||
} else {
|
||||
data->videoRequested = linphone_call_params_video_enabled(lcallParams);
|
||||
}
|
||||
}
|
||||
}
|
||||
linphone_address_destroy(addr);
|
||||
linphone_call_params_destroy(lcallParams);
|
||||
}
|
||||
linphone_call_params_destroy(lcallParams);
|
||||
}
|
||||
|
||||
#pragma mark - Property Functions
|
||||
|
|
@ -2020,8 +2003,8 @@ static void audioRouteChangeListenerCallback(void *inUserData, // 1
|
|||
|
||||
+ (int)unreadMessageCount {
|
||||
int count = 0;
|
||||
MSList *rooms = linphone_core_get_chat_rooms([LinphoneManager getLc]);
|
||||
MSList *item = rooms;
|
||||
const MSList *rooms = linphone_core_get_chat_rooms([LinphoneManager getLc]);
|
||||
const MSList *item = rooms;
|
||||
while (item) {
|
||||
LinphoneChatRoom *room = (LinphoneChatRoom *)item->data;
|
||||
if (room) {
|
||||
|
|
@ -2286,4 +2269,10 @@ static void audioRouteChangeListenerCallback(void *inUserData, // 1
|
|||
// Query our in-app server to retrieve InApp purchases
|
||||
[_iapManager retrievePurchases];
|
||||
}
|
||||
|
||||
- (void)removeAllAccounts {
|
||||
linphone_core_clear_proxy_config([LinphoneManager getLc]);
|
||||
linphone_core_clear_all_auth_info([LinphoneManager getLc]);
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -65,8 +65,7 @@ static UIFont *CELL_FONT = nil;
|
|||
|
||||
resendTapGestureRecognizer =
|
||||
[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onResendClick:)];
|
||||
[dateLabel addGestureRecognizer:resendTapGestureRecognizer];
|
||||
[statusImage addGestureRecognizer:resendTapGestureRecognizer];
|
||||
[innerView addGestureRecognizer:resendTapGestureRecognizer];
|
||||
|
||||
[self addSubview:innerView];
|
||||
[deleteButton setAlpha:0.0f];
|
||||
|
|
|
|||
|
|
@ -203,6 +203,7 @@
|
|||
break;
|
||||
}
|
||||
[registrationState setTitle:message forState:UIControlStateNormal];
|
||||
registrationState.accessibilityValue = message;
|
||||
[registrationState setImage:image forState:UIControlStateNormal];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -99,15 +99,14 @@
|
|||
|
||||
- (bool)onUpdate {
|
||||
bool video_enabled = false;
|
||||
|
||||
#ifdef VIDEO_ENABLED
|
||||
LinphoneCall *currentCall = linphone_core_get_current_call([LinphoneManager getLc]);
|
||||
if (linphone_core_video_enabled([LinphoneManager getLc]) && currentCall &&
|
||||
!linphone_call_media_in_progress(currentCall) &&
|
||||
linphone_call_get_state(currentCall) == LinphoneCallStreamsRunning) {
|
||||
video_enabled = TRUE;
|
||||
LinphoneCore *lc = [LinphoneManager getLc];
|
||||
LinphoneCall *currentCall = linphone_core_get_current_call(lc);
|
||||
if (linphone_core_video_supported(lc)) {
|
||||
if (linphone_core_video_enabled(lc) && currentCall && !linphone_call_media_in_progress(currentCall) &&
|
||||
linphone_call_get_state(currentCall) == LinphoneCallStreamsRunning) {
|
||||
video_enabled = TRUE;
|
||||
}
|
||||
}
|
||||
#endif // VIDEO_ENABLED
|
||||
|
||||
[self setEnabled:video_enabled];
|
||||
if (last_update_state != video_enabled)
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -77,24 +77,36 @@ static RootViewManager *rootViewManagerInstance = nil;
|
|||
currentViewController = newMainView;
|
||||
LinphoneAppDelegate *delegate = (LinphoneAppDelegate *)[UIApplication sharedApplication].delegate;
|
||||
|
||||
[UIView transitionWithView:delegate.window
|
||||
duration:0.3
|
||||
options:UIViewAnimationOptionTransitionFlipFromLeft | UIViewAnimationOptionAllowAnimatedContent
|
||||
animations:^{
|
||||
delegate.window.rootViewController = newMainView;
|
||||
// when going to landscape-enabled view, we have to get the current portrait frame and orientation,
|
||||
// because it could still have landscape-based size
|
||||
if (nextViewOrientation != previousOrientation && newMainView == self.rotatingViewController) {
|
||||
newMainView.view.frame = previousMainView.view.frame;
|
||||
[newMainView.mainViewController.view setFrame:previousMainView.mainViewController.view.frame];
|
||||
[newMainView willRotateToInterfaceOrientation:previousOrientation duration:0.3];
|
||||
[newMainView willAnimateRotationToInterfaceOrientation:previousOrientation duration:0.3];
|
||||
[newMainView didRotateFromInterfaceOrientation:nextViewOrientation];
|
||||
}
|
||||
|
||||
if ([[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"] == true) {
|
||||
[UIView transitionWithView:delegate.window
|
||||
duration:0.3
|
||||
options:UIViewAnimationOptionTransitionFlipFromLeft | UIViewAnimationOptionAllowAnimatedContent
|
||||
animations:^{
|
||||
delegate.window.rootViewController = newMainView;
|
||||
// when going to landscape-enabled view, we have to get the current portrait frame and orientation,
|
||||
// because it could still have landscape-based size
|
||||
if (nextViewOrientation != previousOrientation && newMainView == self.rotatingViewController) {
|
||||
newMainView.view.frame = previousMainView.view.frame;
|
||||
[newMainView.mainViewController.view setFrame:previousMainView.mainViewController.view.frame];
|
||||
[newMainView willRotateToInterfaceOrientation:previousOrientation duration:0.3];
|
||||
[newMainView willAnimateRotationToInterfaceOrientation:previousOrientation duration:0.3];
|
||||
[newMainView didRotateFromInterfaceOrientation:nextViewOrientation];
|
||||
}
|
||||
}
|
||||
completion:^(BOOL finished){
|
||||
}];
|
||||
} else {
|
||||
delegate.window.rootViewController = newMainView;
|
||||
// when going to landscape-enabled view, we have to get the current portrait frame and orientation,
|
||||
// because it could still have landscape-based size
|
||||
if (nextViewOrientation != previousOrientation && newMainView == self.rotatingViewController) {
|
||||
newMainView.view.frame = previousMainView.view.frame;
|
||||
[newMainView.mainViewController.view setFrame:previousMainView.mainViewController.view.frame];
|
||||
[newMainView willRotateToInterfaceOrientation:previousOrientation duration:0.];
|
||||
[newMainView willAnimateRotationToInterfaceOrientation:previousOrientation duration:0.];
|
||||
[newMainView didRotateFromInterfaceOrientation:nextViewOrientation];
|
||||
}
|
||||
completion:^(BOOL finished){
|
||||
}];
|
||||
}
|
||||
}
|
||||
return currentViewController;
|
||||
}
|
||||
|
|
@ -630,21 +642,28 @@ static RootViewManager *rootViewManagerInstance = nil;
|
|||
@"SIP account configuration in the settings.",
|
||||
nil);
|
||||
} else {
|
||||
lMessage = [NSString stringWithFormat:NSLocalizedString(@"Cannot call %@", nil), lUserName];
|
||||
lMessage = [NSString stringWithFormat:NSLocalizedString(@"Cannot call %@.", nil), lUserName];
|
||||
}
|
||||
|
||||
if (linphone_call_get_reason(call) == LinphoneReasonNotFound) {
|
||||
lMessage = [NSString stringWithFormat:NSLocalizedString(@"%@ not registered", nil), lUserName];
|
||||
} else {
|
||||
if (message != nil) {
|
||||
lMessage = [NSString stringWithFormat:NSLocalizedString(@"%@\nReason was: %@", nil), lMessage, message];
|
||||
}
|
||||
switch (linphone_call_get_reason(call)) {
|
||||
case LinphoneReasonNotFound:
|
||||
lMessage = [NSString stringWithFormat:NSLocalizedString(@"%@ is not registered.", nil), lUserName];
|
||||
break;
|
||||
case LinphoneReasonBusy:
|
||||
lMessage = [NSString stringWithFormat:NSLocalizedString(@"%@ is busy.", nil), lUserName];
|
||||
break;
|
||||
default:
|
||||
if (message != nil) {
|
||||
lMessage = [NSString stringWithFormat:NSLocalizedString(@"%@\nReason was: %@", nil), lMessage, message];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
lTitle = NSLocalizedString(@"Call failed", nil);
|
||||
UIAlertView *error = [[UIAlertView alloc] initWithTitle:lTitle
|
||||
message:lMessage
|
||||
delegate:nil
|
||||
cancelButtonTitle:NSLocalizedString(@"Dismiss", nil)
|
||||
cancelButtonTitle:NSLocalizedString(@"Cancel", nil)
|
||||
otherButtonTitles:nil];
|
||||
[error show];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -343,7 +343,7 @@
|
|||
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated {
|
||||
[UINavigationControllerEx removeBackground:viewController.view];
|
||||
|
||||
[viewController viewWillAppear:animated]; // Force view
|
||||
[viewController view]; // Force view
|
||||
UILabel *labelTitleView = [[UILabel alloc] init];
|
||||
labelTitleView.backgroundColor = [UIColor clearColor];
|
||||
labelTitleView.textColor = [UIColor colorWithRed:0x41 / 255.0f green:0x48 / 255.0f blue:0x4f / 255.0f alpha:1.0];
|
||||
|
|
@ -498,74 +498,47 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
#pragma mark -
|
||||
|
||||
+ (IASKSpecifier *)disableCodecSpecifier:(IASKSpecifier *)specifier {
|
||||
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:[specifier specifierDict]];
|
||||
|
||||
NSMutableString *type = [NSMutableString stringWithString:[dict objectForKey:kIASKType]];
|
||||
[type setString:kIASKPSTitleValueSpecifier];
|
||||
[dict setObject:type forKey:kIASKType];
|
||||
|
||||
NSMutableArray *values =
|
||||
[NSMutableArray arrayWithObjects:[NSNumber numberWithInt:0], [NSNumber numberWithInt:1], nil];
|
||||
[dict setObject:values forKey:kIASKValues];
|
||||
|
||||
NSString *title = NSLocalizedString(@"Disabled, build from sources to enable", nil);
|
||||
NSMutableArray *titles = [NSMutableArray arrayWithObjects:title, title, nil];
|
||||
[dict setObject:titles forKey:kIASKTitles];
|
||||
|
||||
return [[IASKSpecifier alloc] initWithSpecifier:dict];
|
||||
}
|
||||
|
||||
+ (IASKSpecifier *)filterSpecifier:(IASKSpecifier *)specifier {
|
||||
#ifndef HAVE_SSL
|
||||
if ([[specifier key] isEqualToString:@"transport_preference"]) {
|
||||
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:[specifier specifierDict]];
|
||||
NSMutableArray *titles = [NSMutableArray arrayWithArray:[dict objectForKey:@"Titles"]];
|
||||
[titles removeObject:@"TLS"];
|
||||
[dict setObject:titles forKey:@"Titles"];
|
||||
NSMutableArray *values = [NSMutableArray arrayWithArray:[dict objectForKey:@"Values"]];
|
||||
[values removeObject:@"tls"];
|
||||
[dict setObject:values forKey:@"Values"];
|
||||
return [[IASKSpecifier alloc] initWithSpecifier:dict];
|
||||
}
|
||||
#else
|
||||
if ([[specifier key] isEqualToString:@"media_encryption_preference"]) {
|
||||
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:[specifier specifierDict]];
|
||||
if (!linphone_core_media_encryption_supported([LinphoneManager getLc], LinphoneMediaEncryptionZRTP)) {
|
||||
if (!linphone_core_sip_transport_supported([LinphoneManager getLc], LinphoneTransportTls)) {
|
||||
if ([[specifier key] isEqualToString:@"transport_preference"]) {
|
||||
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:[specifier specifierDict]];
|
||||
NSMutableArray *titles = [NSMutableArray arrayWithArray:[dict objectForKey:@"Titles"]];
|
||||
[titles removeObject:@"ZRTP"];
|
||||
[titles removeObject:@"TLS"];
|
||||
[dict setObject:titles forKey:@"Titles"];
|
||||
NSMutableArray *values = [NSMutableArray arrayWithArray:[dict objectForKey:@"Values"]];
|
||||
[values removeObject:@"ZRTP"];
|
||||
[values removeObject:@"tls"];
|
||||
[dict setObject:values forKey:@"Values"];
|
||||
return [[IASKSpecifier alloc] initWithSpecifier:dict];
|
||||
}
|
||||
if (!linphone_core_media_encryption_supported([LinphoneManager getLc], LinphoneMediaEncryptionSRTP)) {
|
||||
NSMutableArray *titles = [NSMutableArray arrayWithArray:[dict objectForKey:@"Titles"]];
|
||||
[titles removeObject:@"SRTP"];
|
||||
[dict setObject:titles forKey:@"Titles"];
|
||||
NSMutableArray *values = [NSMutableArray arrayWithArray:[dict objectForKey:@"Values"]];
|
||||
[values removeObject:@"SRTP"];
|
||||
[dict setObject:values forKey:@"Values"];
|
||||
} else {
|
||||
if ([[specifier key] isEqualToString:@"media_encryption_preference"]) {
|
||||
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:[specifier specifierDict]];
|
||||
if (!linphone_core_media_encryption_supported([LinphoneManager getLc], LinphoneMediaEncryptionZRTP)) {
|
||||
NSMutableArray *titles = [NSMutableArray arrayWithArray:[dict objectForKey:@"Titles"]];
|
||||
[titles removeObject:@"ZRTP"];
|
||||
[dict setObject:titles forKey:@"Titles"];
|
||||
NSMutableArray *values = [NSMutableArray arrayWithArray:[dict objectForKey:@"Values"]];
|
||||
[values removeObject:@"ZRTP"];
|
||||
[dict setObject:values forKey:@"Values"];
|
||||
}
|
||||
if (!linphone_core_media_encryption_supported([LinphoneManager getLc], LinphoneMediaEncryptionSRTP)) {
|
||||
NSMutableArray *titles = [NSMutableArray arrayWithArray:[dict objectForKey:@"Titles"]];
|
||||
[titles removeObject:@"SRTP"];
|
||||
[dict setObject:titles forKey:@"Titles"];
|
||||
NSMutableArray *values = [NSMutableArray arrayWithArray:[dict objectForKey:@"Values"]];
|
||||
[values removeObject:@"SRTP"];
|
||||
[dict setObject:values forKey:@"Values"];
|
||||
}
|
||||
if (!linphone_core_media_encryption_supported([LinphoneManager getLc], LinphoneMediaEncryptionDTLS)) {
|
||||
NSMutableArray *titles = [NSMutableArray arrayWithArray:[dict objectForKey:@"Titles"]];
|
||||
[titles removeObject:@"DTLS"];
|
||||
[dict setObject:titles forKey:@"Titles"];
|
||||
NSMutableArray *values = [NSMutableArray arrayWithArray:[dict objectForKey:@"Values"]];
|
||||
[values removeObject:@"DTLS"];
|
||||
[dict setObject:values forKey:@"Values"];
|
||||
}
|
||||
return [[IASKSpecifier alloc] initWithSpecifier:dict];
|
||||
}
|
||||
if (!linphone_core_media_encryption_supported([LinphoneManager getLc], LinphoneMediaEncryptionDTLS)) {
|
||||
NSMutableArray *titles = [NSMutableArray arrayWithArray:[dict objectForKey:@"Titles"]];
|
||||
[titles removeObject:@"DTLS"];
|
||||
[dict setObject:titles forKey:@"Titles"];
|
||||
NSMutableArray *values = [NSMutableArray arrayWithArray:[dict objectForKey:@"Values"]];
|
||||
[values removeObject:@"DTLS"];
|
||||
[dict setObject:values forKey:@"Values"];
|
||||
}
|
||||
return [[IASKSpecifier alloc] initWithSpecifier:dict];
|
||||
}
|
||||
|
||||
#endif // HAVE_SSL
|
||||
|
||||
// Add "build from source" if MPEG4 or H264 disabled
|
||||
if ([[specifier key] isEqualToString:@"h264_preference"] && ![LinphoneManager isCodecSupported:"h264"]) {
|
||||
return [SettingsViewController disableCodecSpecifier:specifier];
|
||||
}
|
||||
if ([[specifier key] isEqualToString:@"mp4v-es_preference"] && ![LinphoneManager isCodecSupported:"mp4v-es"]) {
|
||||
return [SettingsViewController disableCodecSpecifier:specifier];
|
||||
}
|
||||
|
||||
return specifier;
|
||||
|
|
@ -575,9 +548,9 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
LinphoneManager *lm = [LinphoneManager instance];
|
||||
NSMutableSet *hiddenKeys = [NSMutableSet set];
|
||||
|
||||
#ifndef HAVE_SSL
|
||||
[hiddenKeys addObject:@"media_encryption_preference"];
|
||||
#endif
|
||||
if (!linphone_core_sip_transport_supported([LinphoneManager getLc], LinphoneTransportTls)) {
|
||||
[hiddenKeys addObject:@"media_encryption_preference"];
|
||||
}
|
||||
|
||||
#ifndef DEBUG
|
||||
[hiddenKeys addObject:@"release_button"];
|
||||
|
|
@ -606,6 +579,13 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
if (!linphone_core_video_supported([LinphoneManager getLc]))
|
||||
[hiddenKeys addObject:@"video_menu"];
|
||||
|
||||
if (![LinphoneManager isCodecSupported:"h264"]) {
|
||||
[hiddenKeys addObject:@"h264_preference"];
|
||||
}
|
||||
if (![LinphoneManager isCodecSupported:"mp4v-es"]) {
|
||||
[hiddenKeys addObject:@"mp4v-es_preference"];
|
||||
}
|
||||
|
||||
if (![LinphoneManager isNotIphone3G])
|
||||
[hiddenKeys addObject:@"silk_24k_preference"];
|
||||
|
||||
|
|
@ -621,9 +601,9 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
[hiddenKeys addObject:@"enable_first_login_view_preference"];
|
||||
|
||||
#ifndef VIDEO_ENABLED
|
||||
[hiddenKeys addObject:@"enable_video_preference"];
|
||||
#endif // VIDEO_ENABLED
|
||||
if (!linphone_core_video_supported([LinphoneManager getLc])) {
|
||||
[hiddenKeys addObject:@"enable_video_preference"];
|
||||
}
|
||||
|
||||
if (!linphone_core_video_enabled([LinphoneManager getLc])) {
|
||||
[hiddenKeys addObject:@"video_menu"];
|
||||
|
|
|
|||
|
|
@ -137,19 +137,20 @@ static LinphoneBuffer *linphone_iphone_file_transfer_send(LinphoneChatMessage *m
|
|||
}
|
||||
|
||||
- (void)upload:(UIImage *)image withURL:(NSURL *)url forChatRoom:(LinphoneChatRoom *)chatRoom {
|
||||
[[[LinphoneManager instance] fileTransferDelegates] addObject:self];
|
||||
[LinphoneManager.instance.fileTransferDelegates addObject:self];
|
||||
|
||||
LinphoneContent *content = linphone_core_create_content(linphone_chat_room_get_lc(chatRoom));
|
||||
_data = [NSMutableData dataWithData:UIImageJPEGRepresentation(image, 1.0)];
|
||||
linphone_content_set_type(content, "image");
|
||||
linphone_content_set_subtype(content, "jpeg");
|
||||
linphone_content_set_name(content,
|
||||
[[NSString stringWithFormat:@"%li-%f.jpg", (long)[image hash],
|
||||
[[NSString stringWithFormat:@"%li-%f.jpg", (long)image.hash,
|
||||
[NSDate timeIntervalSinceReferenceDate]] UTF8String]);
|
||||
linphone_content_set_size(content, [_data length]);
|
||||
linphone_content_set_size(content, _data.length);
|
||||
|
||||
_message = linphone_chat_room_create_file_transfer_message(chatRoom, content);
|
||||
linphone_chat_message_ref(_message);
|
||||
linphone_content_unref(content);
|
||||
|
||||
linphone_chat_message_cbs_set_file_transfer_send(linphone_chat_message_get_callbacks(_message),
|
||||
linphone_iphone_file_transfer_send);
|
||||
|
||||
|
|
@ -158,7 +159,7 @@ static LinphoneBuffer *linphone_iphone_file_transfer_send(LinphoneChatMessage *m
|
|||
[LinphoneManager setValueInMessageAppData:[url absoluteString] forKey:@"localimage" inMessage:_message];
|
||||
}
|
||||
|
||||
LOGI(@"%p Uploading content in %p", self, _message);
|
||||
LOGI(@"%p Uploading content from message %p", self, _message);
|
||||
|
||||
linphone_chat_room_send_chat_message(chatRoom, _message);
|
||||
}
|
||||
|
|
@ -187,13 +188,17 @@ static LinphoneBuffer *linphone_iphone_file_transfer_send(LinphoneChatMessage *m
|
|||
- (void)stopAndDestroy {
|
||||
[[[LinphoneManager instance] fileTransferDelegates] removeObject:self];
|
||||
if (_message != NULL) {
|
||||
LOGI(@"%p Cancelling transfer from %p", self, _message);
|
||||
linphone_chat_message_cbs_set_file_transfer_send(linphone_chat_message_get_callbacks(_message), NULL);
|
||||
linphone_chat_message_cbs_set_file_transfer_recv(linphone_chat_message_get_callbacks(_message), NULL);
|
||||
linphone_chat_message_cancel_file_transfer(_message);
|
||||
linphone_chat_message_unref(_message);
|
||||
LinphoneChatMessage *msg = _message;
|
||||
_message = NULL;
|
||||
LOGI(@"%p Cancelling transfer from %p", self, msg);
|
||||
linphone_chat_message_cbs_set_file_transfer_send(linphone_chat_message_get_callbacks(msg), NULL);
|
||||
linphone_chat_message_cbs_set_file_transfer_recv(linphone_chat_message_get_callbacks(msg), NULL);
|
||||
// when we cancel file transfer, this will automatically trigger NotDelivered callback... recalling ourself a
|
||||
// second time
|
||||
// so we have to unset message BEFORE calling this
|
||||
linphone_chat_message_cancel_file_transfer(msg);
|
||||
linphone_chat_message_unref(msg);
|
||||
}
|
||||
_message = nil;
|
||||
_data = nil;
|
||||
LOGI(@"%p Destroying", self);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,11 +23,9 @@
|
|||
|
||||
@implementation LinphoneLogger
|
||||
|
||||
+ (void)logv:(OrtpLogLevel)severity
|
||||
file:(const char *)file
|
||||
line:(int)line
|
||||
format:(NSString *)format
|
||||
args:(va_list)args {
|
||||
+ (void)log:(OrtpLogLevel)severity file:(const char *)file line:(int)line format:(NSString *)format, ... {
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
NSString *str = [[NSString alloc] initWithFormat:format arguments:args];
|
||||
int filesize = 20;
|
||||
if (severity <= ORTP_DEBUG) {
|
||||
|
|
@ -38,12 +36,6 @@
|
|||
ortp_log(severity, "%*s:%3d - %s", filesize, file + MAX((int)strlen(file) - filesize, 0), line,
|
||||
[str UTF8String]);
|
||||
}
|
||||
}
|
||||
|
||||
+ (void)log:(OrtpLogLevel)severity file:(const char *)file line:(int)line format:(NSString *)format, ... {
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
[LinphoneLogger logv:severity file:file line:line format:format args:args];
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
}
|
||||
|
||||
- (void)reset {
|
||||
[self clearProxyConfig];
|
||||
[[LinphoneManager instance] removeAllAccounts];
|
||||
[[LinphoneManager instance] lpConfigSetBool:FALSE forKey:@"pushnotification_preference"];
|
||||
|
||||
LinphoneCore *lc = [LinphoneManager getLc];
|
||||
|
|
@ -320,17 +320,6 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
[_contentView setContentSize:[view bounds].size];
|
||||
}
|
||||
|
||||
- (void)clearProxyConfig {
|
||||
linphone_core_clear_proxy_config([LinphoneManager getLc]);
|
||||
linphone_core_clear_all_auth_info([LinphoneManager getLc]);
|
||||
}
|
||||
|
||||
- (void)setDefaultSettings:(LinphoneProxyConfig *)proxyCfg {
|
||||
LinphoneManager *lm = [LinphoneManager instance];
|
||||
|
||||
[lm configurePushTokenForProxyConfig:proxyCfg];
|
||||
}
|
||||
|
||||
- (BOOL)addProxyConfig:(NSString *)username
|
||||
password:(NSString *)password
|
||||
domain:(NSString *)domain
|
||||
|
|
@ -388,9 +377,9 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
LinphoneAuthInfo *info = linphone_auth_info_new([username UTF8String], NULL, [password UTF8String], NULL, NULL,
|
||||
linphone_proxy_config_get_domain(proxyCfg));
|
||||
|
||||
[self setDefaultSettings:proxyCfg];
|
||||
|
||||
[self clearProxyConfig];
|
||||
LinphoneManager *lm = [LinphoneManager instance];
|
||||
[lm configurePushTokenForProxyConfig:proxyCfg];
|
||||
[lm removeAllAccounts];
|
||||
|
||||
linphone_proxy_config_enable_register(proxyCfg, true);
|
||||
linphone_core_add_auth_info(lc, info);
|
||||
|
|
@ -402,8 +391,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
}
|
||||
|
||||
- (void)addProvisionedProxy:(NSString *)username withPassword:(NSString *)password withDomain:(NSString *)domain {
|
||||
[self clearProxyConfig];
|
||||
|
||||
[[LinphoneManager instance] removeAllAccounts];
|
||||
LinphoneProxyConfig *proxyCfg = linphone_core_create_proxy_config([LinphoneManager getLc]);
|
||||
|
||||
const char *addr = linphone_proxy_config_get_domain(proxyCfg);
|
||||
|
|
@ -505,6 +493,9 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
}
|
||||
case LinphoneRegistrationFailed: {
|
||||
_waitView.hidden = true;
|
||||
if ([message isEqualToString:@"Forbidden"]) {
|
||||
message = NSLocalizedString(@"Incorrect username or password.", nil);
|
||||
}
|
||||
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Registration failure", nil)
|
||||
message:message
|
||||
delegate:nil
|
||||
|
|
@ -893,9 +884,8 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
otherButtonTitles:nil, nil];
|
||||
[errorView show];
|
||||
} else if ([response object] != nil) { // Don't handle if not object: HTTP/Communication Error
|
||||
NSString *value = [response object];
|
||||
if ([[request method] isEqualToString:@"check_account"]) {
|
||||
if ([value integerValue] == 1) {
|
||||
if ([response.object isEqualToNumber:[NSNumber numberWithInt:1]]) {
|
||||
UIAlertView *errorView =
|
||||
[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Check issue", nil)
|
||||
message:NSLocalizedString(@"Username already exists", nil)
|
||||
|
|
@ -911,7 +901,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
[self createAccount:identity password:password email:email];
|
||||
}
|
||||
} else if ([[request method] isEqualToString:@"create_account_with_useragent"]) {
|
||||
if ([value integerValue] == 0) {
|
||||
if ([response.object isEqualToNumber:[NSNumber numberWithInt:0]]) {
|
||||
NSString *username = [WizardViewController findTextField:ViewElement_Username view:_contentView].text;
|
||||
NSString *password = [WizardViewController findTextField:ViewElement_Password view:_contentView].text;
|
||||
[self changeView:_validateAccountView back:FALSE animation:TRUE];
|
||||
|
|
@ -927,7 +917,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
[errorView show];
|
||||
}
|
||||
} else if ([[request method] isEqualToString:@"check_account_validated"]) {
|
||||
if ([value integerValue] == 1) {
|
||||
if ([response.object isEqualToNumber:[NSNumber numberWithInt:1]]) {
|
||||
NSString *username = [WizardViewController findTextField:ViewElement_Username view:_contentView].text;
|
||||
NSString *password = [WizardViewController findTextField:ViewElement_Password view:_contentView].text;
|
||||
[self addProxyConfig:username password:password domain:nil withTransport:nil];
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -41,7 +41,7 @@ NSString *const kLogsUpdateNotification = @"kLogsUpdateNotification";
|
|||
lastLogs = [[NSMutableArray alloc] initWithCapacity:kLastLogsCapacity];
|
||||
logsBuffer = [NSMutableArray arrayWithCapacity:kLogsBufferCapacity];
|
||||
|
||||
linphone_core_set_log_level(ORTP_WARNING);
|
||||
linphone_core_set_log_level(ORTP_MESSAGE);
|
||||
linphone_core_set_log_handler((OrtpLogFunc)linphone_iphone_log_handler);
|
||||
}
|
||||
|
||||
|
|
|
|||
97
README.md
97
README.md
|
|
@ -1,67 +1,104 @@
|
|||
[](https://travis-ci.org/BelledonneCommunications/linphone-iphone)
|
||||
|
||||
# BUILDING THE SDK
|
||||
Linphone is a free VoIP and video softphone based on the SIP protocol.
|
||||
|
||||

|
||||
|
||||
# Getting started
|
||||
|
||||
Here's how to launch Linphone for iPhone (more details below):
|
||||
|
||||
1. Install [Xcode from AppStore](https://itunes.apple.com/us/app/Xcode/id497799835?mt=12#).
|
||||
2. Install [HomeBrew, a package manager for OS X](http://brew.sh) (MacPorts is supported but deprecated).
|
||||
3. Install Linphone dependencies: open iTerm.app in the current directory and list dependencies to install using:
|
||||
`./prepare.py`
|
||||
4. Build SDK (see below for options and explanations):
|
||||
`./prepare.py -c && ./prepare.py && make`
|
||||
5. Open linphone.xcodeproj in Xcode: `open linphone.xcodeproj`
|
||||
6. Press `⌘R` and voilà!
|
||||
|
||||
# Building the SDK
|
||||
|
||||
Linphone for iPhone depends on liblinphone SDK. This SDK is generated from makefiles and shell scripts.
|
||||
|
||||
* GPL third parties versus non GPL third parties
|
||||
To generate the liblinphone multi-arch SDK in GPL mode, simply invoke:
|
||||
|
||||
This SDK can be generated in 2 flavors. First is with GPL third parties, it means liblinphone includes GPL third parties like FFMPEG or X264.
|
||||
If you choose this flavor, your final application must comply with GPL in any case. This is the default mode.
|
||||
./prepare.py [options] && make
|
||||
|
||||
Note: We are not compiling for the 32 bits i386 simulator by default because since iPhone 6 / iOS 8 simulators run in 64 bits. If you want to activate it, you should call prepare.py "i386" architecture.
|
||||
**The resulting SDK is located in `liblinphone-sdk/` root directory.**
|
||||
|
||||
To generate the liblinphone multi arch SDK in GPL mode, do:
|
||||
## Licensing: GPL third parties versus non GPL third parties
|
||||
|
||||
./prepare.py && make
|
||||
This SDK can be generated in 2 flavors:
|
||||
|
||||
ALTERNATIVELY, you can force liblinphone to use only non GPL code except for liblinphone, mediastreamer2, oRTP, belle-sip.
|
||||
If you choose this flavor, your final application is still subject to GPL except if you have a commercial license for liblinphone, mediastreamer2, oRTP, belle-sip.
|
||||
* GPL third parties enabled means that liblinphone includes GPL third parties like FFmpeg or X264. If you choose this flavor, your final application **must comply with GPL in any case**. This is the default mode.
|
||||
|
||||
To generate the liblinphone multi arch SDK in non GPL mode, do:
|
||||
* NO GPL third parties means that Linphone will only use non GPL code except for `liblinphone`, `mediastreamer2`, `oRTP` and `belle-sip`. If you choose this flavor, your final application is **still subject to GPL except if you have a [commercial license for the mentioned libraries](http://www.belledonne-communications.com/products.html)**.
|
||||
To generate the liblinphone multi arch SDK without GPL third parties, invoke:
|
||||
|
||||
./prepare.py -DENABLE_GPL_THIRD_PARTIES=NO && make
|
||||
./prepare.py --disable-gpl-third-parties=no [other options] && make
|
||||
|
||||
* In case you upgrade your IOS SDK, you may force rebuilding everything, by doing
|
||||
## Customizing features
|
||||
|
||||
./prepare.py -c && ./prepare.py && make
|
||||
You can enable all non-free codecs using `--enable-non-free-codecs`.
|
||||
You can also choose to enable/disable features one by one (custom audio/video codecs, media encryption, etc.). To get a list of all features, the simplest way is to invoke `prepare.py` with `--list-features`:
|
||||
|
||||
**The resulting sdk is in `liblinphone-sdk/` root directory.**
|
||||
./prepare.py --list-features
|
||||
|
||||
# BUILDING THE APPLICATION
|
||||
You can for instance enable X264 by using:
|
||||
|
||||
./prepare.py -DENABLE_X264=ON [other options]
|
||||
|
||||
## Built architectures
|
||||
|
||||
4 architectures currently exists on iOS:
|
||||
|
||||
- 64 bits ARM64 for iPhone 5s, iPad Air, iPad mini 2, iPhone 6, iPhone 6 Plus, iPad Air 2, iPad mini 3.
|
||||
- 32 bits ARMv7 for older devices.
|
||||
- 64 bits x86_64 for simulator for all ARM64 devices.
|
||||
- 32 bits i386 for simulator for all ARMv7 older devices.
|
||||
|
||||
Note: We are not compiling for the 32 bits i386 simulator by default because Xcode default device (iPhone 6) runs in 64 bits. If you want to enable it, you should invoke `prepare.py` with `i386` argument: `./prepare.py i386 [other options]`.
|
||||
|
||||
## Upgrading your iOS SDK
|
||||
|
||||
Simply re-invoking `make` should update your SDK. If compilation fails, you may need to rebuilding everything by invoking:
|
||||
|
||||
./prepare.py -c && ./prepare.py [options] && make
|
||||
|
||||
# Building the application
|
||||
|
||||
After the SDK is built, just open the Linphone Xcode project with Xcode, and press `Run`.
|
||||
|
||||
* Note regarding third party components subject to license:
|
||||
## Note regarding third party components subject to license
|
||||
|
||||
The liblinphone-sdk is compiled with third parties code that are subject to patent license, specially: AMR, SILK G729 and H264 codecs.
|
||||
Linphone controls the embedding of these codecs thanks to the preprocessor macros HAVE_SILK, HAVE_AMR, HAVE_G729 HAVE_OPENH264 positioned in Xcode project.
|
||||
Before embedding these 4 codecs in the final application, make sure to have the right to do so.
|
||||
The liblinphone SDK is compiled with third parties code that are subject to patent license, specially: AMR, SILK G729 and H264 codecs.
|
||||
Linphone controls the embedding of these codecs by generating dummy libraries when there are not available. You can enable them using `prepare.py`
|
||||
script (see `--enable-non-free-codecs` option). Before embedding these 4 codecs in the final application, **make sure to have the right to do so**.
|
||||
|
||||
# TESTING THE APPLICATION
|
||||
# Testing the application
|
||||
|
||||
We are using the KIF framework to test the UI of Linphone. It is used as a submodule (instead of CocoaPods) for ease.
|
||||
|
||||
Simply press `Command + U` and the default simulator / device will launch and try to pass all the tests.
|
||||
Simply press `⌘U` and the default simulator / device will launch and try to pass all the tests.
|
||||
|
||||
|
||||
# LIMITATIONS, KNOWN BUGS
|
||||
# Limitations and known bugs
|
||||
|
||||
* Video capture does not work in simulator (not implemented by simulator?).
|
||||
* Video capture will not work in simulator (not implemented in it).
|
||||
|
||||
# DEBUGING THE SDK
|
||||
# Debugging the SDK
|
||||
|
||||
Sometime it can be useful to step into liblinphone SDK functions. To allow Xcode to enable breakpoint within liblinphone, SDK must be built with debug symbols.
|
||||
To add debug symbol to liblinphone SDK, use:
|
||||
Sometime it can be useful to step into liblinphone SDK functions. To allow Xcode to enable breakpoint within liblinphone, SDK must be built with debug symbols by using option `--debug`:
|
||||
|
||||
./prepare.py -d && make
|
||||
./prepare.py --debug [other options] && make
|
||||
|
||||
# DEBUGING MEDIASTREAMER2
|
||||
## Debugging mediastreamer2
|
||||
|
||||
For iOS specific media development like audio video capture/playback it may be interesting to use `mediastream` test tool.
|
||||
The project `submodule/liblinphone.xcodeproj` can be used for this purpose.
|
||||
|
||||
# Quick UI reference for Linphone iOS:
|
||||
# Quick UI reference
|
||||
|
||||
- The app is contained in a window, which resides in the MainStoryboard file.
|
||||
- The delegate is set to LinphoneAppDelegate in main.m, in the UIApplicationMain() by passing its class
|
||||
|
|
@ -86,7 +123,7 @@ MainStoryboard
|
|||
#--> tabBar
|
||||
|
||||
|
||||
When the app is started, the phoneMainView gets asked to transition to the Dialer view or the Wizard view.
|
||||
When the application is started, the phoneMainView gets asked to transition to the Dialer view or the Wizard view.
|
||||
PhoneMainView exposes the -changeCurrentView: method, which will setup its
|
||||
Any Linphone view is actually presented in the UICompositeViewController, with or without a stateBar and tabBar.
|
||||
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -14,13 +14,12 @@
|
|||
"G.729" = "G.729";
|
||||
"GSM" = "GSM";
|
||||
"iLBC" = "iLBC";
|
||||
"iSAC" = "iSAC";
|
||||
"PCMU" = "PCMU";
|
||||
"PCMA" = "PCMA";
|
||||
"Advanced" = "Advanced";
|
||||
"Playback gain" = "Playback gain";
|
||||
"Microphone gain" = "Microphone gain";
|
||||
"Adaptive rate control" = "Adaptive rate control";
|
||||
"Adaptive rate algorithm" = "Adaptive rate algorithm";
|
||||
"Codec bitrate limit" = "Codec bitrate limit";
|
||||
"Enable Voice Processing" = "Enable Voice Processing";
|
||||
"Enable Bass Boost" = "Enable Bass Boost";
|
||||
|
|
|
|||
|
|
@ -5,3 +5,4 @@
|
|||
"Incoming call timeout" = "Incoming call timeout";
|
||||
"In call timeout" = "In call timeout";
|
||||
"Voice mail URI" = "Voice mail URI";
|
||||
"Repeat call notification" = "Repeat call notification";
|
||||
|
|
|
|||
|
|
@ -10,5 +10,6 @@
|
|||
"Media Encryption" = "Media Encryption";
|
||||
"Push Notification" = "Push Notification";
|
||||
"Limits" = "Limits";
|
||||
"Upload bandwidth" = "Upload bandwidth";
|
||||
"Download bandwidth" = "Download bandwidth";
|
||||
"Adaptive rate control" = "Adaptive rate control";
|
||||
"Adaptive rate control" = "Adaptive rate control";
|
||||
"Adaptive rate algorithm" = "Adaptive rate algorithm";
|
||||
|
|
|
|||
|
|
@ -18,10 +18,9 @@
|
|||
"Network" = "Network";
|
||||
"Tunnel" = "Tunnel";
|
||||
"Advanced" = "Advanced";
|
||||
"Extra features" = "Extra features";
|
||||
"Development debug actions" = "Development debug actions";
|
||||
"About" = "About";
|
||||
"Quit" = "Quit";
|
||||
"Exit" = "Exit";
|
||||
"Release core" = "Release core";
|
||||
"Clear cache" = "Clear cache";
|
||||
"Battery alert" = "Battery alert";
|
||||
|
|
|
|||
|
|
@ -2,7 +2,10 @@
|
|||
"Automatically accept" = "Automatically accept";
|
||||
"Show self view" = "Show self view";
|
||||
"Show preview" = "Show preview";
|
||||
"Video preset" = "Video preset";
|
||||
"Preferred video size" = "Preferred video size";
|
||||
"Preferred FPS" = "Preferred FPS";
|
||||
"Bandwidth limit in kbits/s" = "Bandwidth limit in kbits/s";
|
||||
"Codecs" = "Codecs";
|
||||
"MPEG-4" = "MPEG-4";
|
||||
"H.264" = "H.264";
|
||||
|
|
|
|||
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue