Merge remote-tracking branch 'origin/master' into tunnel

Conflicts:
	Classes/LinphoneUI/LinphoneManager.m
	linphone.xcodeproj/project.pbxproj
	submodules/build/Makefile
	submodules/externals/exosip
	submodules/liblinphone.xcodeproj/project.pbxproj
	submodules/linphone
	submodules/mssilk
This commit is contained in:
Simon Morlat 2012-04-26 15:09:04 +02:00
commit 9af95dc58e
47 changed files with 4348 additions and 1704 deletions

View file

@ -1,27 +1,48 @@
//
// CallDelegate.h
// linphone
//
// Created by Pierre-Eric Pelloux-Prayer on 03/11/11.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
/* LinphoneManager.h
*
* Copyright (C) 2011 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import <Foundation/Foundation.h>
#include "linphonecore.h"
enum CallDelegateType {
CD_UNDEFINED = 0,
CD_NEW_CALL,
CD_ZRTP,
CD_VIDEO_UPDATE,
CD_STOP_VIDEO_ON_LOW_BATTERY,
CD_TRANSFER_CALL
};
@protocol UIActionSheetCustomDelegate
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex withUserDatas:(void*) datas;
- (void)actionSheet:(UIActionSheet *)actionSheet ofType:(enum CallDelegateType) type clickedButtonAtIndex:(NSInteger)buttonIndex withUserDatas:(void*) datas;
@end
@interface CallDelegate : NSObject<UIActionSheetDelegate> {
enum CallDelegateType eventType;
LinphoneCall* call;
id<UIActionSheetCustomDelegate> delegate;
NSTimer* timeout;
}
@property (nonatomic) enum CallDelegateType eventType;
@property (nonatomic) LinphoneCall* call;
@property (nonatomic, retain) id delegate;
@property (nonatomic, retain) NSTimer* timeout;
@end

View file

@ -1,20 +1,67 @@
//
// CallDelegate.m
// linphone
//
// Created by Pierre-Eric Pelloux-Prayer on 03/11/11.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
/* LinphoneManager.h
*
* Copyright (C) 2011 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import "CallDelegate.h"
@implementation CallDelegate
@synthesize eventType;
@synthesize call;
@synthesize delegate;
@synthesize timeout;
-(void) actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
[delegate actionSheet:actionSheet clickedButtonAtIndex:buttonIndex withUserDatas:call];
if (timeout) {
[timeout invalidate];
timeout = nil;
}
if (eventType == CD_UNDEFINED) {
ms_error("Incorrect usage of CallDelegate/ActionSheet: eventType must be set");
}
[delegate actionSheet:actionSheet ofType:eventType clickedButtonAtIndex:buttonIndex withUserDatas:call];
}
-(void) actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex {
if (timeout) {
[timeout invalidate];
timeout = nil;
}
if (buttonIndex != actionSheet.cancelButtonIndex) return;
if (eventType == CD_UNDEFINED) {
ms_error("Incorrect usage of CallDelegate/ActionSheet: eventType must be set");
}
[delegate actionSheet:actionSheet ofType:eventType clickedButtonAtIndex:buttonIndex withUserDatas:call];
}
-(void) actionSheetCancel:(UIActionSheet *)actionSheet {
if (timeout) {
[timeout invalidate];
timeout = nil;
}
if (eventType == CD_UNDEFINED) {
ms_error("Incorrect usage of CallDelegate/ActionSheet: eventType must be set");
}
[delegate actionSheet:actionSheet ofType:eventType clickedButtonAtIndex:actionSheet.cancelButtonIndex withUserDatas:call];
}
@end

View file

@ -116,7 +116,8 @@
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
[cell.textLabel setTextColor:[UIColor colorWithRed:0.7 green:0.745 blue:0.78 alpha:1.0]];
[cell.detailTextLabel setTextColor:cell.textLabel.textColor];
}
// Set up the cell...
@ -127,7 +128,7 @@
NSString *path;
if (callLogs->dir == LinphoneCallIncoming) {
if (callLogs->status == LinphoneCallSuccess) {
path = [[NSBundle mainBundle] pathForResource:@"in_call" ofType:@"png"];
path = [[NSBundle mainBundle] pathForResource:callLogs->video_enabled?@"in_call_video":@"in_call" ofType:@"png"];
} else {
//missed call
path = [[NSBundle mainBundle] pathForResource:@"missed_call" ofType:@"png"];
@ -135,7 +136,7 @@
partyToDisplay=callLogs->from;
} else {
path = [[NSBundle mainBundle] pathForResource:@"out_call" ofType:@"png"];
path = [[NSBundle mainBundle] pathForResource:callLogs->video_enabled?@"out_call_video":@"out_call" ofType:@"png"];
partyToDisplay=callLogs->to;
}
@ -147,12 +148,12 @@
const char* displayName = linphone_address_get_display_name(partyToDisplay);
if (displayName) {
NSString* str1 = [NSString stringWithCString:displayName encoding:[NSString defaultCStringEncoding]];
NSString* str1 = [NSString stringWithFormat:@"%s", displayName];
[cell.textLabel setText:str1];
NSString* str2 = [NSString stringWithFormat:@"%s"/* [%s]"*/,username/*,callLogs->start_date*/];
[cell.detailTextLabel setText:str2];
} else {
NSString* str1 = [NSString stringWithCString:username encoding:[NSString defaultCStringEncoding]];
NSString* str1 = [NSString stringWithFormat:@"%s", username];
[cell.textLabel setText:str1];
[cell.detailTextLabel setText:nil];
}

View file

@ -88,9 +88,11 @@ NSTimer *callQualityRefresher;
[mute reset];
[speaker reset];
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
[super viewWillAppear:animated];
}
-(void) viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
callQualityRefresher = [NSTimer scheduledTimerWithTimeInterval:1
target:self
selector:@selector(updateCallQuality)
@ -148,21 +150,7 @@ NSTimer *callQualityRefresher;
}
}
UIImageView* callquality = (UIImageView*) [cell viewWithTag:3];
if (linphone_call_get_average_quality(call) >= 4) {
[callquality setImage: [IncallViewController stat_sys_signal_4]];
}
else if (linphone_call_get_average_quality(call) >= 3) {
[callquality setImage: [IncallViewController stat_sys_signal_3]];
}
else if (linphone_call_get_average_quality(call) >= 2) {
[callquality setImage: [IncallViewController stat_sys_signal_2]];
}
else if (linphone_call_get_average_quality(call) >= 1) {
[callquality setImage: [IncallViewController stat_sys_signal_1]];
}
else {
[callquality setImage: [IncallViewController stat_sys_signal_0]];
}
[IncallViewController updateIndicator:callquality withCallQuality:linphone_call_get_average_quality(call)];
tableView.rowHeight = 80;
return cell;

View file

@ -58,6 +58,7 @@ NSMutableString* MoreViewController_logs;
*/
-(void) viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[logs setText:MoreViewController_logs];
}

View file

@ -89,8 +89,8 @@
}
-(void) displayRegisteredFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName onDomain:(NSString*)domain {
[[NSUserDefaults standardUserDefaults] setBool:false forKey:@"enable_first_login_view_preference"];
[self.parentViewController dismissModalViewControllerAnimated:true];
[self.activityIndicator setHidden:true];
[self dismissModalViewControllerAnimated:YES];
}
-(void) displayRegisteringFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName onDomain:(NSString*)domain {
[self.activityIndicator setHidden:false];
@ -99,13 +99,13 @@
[self.activityIndicator setHidden:true];
//default behavior if no registration delegates
UIAlertView* error = [[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:@"Registration failure for user %@",user]
message:reason
delegate:nil
cancelButtonTitle:@"Continue"
otherButtonTitles:nil ,nil];
[error show];
[error release];
//UIAlertView* error = [[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:@"Registration failure for user %@",user]
// message:reason
// delegate:nil
// cancelButtonTitle:@"Continue"
// otherButtonTitles:nil ,nil];
//[error show];
//[error release];
//erase uername passwd
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"username_preference"];
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"password_preference"];

View file

@ -2,30 +2,31 @@
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">784</int>
<string key="IBDocument.SystemVersion">10J567</string>
<string key="IBDocument.InterfaceBuilderVersion">823</string>
<string key="IBDocument.AppKitVersion">1038.35</string>
<string key="IBDocument.HIToolboxVersion">462.00</string>
<string key="IBDocument.SystemVersion">10K549</string>
<string key="IBDocument.InterfaceBuilderVersion">1938</string>
<string key="IBDocument.AppKitVersion">1038.36</string>
<string key="IBDocument.HIToolboxVersion">461.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">132</string>
<string key="NS.object.0">933</string>
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="4"/>
<string>IBUIView</string>
<string>IBUIImageView</string>
<string>IBUIViewController</string>
<string>IBProxyObject</string>
<string>IBUIActivityIndicatorView</string>
<string>IBUITextField</string>
<string>IBUIButton</string>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<bool key="EncodedWithXMLCoder">YES</bool>
@ -48,27 +49,28 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{0, -20}, {360, 480}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSNextKeyView" ref="210410556"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<int key="IBUIContentMode">9</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSCustomResource" key="IBUIImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">wallpaper_iphone_320x480.png</string>
</object>
</object>
<object class="IBUIButton" id="731646357">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{25, 319}, {184, 37}}</string>
<int key="NSvFlags">-2147483356</int>
<string key="NSFrame">{{60, 400}, {200, 37}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSNextKeyView"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<object class="NSFont" key="IBUIFont" id="301967745">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">15</double>
<int key="NSfFlags">16</int>
</object>
<object class="NSColor" key="IBUIHighlightedTitleColor" id="992101396">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
@ -81,18 +83,32 @@
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC41AA</bytes>
</object>
<object class="IBUIFontDescription" key="IBUIFontDescription">
<string key="name">Helvetica-Bold</string>
<string key="family">Helvetica</string>
<int key="traits">2</int>
<double key="pointSize">15</double>
</object>
<object class="NSFont" key="IBUIFont">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">15</double>
<int key="NSfFlags">16</int>
</object>
</object>
<object class="IBUITextField" id="415396672">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{105, 75}, {197, 31}}</string>
<string key="NSFrame">{{60, 200}, {200, 31}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSNextKeyView" ref="157624641"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<string key="IBUIText"/>
<int key="IBUIBorderStyle">3</int>
<string key="IBUIPlaceholder">Password</string>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
@ -108,37 +124,29 @@
<bool key="IBUISecureTextEntry">YES</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
<object class="IBUILabel" id="782383412">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{9, 80}, {100, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">Password*</string>
<object class="NSColor" key="IBUITextColor" id="250738492">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MCAwIDAAA</bytes>
<object class="IBUIFontDescription" key="IBUIFontDescription" id="927759199">
<int key="type">1</int>
<double key="pointSize">12</double>
</object>
<object class="NSFont" key="IBUIFont" id="348267750">
<string key="NSName">Helvetica</string>
<double key="NSSize">12</double>
<int key="NSfFlags">16</int>
</object>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
<float key="IBUIMinimumFontSize">10</float>
</object>
<object class="IBUITextField" id="300056741">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{105, 34}, {197, 31}}</string>
<string key="NSFrame">{{60, 150}, {200, 31}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSNextKeyView" ref="415396672"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentVerticalAlignment">0</int>
<string key="IBUIText"/>
<int key="IBUIBorderStyle">3</int>
<string key="IBUIPlaceholder">Username</string>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
@ -150,46 +158,41 @@
<int key="IBUIAutocorrectionType">1</int>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
<object class="IBUILabel" id="590298991">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{9, 40}, {100, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MCAwAA</bytes>
</object>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">Username*</string>
<reference key="IBUITextColor" ref="250738492"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
<float key="IBUIMinimumFontSize">10</float>
<reference key="IBUIFontDescription" ref="927759199"/>
<reference key="IBUIFont" ref="348267750"/>
</object>
<object class="IBUIButton" id="157624641">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{105, 154}, {195, 37}}</string>
<string key="NSFrame">{{60, 300}, {200, 37}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSNextKeyView" ref="731646357"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<reference key="IBUIFont" ref="301967745"/>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">login</string>
<string key="IBUINormalTitle">Login</string>
<reference key="IBUIHighlightedTitleColor" ref="992101396"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA</bytes>
<int key="NSColorSpace">5</int>
<bytes key="NSCMYK">MSAwLjY2MDAwMDAyNjIgMCAwAA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace">
<int key="NSID">3</int>
</object>
<characters key="NSComponents">1 0.66 0 0 1</characters>
</object>
<reference key="IBUINormalTitleShadowColor" ref="64173324"/>
<object class="IBUIFontDescription" key="IBUIFontDescription">
<int key="type">2</int>
<int key="size">2</int>
</object>
<object class="NSFont" key="IBUIFont">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">18</double>
<int key="NSfFlags">16</int>
</object>
</object>
<object class="IBUIView" id="210410556">
<reference key="NSNextResponder" ref="191373211"/>
@ -201,6 +204,7 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{142, 211}, {37, 37}}</string>
<reference key="NSSuperview" ref="210410556"/>
<reference key="NSNextKeyView" ref="300056741"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
@ -212,17 +216,19 @@
</object>
<string key="NSFrameSize">{320, 460}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSNextKeyView" ref="871218378"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
<bytes key="NSWhite">MSAwLjY2AA</bytes>
<reference key="NSCustomColorSpace" ref="925734638"/>
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
<string key="NSFrameSize">{320, 460}</string>
<string key="NSFrame">{{0, 20}, {320, 460}}</string>
<reference key="NSSuperview"/>
<reference key="NSNextKeyView" ref="427931982"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
@ -233,6 +239,7 @@
</object>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
@ -258,6 +265,38 @@
</object>
<int key="connectionID">15</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">activityIndicator</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="210410556"/>
</object>
<int key="connectionID">33</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">username</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="300056741"/>
</object>
<int key="connectionID">38</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">site</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="731646357"/>
</object>
<int key="connectionID">36</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="300056741"/>
<reference key="destination" ref="372490531"/>
</object>
<int key="connectionID">39</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">delegate</string>
@ -275,22 +314,6 @@
</object>
<int key="connectionID">20</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">activityIndicator</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="210410556"/>
</object>
<int key="connectionID">33</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">site</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="731646357"/>
</object>
<int key="connectionID">36</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">doOk:</string>
@ -300,29 +323,15 @@
</object>
<int key="connectionID">37</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">username</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="300056741"/>
</object>
<int key="connectionID">38</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="300056741"/>
<reference key="destination" ref="372490531"/>
</object>
<int key="connectionID">39</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
<reference key="object" ref="0"/>
<object class="NSArray" key="object" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
@ -355,8 +364,6 @@
<reference ref="300056741"/>
<reference ref="731646357"/>
<reference ref="415396672"/>
<reference ref="782383412"/>
<reference ref="590298991"/>
<reference ref="427931982"/>
<reference ref="210410556"/>
</object>
@ -373,28 +380,12 @@
<reference key="parent" ref="191373211"/>
<string key="objectName">username</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">35</int>
<reference key="object" ref="731646357"/>
<reference key="parent" ref="191373211"/>
<string key="objectName">site</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">8</int>
<reference key="object" ref="415396672"/>
<reference key="parent" ref="191373211"/>
<string key="objectName">passwd</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">9</int>
<reference key="object" ref="782383412"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">7</int>
<reference key="object" ref="590298991"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">5</int>
<reference key="object" ref="427931982"/>
@ -415,6 +406,12 @@
<reference key="object" ref="871218378"/>
<reference key="parent" ref="210410556"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">35</int>
<reference key="object" ref="731646357"/>
<reference key="parent" ref="191373211"/>
<string key="objectName">site</string>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@ -422,58 +419,40 @@
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-1.CustomClassName</string>
<string>-1.IBPluginDependency</string>
<string>-2.CustomClassName</string>
<string>1.IBEditorWindowLastContentRect</string>
<string>-2.IBPluginDependency</string>
<string>1.IBPluginDependency</string>
<string>1.IBUserGuides</string>
<string>1.IBViewBoundsToFrameTransform</string>
<string>12.IBPluginDependency</string>
<string>12.IBViewBoundsToFrameTransform</string>
<string>31.IBEditorWindowLastContentRect</string>
<string>12.IBUIButtonInspectorSelectedStateConfigurationMetadataKey</string>
<string>31.IBPluginDependency</string>
<string>31.IBViewBoundsToFrameTransform</string>
<string>32.IBPluginDependency</string>
<string>35.IBPluginDependency</string>
<string>4.IBEditorWindowLastContentRect</string>
<string>4.IBPluginDependency</string>
<string>4.IBViewEditorWindowController.showingBoundsRectangles</string>
<string>5.IBPluginDependency</string>
<string>6.IBPluginDependency</string>
<string>7.IBPluginDependency</string>
<string>8.IBPluginDependency</string>
<string>9.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>FirstLoginViewController</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>UIResponder</string>
<string>{{444, 412}, {320, 480}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<object class="NSMutableArray">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUserGuide">
<reference key="view" ref="191373211"/>
<double key="location">105</double>
<double key="location">104</double>
<int key="affinity">0</int>
</object>
</object>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAAAAAAAAw+UAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABDUgAAw7EAAA</bytes>
</object>
<string>{{193, 650}, {320, 460}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAAAAAAAAw+UAAA</bytes>
</object>
<real value="0.0"/>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>{{85, 91}, {320, 480}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<boolean value="NO"/>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@ -484,316 +463,18 @@
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<reference key="dict.values" ref="0"/>
</object>
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<reference key="dict.values" ref="0"/>
</object>
<nil key="sourceID"/>
<int key="maxID">53</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">FirstLoginViewController</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">doOk:</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<string key="NS.key.0">doOk:</string>
<object class="IBActionInfo" key="NS.object.0">
<string key="name">doOk:</string>
<string key="candidateClassName">id</string>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>activityIndicator</string>
<string>ok</string>
<string>passwd</string>
<string>site</string>
<string>username</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UIView</string>
<string>UIButton</string>
<string>UITextField</string>
<string>UIButton</string>
<string>UITextField</string>
</object>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>activityIndicator</string>
<string>ok</string>
<string>passwd</string>
<string>site</string>
<string>username</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBToOneOutletInfo">
<string key="name">activityIndicator</string>
<string key="candidateClassName">UIView</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">ok</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">passwd</string>
<string key="candidateClassName">UITextField</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">site</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">username</string>
<string key="candidateClassName">UITextField</string>
</object>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">Classes/FirstLoginViewController.h</string>
</object>
</object>
</object>
<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSError.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIAccessibility.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UINibLoading.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="591342967">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIResponder.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIActivityIndicatorView</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIActivityIndicatorView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIButton</string>
<string key="superclassName">UIControl</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIButton.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIControl</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIControl.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIImageView</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIImageView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UILabel</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UILabel.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIResponder</string>
<string key="superclassName">NSObject</string>
<reference key="sourceIdentifier" ref="591342967"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">UISearchBar</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UISearchBar.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UISearchDisplayController</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UISearchDisplayController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UITextField</string>
<string key="superclassName">UIControl</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="514241255">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UITextField.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIPrintFormatter.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIView</string>
<reference key="sourceIdentifier" ref="514241255"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIView</string>
<string key="superclassName">UIResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UINavigationController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIPopoverController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UISplitViewController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UITabBarController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIViewController</string>
<string key="superclassName">UIResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIViewController.h</string>
</object>
</object>
</object>
<int key="maxID">54</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes"/>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
@ -802,15 +483,18 @@
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
<integer value="1056" key="NS.object.0"/>
<real value="1280" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
<integer value="3000" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<string key="IBDocument.LastKnownRelativeProjectPath">../linphone.xcodeproj</string>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<string key="IBCocoaTouchPluginVersion">132</string>
<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
<string key="NS.key.0">wallpaper_iphone_320x480.png</string>
<string key="NS.object.0">{320, 480}</string>
</object>
<string key="IBCocoaTouchPluginVersion">933</string>
</data>
</archive>

File diff suppressed because it is too large Load diff

View file

@ -22,7 +22,8 @@
#import "ConferenceCallDetailView.h"
#import <AddressBookUI/ABPeoplePickerNavigationController.h>
#include "UILinphone.h"
#import "UIToggleVideoButton.h"
#import "VideoZoomHandler.h"
@class VideoViewController;
@interface IncallViewController : UIViewController <ABPeoplePickerNavigationControllerDelegate,LinphoneUICallDelegate, UITableViewDelegate, UITableViewDataSource, UIActionSheetCustomDelegate> {
@ -36,9 +37,10 @@
UIButton* pause;
UISpeakerButton* speaker;
UIButton* contacts;
UIButton* addVideo;
UIToggleVideoButton* addVideo;
UITableView* callTableView;
UIButton* addCall, *mergeCalls;
UIButton* transfer;
//key pad
@ -58,6 +60,14 @@
UIDigitButton* hash;
UIButton* close;
UIView* videoGroup;
UIView* videoView;
UIView* videoPreview;
UIImageView* videoCallQuality;
UICamSwitch* videoCameraSwitch;
UIActivityIndicatorView* videoUpdateIndicator;
UIActivityIndicatorView* videoWaitingForFirstImage;
bool dismissed;
NSTimer *durationRefreasher;
@ -78,14 +88,11 @@
UIImage* verified, *unverified;
UIImage* stat_sys_signal_0, *stat_sys_signal_1, *stat_sys_signal_2, *stat_sys_signal_3, *stat_sys_signal_4;
UIActionSheet* zrtpVerificationSheet;
}
UIActionSheet* visibleActionSheet;
+ (UIImage*) stat_sys_signal_0;
+ (UIImage*) stat_sys_signal_1;
+ (UIImage*) stat_sys_signal_2;
+ (UIImage*) stat_sys_signal_3;
+ (UIImage*) stat_sys_signal_4;
NSTimer* hideControlsTimer;
VideoZoomHandler* videoZoomHandler;
}
-(void)displayStatus:(NSString*) message;
@ -93,6 +100,7 @@
+(LinphoneCall*) retrieveCallAtIndex: (NSInteger) index inConference:(bool) conf;
+ (void) updateCellImageView:(UIImageView*)imageView Label:(UILabel*)label DetailLabel:(UILabel*)detailLabel AndAccessoryView:(UIView*)accessoryView withCall:(LinphoneCall*) call;
+(void) updateIndicator:(UIImageView*) indicator withCallQuality:(float) quality;
@property (nonatomic, retain) IBOutlet UIView* controlSubView;
@property (nonatomic, retain) IBOutlet UIView* padSubView;
@ -105,10 +113,11 @@
@property (nonatomic, retain) IBOutlet UIButton* pause;
@property (nonatomic, retain) IBOutlet UIButton* speaker;
@property (nonatomic, retain) IBOutlet UIButton* contacts;
@property (nonatomic, retain) IBOutlet UIButton* addVideo;
@property (nonatomic, retain) IBOutlet UIToggleVideoButton* addVideo;
@property (nonatomic, retain) IBOutlet UITableView* callTableView;
@property (nonatomic, retain) IBOutlet UIButton* addCall;
@property (nonatomic, retain) IBOutlet UIButton* mergeCalls;
@property (nonatomic, retain) IBOutlet UIButton* transfer;
@property (nonatomic, retain) IBOutlet UIButton* one;
@property (nonatomic, retain) IBOutlet UIButton* two;
@ -124,4 +133,13 @@
@property (nonatomic, retain) IBOutlet UIButton* hash;
@property (nonatomic, retain) IBOutlet UIButton* close;
@property (nonatomic, retain) IBOutlet VideoViewController* videoViewController;
@property (nonatomic, retain) IBOutlet UIView* videoGroup;
@property (nonatomic, retain) IBOutlet UIView* videoView;
@property (nonatomic, retain) IBOutlet UIView* videoPreview;
@property (nonatomic, retain) IBOutlet UIImageView* videoCallQuality;
@property (nonatomic, retain) IBOutlet UICamSwitch* videoCameraSwitch;
@property (nonatomic, retain) IBOutlet UIActivityIndicatorView* videoUpdateIndicator;
@property (nonatomic, retain) IBOutlet UIActivityIndicatorView* videoWaitingForFirstImage;
@end

View file

@ -24,6 +24,10 @@
#include "LinphoneManager.h"
#include "private.h"
#import "ContactPickerDelegate.h"
#import <QuartzCore/CAAnimation.h>
#import <QuartzCore/QuartzCore.h>
#import <OpenGLES/EAGL.h>
#import <OpenGLES/EAGLDrawable.h>
#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)
@ -48,6 +52,7 @@ const NSInteger SECURE_BUTTON_TAG=5;
@synthesize callTableView;
@synthesize addCall;
@synthesize mergeCalls;
@synthesize transfer;
@synthesize one;
@synthesize two;
@ -63,27 +68,29 @@ const NSInteger SECURE_BUTTON_TAG=5;
@synthesize hash;
@synthesize videoViewController;
@synthesize videoGroup;
@synthesize videoView;
@synthesize videoPreview;
@synthesize videoCallQuality;
@synthesize videoCameraSwitch;
@synthesize videoUpdateIndicator;
@synthesize videoWaitingForFirstImage;
@synthesize addVideo;
+ (UIImage*) stat_sys_signal_0 {
return [UIImage imageNamed:@"stat_sys_signal_0.png"];
}
+ (UIImage*) stat_sys_signal_1 {
return [UIImage imageNamed:@"stat_sys_signal_1.png"];
}
+ (UIImage*) stat_sys_signal_2 {
return [UIImage imageNamed:@"stat_sys_signal_2.png"];
}
+ (UIImage*) stat_sys_signal_3 {
return [UIImage imageNamed:@"stat_sys_signal_3.png"];
}
+ (UIImage*) stat_sys_signal_4 {
return [UIImage imageNamed:@"stat_sys_signal_4.png"];
+(void) updateIndicator:(UIImageView*) indicator withCallQuality:(float) quality {
if (quality >= 4 || quality < 0) {
[indicator setImage:[UIImage imageNamed:@"stat_sys_signal_4.png"]];
} else if (quality >= 3) {
[indicator setImage:[UIImage imageNamed:@"stat_sys_signal_3.png"]];
} else if (quality >= 2) {
[indicator setImage:[UIImage imageNamed:@"stat_sys_signal_2.png"]];
} else if (quality >= 1) {
[indicator setImage:[UIImage imageNamed:@"stat_sys_signal_1.png"]];
} else {
[indicator setImage:[UIImage imageNamed:@"stat_sys_signal_0.png"]];
}
}
bool isInConference(LinphoneCall* call) {
@ -105,26 +112,219 @@ int callCount(LinphoneCore* lc) {
return count;
}
-(void) updateUIFromLinphoneState:(UIViewController *)viewCtrl {
void addAnimationFadeTransition(UIView* view, float duration) {
CATransition* animation = [CATransition animation];
animation.type = kCATransitionFromBottom; // kCATransitionFade;
animation.duration = duration;
[view.layer addAnimation:animation forKey:nil];
}
-(void) orientationChanged: (NSNotification*) notif {
int oldLinphoneOrientation = linphone_core_get_device_rotation([LinphoneManager getLc]);
UIDeviceOrientation orientation = [UIDevice currentDevice].orientation;
int newRotation = 0;
switch (orientation) {
case UIInterfaceOrientationLandscapeRight:
newRotation = 270;
break;
case UIInterfaceOrientationLandscapeLeft:
newRotation = 90;
break;
default:
newRotation = 0;
}
if (oldLinphoneOrientation != newRotation) {
linphone_core_set_device_rotation([LinphoneManager getLc], newRotation);
linphone_core_set_native_video_window_id([LinphoneManager getLc],(unsigned long)videoView);
LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]);
if (call && linphone_call_params_video_enabled(linphone_call_get_current_params(call))) {
//Orientation has changed, must call update call
linphone_core_update_call([LinphoneManager getLc], call, NULL);
/* animate button images rotation */
#define degreesToRadians(x) (M_PI * x / 180.0)
CGAffineTransform transform = CGAffineTransformIdentity;
switch (orientation) {
case UIInterfaceOrientationLandscapeRight:
transform = CGAffineTransformMakeRotation(degreesToRadians(90));
break;
case UIInterfaceOrientationLandscapeLeft:
transform = CGAffineTransformMakeRotation(degreesToRadians(-90));
break;
default:
transform = CGAffineTransformIdentity;
break;
}
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.2f];
endCtrl.imageView.transform = transform;
mute.imageView.transform = transform;
speaker.imageView.transform = transform;
pause.imageView.transform = transform;
contacts.imageView.transform = transform;
addCall.imageView.transform = transform;
addVideo.imageView.transform = transform;
dialer.imageView.transform = transform;
videoCallQuality.transform = transform;
[UIView commitAnimations];
}
}
}
-(void) showControls:(id)sender {
if (hideControlsTimer) {
[hideControlsTimer invalidate];
hideControlsTimer = nil;
}
// show controls
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.3];
[controlSubView setAlpha:1.0];
[hangUpView setAlpha:1.0];
if ([LinphoneManager instance].frontCamId !=nil ) {
// only show camera switch button if we have more than 1 camera
[videoCameraSwitch setAlpha:1.0];
}
[UIView commitAnimations];
// hide controls in 5 sec
hideControlsTimer = [NSTimer scheduledTimerWithTimeInterval:5.0 target:self selector:@selector(hideControls:) userInfo:nil repeats:NO];
}
-(void) hideControls:(id)sender {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.3];
[controlSubView setAlpha:0.0];
[hangUpView setAlpha:0.0];
[videoCameraSwitch setAlpha:0.0];
[UIView commitAnimations];
hideControlsTimer = nil;
}
-(void) batteryLevelChanged: (NSNotification*) notif {
LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]);
if (!call || !linphone_call_params_video_enabled(linphone_call_get_current_params(call)))
return;
LinphoneCallAppData* appData = (LinphoneCallAppData*) linphone_call_get_user_pointer(call);
if ([UIDevice currentDevice].batteryState == UIDeviceBatteryStateUnplugged) {
float level = [UIDevice currentDevice].batteryLevel;
ms_message("Video call is running. Battery level: %.2f", level);
if (level < 0.1 && !appData->batteryWarningShown) {
// notify user
CallDelegate* cd = [[CallDelegate alloc] init];
cd.eventType = CD_STOP_VIDEO_ON_LOW_BATTERY;
cd.delegate = self;
cd.call = call;
if (visibleActionSheet != nil) {
[visibleActionSheet dismissWithClickedButtonIndex:visibleActionSheet.cancelButtonIndex animated:TRUE];
}
NSString* title = NSLocalizedString(@"Battery is running low. Stop video ?",nil);
visibleActionSheet = [[UIActionSheet alloc] initWithTitle:title
delegate:cd
cancelButtonTitle:NSLocalizedString(@"Continue video",nil)
destructiveButtonTitle:NSLocalizedString(@"Stop video",nil)
otherButtonTitles:nil];
visibleActionSheet.actionSheetStyle = UIActionSheetStyleDefault;
[visibleActionSheet showInView:self.view];
appData->batteryWarningShown = TRUE;
}
}
}
-(void) enableVideoDisplay {
[self orientationChanged:nil];
[videoZoomHandler resetZoom];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
[videoGroup setAlpha:1.0];
[controlSubView setAlpha:0.0];
[hangUpView setAlpha:0.0];
[callTableView setAlpha:0.0];
[UIView commitAnimations];
videoView.alpha = 1.0;
videoView.hidden = FALSE;
linphone_core_set_native_video_window_id([LinphoneManager getLc],(unsigned long)videoView);
linphone_core_set_native_preview_window_id([LinphoneManager getLc],(unsigned long)videoPreview);
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];
// This is a bit hacky: take into account toolbar removal (only once).
// It's probably possible to do this from the Xib file (?)
static bool done = false;
if (!done) {
ms_message("old center: %f %f", videoView.center.x, videoView.center.y);
videoView.center = CGPointMake(videoView.center.x, videoView.center.y + (self.view.frame.size.height - videoView.window.frame.size.height));
ms_message("new center: %f %f", videoView.center.x, videoView.center.y);
done = true;
}
[self batteryLevelChanged:nil];
}
-(void) disableVideoDisplay {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
[videoGroup setAlpha:0.0];
[controlSubView setAlpha:1.0];
[hangUpView setAlpha:1.0];
[callTableView setAlpha:1.0];
[videoCameraSwitch setAlpha:0.0];
[UIView commitAnimations];
if (hideControlsTimer != nil) {
[hideControlsTimer invalidate];
hideControlsTimer = nil;
}
/* restore buttons orientation */
endCtrl.imageView.transform = CGAffineTransformIdentity;
mute.imageView.transform = CGAffineTransformIdentity;
speaker.imageView.transform = CGAffineTransformIdentity;
pause.imageView.transform = CGAffineTransformIdentity;
contacts.imageView.transform = CGAffineTransformIdentity;
addCall.imageView.transform = CGAffineTransformIdentity;
dialer.imageView.transform = CGAffineTransformIdentity;
videoCallQuality.transform = CGAffineTransformIdentity;
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
}
/* Update in call view buttons (visibility, state, ...) and call duration text.
This is called periodically. The fullUpdate boolean is set when called after an event (call state change for instance) */
-(void) updateUIFromLinphoneState:(BOOL) fullUpdate {
activeCallCell = nil;
[mute reset];
LinphoneCore* lc;
// check LinphoneCore is initialized
LinphoneCore* lc = nil;
@try {
lc = [LinphoneManager getLc];
[LinphoneManager set:pause hidden:(callCount([LinphoneManager getLc]) > 1) withName:"PAUSE button" andReason:"call count"];
[LinphoneManager set:mergeCalls hidden:!pause.hidden withName:"MERGE button" andReason:"call count"];
[callTableView reloadData];
} @catch (NSException* exc) {
return;
}
LinphoneCall* selectedCall = linphone_core_get_current_call([LinphoneManager getLc]);
// 1 call: show pause button, otherwise show merge btn
[LinphoneManager set:pause hidden:(callCount(lc) > 1) withName:"PAUSE button" andReason:"call count"];
[LinphoneManager set:mergeCalls hidden:!pause.hidden withName:"MERGE button" andReason:"call count"];
// reload table (glow update + call duration)
[callTableView reloadData];
LinphoneCall* currentCall = linphone_core_get_current_call([LinphoneManager getLc]);
int callsCount = linphone_core_get_calls_nb(lc);
// hide pause/resume if in conference
if (selectedCall) {
if (currentCall) {
[mute reset];
if (linphone_core_is_in_conference(lc)) {
[LinphoneManager set:pause hidden:YES withName:"PAUSE button" andReason:"is in conference"];
}
@ -134,6 +334,23 @@ int callCount(LinphoneCore* lc) {
} else {
[LinphoneManager set:pause hidden:YES withName:"PAUSE button" andReason:AT];
}
if (fullUpdate) {
videoUpdateIndicator.hidden = YES;
LinphoneCallState state = linphone_call_get_state(currentCall);
if (state == LinphoneCallStreamsRunning || state == LinphoneCallUpdated || state == LinphoneCallUpdatedByRemote) {
if (linphone_call_params_video_enabled(linphone_call_get_current_params(currentCall))) {
[addVideo setTitle:NSLocalizedString(@"-video", nil) forState:UIControlStateNormal];
[IncallViewController updateIndicator: videoCallQuality withCallQuality:linphone_call_get_average_quality(currentCall)];
} else {
[addVideo setTitle:NSLocalizedString(@"+video", nil) forState:UIControlStateNormal];
}
[addVideo setEnabled:YES];
} else {
[addVideo setEnabled:NO];
[videoCallQuality setImage:nil];
}
}
} else {
if (callsCount == 1) {
LinphoneCall* c = (LinphoneCall*)linphone_core_get_calls(lc)->data;
@ -145,10 +362,11 @@ int callCount(LinphoneCore* lc) {
} else {
[LinphoneManager set:pause hidden:YES withName:"PAUSE button" andReason:AT];
}
[addVideo setEnabled:NO];
}
[LinphoneManager set:mergeCalls hidden:!pause.hidden withName:"MERGE button" andReason:AT];
// update conference details view if diaplsyed
// update conference details view if displayed
if (self.presentedViewController == conferenceDetail) {
if (!linphone_core_is_in_conference(lc))
[self dismissModalViewControllerAnimated:YES];
@ -201,6 +419,15 @@ int callCount(LinphoneCore* lc) {
}
UITapGestureRecognizer* singleFingerTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showControls:)];
[singleFingerTap setNumberOfTapsRequired:1];
[videoGroup addGestureRecognizer:singleFingerTap];
[singleFingerTap release];
videoZoomHandler = [[VideoZoomHandler alloc] init];
[videoZoomHandler setup:videoGroup];
videoGroup.alpha = 0;
mVideoShown=FALSE;
mIncallViewIsReady=FALSE;
mVideoIsPending=FALSE;
@ -208,11 +435,90 @@ int callCount(LinphoneCore* lc) {
callTableView.rowHeight = 80;
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged:) name:UIDeviceOrientationDidChangeNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(batteryLevelChanged:) name:UIDeviceBatteryLevelDidChangeNotification object:nil];
[videoCameraSwitch setPreview:videoPreview];
addVideo.videoUpdateIndicator = videoUpdateIndicator;
[transfer addTarget:self action:@selector(transferPressed) forControlEvents:UIControlEventTouchUpInside];
// prevent buttons resizing
/*
endCtrl.imageView.contentMode = UIViewContentModeCenter;
mute.imageView.contentMode = UIViewContentModeCenter;
speaker.imageView.contentMode = UIViewContentModeCenter;
pause.imageView.contentMode = UIViewContentModeCenter;
contacts.imageView.contentMode = UIViewContentModeCenter;
addCall.imageView.contentMode = UIViewContentModeCenter;
dialer.imageView.contentMode = UIViewContentModeCenter;*/
}
-(void) transferPressed {
/* allow only if call is active */
if (!linphone_core_get_current_call([LinphoneManager getLc]))
return;
/* build UIActionSheet */
if (visibleActionSheet != nil) {
[visibleActionSheet dismissWithClickedButtonIndex:visibleActionSheet.cancelButtonIndex animated:TRUE];
}
CallDelegate* cd = [[CallDelegate alloc] init];
cd.eventType = CD_TRANSFER_CALL;
cd.delegate = self;
cd.call = linphone_core_get_current_call([LinphoneManager getLc]);
NSString* title = NSLocalizedString(@"Transfer to ...",nil);
visibleActionSheet = [[UIActionSheet alloc] initWithTitle:title
delegate:cd
cancelButtonTitle:nil
destructiveButtonTitle:nil // NSLocalizedString(@"Other...",nil)
otherButtonTitles:nil];
// add button for each trasnfer-to valid call
const MSList* calls = linphone_core_get_calls([LinphoneManager getLc]);
while (calls) {
LinphoneCall* call = (LinphoneCall*) calls->data;
LinphoneCallAppData* data = ((LinphoneCallAppData*)linphone_call_get_user_pointer(call));
if (call != cd.call && !linphone_call_get_current_params(call)->in_conference) {
const LinphoneAddress* addr = linphone_call_get_remote_address(call);
NSString* btnTitle = [NSString stringWithFormat : NSLocalizedString(@"%s",nil), (linphone_address_get_display_name(addr) ?linphone_address_get_display_name(addr):linphone_address_get_username(addr))];
data->transferButtonIndex = [visibleActionSheet addButtonWithTitle:btnTitle];
} else {
data->transferButtonIndex = -1;
}
calls = calls->next;
}
if (visibleActionSheet.numberOfButtons == 0) {
[visibleActionSheet release];
visibleActionSheet = nil;
[UICallButton enableTransforMode:YES];
[[LinphoneManager instance] displayDialer];
} else {
// add 'Other' option
[visibleActionSheet addButtonWithTitle:NSLocalizedString(@"Other...",nil)];
// add cancel button on iphone
if (![LinphoneManager runningOnIpad]) {
[visibleActionSheet addButtonWithTitle:NSLocalizedString(@"Cancel",nil)];
}
visibleActionSheet.actionSheetStyle = UIActionSheetStyleDefault;
if ([LinphoneManager runningOnIpad])
[visibleActionSheet showFromRect:transfer.bounds inView:transfer animated:NO];
else
[visibleActionSheet showInView:self.view];
}
}
-(void) addCallPressed {
[LinphoneManager logUIElementPressed:"CALL button"];
[self dismissModalViewControllerAnimated:true];
[[LinphoneManager instance] displayDialer];
}
@ -231,6 +537,9 @@ int callCount(LinphoneCore* lc) {
if (linphone_call_get_state(currentCall) == LinphoneCallStreamsRunning) {
[pause setSelected:NO];
linphone_core_pause_call(lc, currentCall);
// hide video view
[self disableVideoDisplay];
}
} else {
if (linphone_core_get_calls_nb(lc) == 1) {
@ -238,6 +547,11 @@ int callCount(LinphoneCore* lc) {
if (linphone_call_get_state(c) == LinphoneCallPaused) {
linphone_core_resume_call(lc, c);
[pause setSelected:YES];
const LinphoneCallParams* p = linphone_call_get_current_params(c);
if (linphone_call_params_video_enabled(p)) {
[self enableVideoDisplay];
}
}
}
}
@ -245,10 +559,13 @@ int callCount(LinphoneCore* lc) {
-(void)updateCallsDurations {
[self updateUIFromLinphoneState: nil];
[self updateUIFromLinphoneState: NO];
}
-(void) viewWillAppear:(BOOL)animated {}
-(void) awakeFromNib
{
}
-(void)viewDidAppear:(BOOL)animated {
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
@ -282,17 +599,16 @@ int callCount(LinphoneCore* lc) {
if ([device respondsToSelector:@selector(isMultitaskingSupported)]
&& [device isMultitaskingSupported]) {
bool enableVideo = [[NSUserDefaults standardUserDefaults] boolForKey:@"enable_video_preference"];
bool startVideo = [[NSUserDefaults standardUserDefaults] boolForKey:@"start_video_preference"];
[LinphoneManager set:contacts hidden:(enableVideo && !startVideo) withName:"CONTACT button" andReason:AT];
[LinphoneManager set:contacts hidden:enableVideo withName:"CONTACT button" andReason:AT];
[LinphoneManager set:addVideo hidden:!contacts.hidden withName:"ADD_VIDEO button" andReason:AT];
}
}
}
-(void) viewWillDisappear:(BOOL)animated {
if (zrtpVerificationSheet != nil) {
[zrtpVerificationSheet dismissWithClickedButtonIndex:2 animated:NO];
if (visibleActionSheet != nil) {
[visibleActionSheet dismissWithClickedButtonIndex:visibleActionSheet.cancelButtonIndex animated:NO];
}
}
@ -305,6 +621,7 @@ int callCount(LinphoneCore* lc) {
}
if (!mVideoShown) [[UIApplication sharedApplication] setIdleTimerDisabled:false];
mIncallViewIsReady=FALSE;
dismissed = false;
}
- (void)viewDidUnload {
@ -319,31 +636,27 @@ int callCount(LinphoneCore* lc) {
}
-(void) displayPad:(bool) enable {
[LinphoneManager set:callTableView hidden:enable withName:"CALL_TABLE view" andReason:AT];
if (videoView.hidden)
[LinphoneManager set:callTableView hidden:enable withName:"CALL_TABLE view" andReason:AT];
[LinphoneManager set:hangUpView hidden:enable withName:"HANG_UP view" andReason:AT];
[LinphoneManager set:controlSubView hidden:enable withName:"CONTROL view" andReason:AT];
[LinphoneManager set:padSubView hidden:!enable withName:"PAD view" andReason:AT];
}
-(void) displayCall:(LinphoneCall*) call InProgressFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName {
//restaure view
//restore view
[self displayPad:false];
dismissed = false;
UIDevice *device = [UIDevice currentDevice];
device.proximityMonitoringEnabled = YES;
if ([speaker isOn])
[speaker toggle];
[self updateUIFromLinphoneState: nil];
[self updateUIFromLinphoneState: YES];
}
-(void) displayIncomingCall:(LinphoneCall *)call NotificationFromUI:(UIViewController *)viewCtrl forUser:(NSString *)username withDisplayName:(NSString *)displayName {
}
-(void) dismissVideoView {
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
[self dismissModalViewControllerAnimated:FALSE];//just in case
mVideoShown=FALSE;
}
-(void) displayInCall:(LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName {
dismissed = false;
UIDevice *device = [UIDevice currentDevice];
@ -351,15 +664,16 @@ int callCount(LinphoneCore* lc) {
if (call !=nil && linphone_call_get_dir(call)==LinphoneCallIncoming) {
if ([speaker isOn]) [speaker toggle];
}
[self updateUIFromLinphoneState: nil];
if (self.presentedViewController == (UIViewController*)mVideoViewController) {
[self dismissVideoView];
}
[self updateUIFromLinphoneState: YES];
[self disableVideoDisplay];
}
-(void) displayDialerFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName {
[self disableVideoDisplay];
UIViewController* modalVC = self.modalViewController;
UIDevice *device = [UIDevice currentDevice];
device.proximityMonitoringEnabled = NO;
dismissed = true;
if (modalVC != nil) {
mVideoIsPending=FALSE;
// clear previous native window ids
@ -373,10 +687,37 @@ int callCount(LinphoneCore* lc) {
}
[self dismissModalViewControllerAnimated:FALSE]; //disable animation to avoid blanc bar just below status bar*/
dismissed = true;
[self updateUIFromLinphoneState: nil];
[self updateUIFromLinphoneState: YES];
}
static void hideSpinner(LinphoneCall* lc, void* user_data);
-(void) hideSpinnerIndicator: (LinphoneCall*)call {
if (!videoWaitingForFirstImage.hidden) {
videoWaitingForFirstImage.hidden = TRUE;
} /*else {
linphone_call_set_next_video_frame_decoded_callback(call, hideSpinner, self);
}*/
}
static void hideSpinner(LinphoneCall* call, void* user_data) {
IncallViewController* thiz = (IncallViewController*) user_data;
[thiz hideSpinnerIndicator:call];
}
-(void) displayVideoCall:(LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName {
[self enableVideoDisplay];
[self updateUIFromLinphoneState: YES];
videoWaitingForFirstImage.hidden = NO;
[videoWaitingForFirstImage startAnimating];
if (call->videostream) {
linphone_call_set_next_video_frame_decoded_callback(call, hideSpinner, self);
}
return;
if (mIncallViewIsReady) {
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
mVideoShown=TRUE;
@ -385,11 +726,51 @@ int callCount(LinphoneCore* lc) {
else
ms_message("Do not present again videoViewController");
} else {
//postepone presentation
//postpone presentation
mVideoIsPending=TRUE;
}
}
-(void) dismissActionSheet: (id)o {
if (visibleActionSheet != nil) {
[visibleActionSheet dismissWithClickedButtonIndex:visibleActionSheet.cancelButtonIndex animated:TRUE];
visibleActionSheet = nil;
}
}
-(void) displayAskToEnableVideoCall:(LinphoneCall*) call forUser:(NSString*) username withDisplayName:(NSString*) displayName {
if (linphone_core_get_video_policy([LinphoneManager getLc])->automatically_accept)
return;
// ask the user if he agrees
CallDelegate* cd = [[CallDelegate alloc] init];
cd.eventType = CD_VIDEO_UPDATE;
cd.delegate = self;
cd.call = call;
if (visibleActionSheet != nil) {
[visibleActionSheet dismissWithClickedButtonIndex:visibleActionSheet.cancelButtonIndex animated:TRUE];
}
NSString* title = [NSString stringWithFormat : NSLocalizedString(@"'%@' would like to enable video",nil), ([displayName length] > 0) ?displayName:username];
visibleActionSheet = [[UIActionSheet alloc] initWithTitle:title
delegate:cd
cancelButtonTitle:NSLocalizedString(@"Decline",nil)
destructiveButtonTitle:NSLocalizedString(@"Accept",nil)
otherButtonTitles:nil];
visibleActionSheet.actionSheetStyle = UIActionSheetStyleDefault;
[visibleActionSheet showInView:self.view];
/* start cancel timer */
cd.timeout = [NSTimer scheduledTimerWithTimeInterval:30 target:self selector:@selector(dismissActionSheet:) userInfo:nil repeats:NO];
[visibleActionSheet release];
}
-(void) firstVideoFrameDecoded: (LinphoneCall*) call {
// hide video in progress view indicator
videoWaitingForFirstImage.hidden = TRUE;
}
- (IBAction)doAction:(id)sender {
if (sender == dialer) {
@ -497,6 +878,8 @@ int callCount(LinphoneCore* lc) {
}
const LinphoneAddress* addr = linphone_call_get_remote_address(call);
label.adjustsFontSizeToFitWidth = YES;
if (addr) {
const char* lUserNameChars=linphone_address_get_username(addr);
NSString* lUserName = lUserNameChars?[[[NSString alloc] initWithUTF8String:lUserNameChars] autorelease]:NSLocalizedString(@"Unknown",nil);
@ -540,10 +923,27 @@ int callCount(LinphoneCore* lc) {
[ms appendFormat:@"%@...", NSLocalizedString(@"Ringing...", nil), nil];
break;
case LinphoneCallPausedByRemote:
[ms appendFormat:@"%@...", NSLocalizedString(@"Paused by remote", nil), nil];
{
switch (linphone_call_get_transfer_state(call)) {
case LinphoneCallOutgoingInit:
case LinphoneCallOutgoingProgress:
[ms appendFormat:@"%@...", NSLocalizedString(@"Transfer in progress", nil), nil];
break;
case LinphoneCallConnected:
[ms appendFormat:@"%@", NSLocalizedString(@"Transfer successful", nil), nil];
break;
case LinphoneCallError:
[ms appendFormat:@"%@", NSLocalizedString(@"Transfer failed", nil), nil];
break;
case LinphoneCallIdle:
default:
[ms appendFormat:@"%@...", NSLocalizedString(@"Paused by remote", nil), nil];
break;
}
break;
default:
break;
}
}
}
[detailLabel setText:ms];
@ -605,10 +1005,10 @@ int callCount(LinphoneCore* lc) {
cell.accessoryType = UITableViewCellAccessoryNone;
} else {
LinphoneCall* call = [IncallViewController retrieveCallAtIndex:indexPath.row inConference:NO];
if (call == nil)
return cell; // return dummy cell
LinphoneMediaEncryption enc = linphone_call_params_get_media_encryption(linphone_call_get_current_params(call));
if (call == nil)
return nil;
if (cell.accessoryView == nil) {
if (cell.accessoryView == nil) {
UIView *containerView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 28, 28)] autorelease];
cell.accessoryView = containerView;
}
@ -627,21 +1027,7 @@ int callCount(LinphoneCore* lc) {
[callquality setFrame:CGRectMake(0, 0, 28, 28)];
if (call->state == LinphoneCallStreamsRunning)
{
if (linphone_call_get_average_quality(call) >= 4) {
[callquality setImage: [IncallViewController stat_sys_signal_4]];
}
else if (linphone_call_get_average_quality(call) >= 3) {
[callquality setImage: [IncallViewController stat_sys_signal_3]];
}
else if (linphone_call_get_average_quality(call) >= 2) {
[callquality setImage: [IncallViewController stat_sys_signal_2]];
}
else if (linphone_call_get_average_quality(call) >= 1) {
[callquality setImage: [IncallViewController stat_sys_signal_1]];
}
else {
[callquality setImage: [IncallViewController stat_sys_signal_0]];
}
[IncallViewController updateIndicator: callquality withCallQuality:linphone_call_get_average_quality(call)];
}
else {
[callquality setImage:nil];
@ -686,33 +1072,94 @@ int callCount(LinphoneCore* lc) {
LinphoneCall* call = [IncallViewController retrieveCallAtIndex:path.row inConference:NO];
// start action sheet to validate/unvalidate zrtp code
CallDelegate* cd = [[CallDelegate alloc] init];
cd.eventType = CD_ZRTP;
cd.delegate = self;
cd.call = call;
UIView* container=(UIView*)[callTableView cellForRowAtIndexPath:path].accessoryView;
UIButton *button=(UIButton*)[container viewWithTag:SECURE_BUTTON_TAG];
[button setImage:nil forState:UIControlStateNormal];
zrtpVerificationSheet = [[UIActionSheet alloc] initWithTitle:[NSString stringWithFormat:NSLocalizedString(@" Mark auth token '%s' as:",nil),linphone_call_get_authentication_token(call)]
if (visibleActionSheet != nil) {
[visibleActionSheet dismissWithClickedButtonIndex:visibleActionSheet.cancelButtonIndex animated:TRUE];
}
visibleActionSheet = [[UIActionSheet alloc] initWithTitle:[NSString stringWithFormat:NSLocalizedString(@" Mark auth token '%s' as:",nil),linphone_call_get_authentication_token(call)]
delegate:cd
cancelButtonTitle:NSLocalizedString(@"Unverified",nil)
destructiveButtonTitle:NSLocalizedString(@"Verified",nil)
otherButtonTitles:nil];
zrtpVerificationSheet.actionSheetStyle = UIActionSheetStyleDefault;
[zrtpVerificationSheet showInView:self.view];
[zrtpVerificationSheet release];
visibleActionSheet.actionSheetStyle = UIActionSheetStyleDefault;
[visibleActionSheet showInView:self.view];
[visibleActionSheet release];
}
}
-(void) actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex withUserDatas:(void *)datas {
-(void) actionSheet:(UIActionSheet *)actionSheet ofType:(enum CallDelegateType)type clickedButtonAtIndex:(NSInteger)buttonIndex withUserDatas:(void *)datas {
LinphoneCall* call = (LinphoneCall*)datas;
// maybe we could verify call validity
if (buttonIndex == 0)
linphone_call_set_authentication_token_verified(call, YES);
else if (buttonIndex == 1)
linphone_call_set_authentication_token_verified(call, NO);
zrtpVerificationSheet = nil;
switch (type) {
case CD_ZRTP: {
if (buttonIndex == 0)
linphone_call_set_authentication_token_verified(call, YES);
else if (buttonIndex == 1)
linphone_call_set_authentication_token_verified(call, NO);
visibleActionSheet = nil;
break;
}
case CD_VIDEO_UPDATE: {
LinphoneCall* call = (LinphoneCall*)datas;
LinphoneCallParams* paramsCopy = linphone_call_params_copy(linphone_call_get_current_params(call));
if ([visibleActionSheet destructiveButtonIndex] == buttonIndex) {
// accept video
linphone_call_params_enable_video(paramsCopy, TRUE);
linphone_core_accept_call_update([LinphoneManager getLc], call, paramsCopy);
} else {
// decline video
ms_message("User declined video proposal");
linphone_core_accept_call_update([LinphoneManager getLc], call, NULL);
}
linphone_call_params_destroy(paramsCopy);
visibleActionSheet = nil;
break;
}
case CD_STOP_VIDEO_ON_LOW_BATTERY: {
LinphoneCall* call = (LinphoneCall*)datas;
LinphoneCallParams* paramsCopy = linphone_call_params_copy(linphone_call_get_current_params(call));
if ([visibleActionSheet destructiveButtonIndex] == buttonIndex) {
// stop video
linphone_call_params_enable_video(paramsCopy, FALSE);
linphone_core_update_call([LinphoneManager getLc], call, paramsCopy);
}
break;
}
case CD_TRANSFER_CALL: {
LinphoneCall* call = (LinphoneCall*)datas;
// browse existing call and trasnfer to the one matching the btn id
const MSList* calls = linphone_core_get_calls([LinphoneManager getLc]);
while (calls) {
LinphoneCall* call2 = (LinphoneCall*) calls->data;
LinphoneCallAppData* data = ((LinphoneCallAppData*)linphone_call_get_user_pointer(call2));
if (data->transferButtonIndex == buttonIndex) {
linphone_core_transfer_call_to_another([LinphoneManager getLc], call, call2);
return;
}
data->transferButtonIndex = -1;
calls = calls->next;
}
if (![LinphoneManager runningOnIpad] && buttonIndex == (actionSheet.numberOfButtons - 1)) {
// cancel button
return;
}
// user must jhave pressed 'other...' button as we did not find a call
// with the correct indice
[UICallButton enableTransforMode:YES];
[[LinphoneManager instance] displayDialer];
break;
}
default:
ms_error("Unhandled CallDelegate event of type: %d received - ignoring", type);
}
}
// UITableViewDataSource (required)
@ -779,8 +1226,7 @@ int callCount(LinphoneCore* lc) {
linphone_core_resume_call([LinphoneManager getLc], selectedCall);
}
[self updateUIFromLinphoneState: nil];
[self updateUIFromLinphoneState: YES];
}
@end

File diff suppressed because it is too large Load diff

View file

@ -44,6 +44,12 @@
CTCallCenter* callCenter;
}
- (void) loadDefaultSettings:(NSDictionary *) appDefaults;
-(void) setupUI;
-(void) setupGSMInteraction;
-(void) startApplication;
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UITabBarController* myTabBarController;
@property (nonatomic, retain) ABPeoplePickerNavigationController* myPeoplePickerController;

View file

@ -94,6 +94,15 @@ int __aeabi_idiv(int a, int b) {
}
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
if ([[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)]
&& [UIApplication sharedApplication].applicationState == UIApplicationStateBackground
&& [[NSUserDefaults standardUserDefaults] boolForKey:@"disable_autoboot_preference"]) {
// autoboot disabled, doing nothing
return;
} else if ([LinphoneManager instance] == nil) {
[self startApplication];
}
[[LinphoneManager instance] becomeActive];
if (callCenter == nil) {
@ -125,7 +134,7 @@ int __aeabi_idiv(int a, int b) {
}
}
- (void) loadDefaultSettings {
- (void) loadDefaultSettings:(NSDictionary *) appDefaults {
NSString *settingsBundle = [[NSBundle mainBundle] pathForResource:@"Settings" ofType:@"bundle"];
if(!settingsBundle) {
@ -136,10 +145,12 @@ int __aeabi_idiv(int a, int b) {
NSMutableDictionary *rootSettings = [NSDictionary dictionaryWithContentsOfFile:[settingsBundle stringByAppendingPathComponent:@"Root.plist"]];
NSMutableDictionary *audioSettings = [NSDictionary dictionaryWithContentsOfFile:[settingsBundle stringByAppendingPathComponent:@"audio.plist"]];
NSMutableDictionary *videoSettings = [NSDictionary dictionaryWithContentsOfFile:[settingsBundle stringByAppendingPathComponent:@"video.plist"]];
NSMutableDictionary *advancedSettings = [NSDictionary dictionaryWithContentsOfFile:[settingsBundle stringByAppendingPathComponent:@"Advanced.plist"]];
NSMutableArray *preferences = [rootSettings objectForKey:@"PreferenceSpecifiers"];
[preferences addObjectsFromArray:[audioSettings objectForKey:@"PreferenceSpecifiers"]];
[preferences addObjectsFromArray:[videoSettings objectForKey:@"PreferenceSpecifiers"]];
[preferences addObjectsFromArray:[advancedSettings objectForKey:@"PreferenceSpecifiers"]];
NSMutableDictionary *defaultsToRegister = [[NSMutableDictionary alloc] initWithCapacity:[preferences count]];
@ -149,33 +160,14 @@ int __aeabi_idiv(int a, int b) {
[defaultsToRegister setObject:[prefSpecification objectForKey:@"DefaultValue"] forKey:key];
}
}
NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:
@"NO", @"enable_first_login_view_preference", //
#ifdef HAVE_AMR
@"YES",@"amr_8k_preference", // enable amr by default if compiled with
#endif
#ifdef HAVE_G729
@"YES",@"g729_preference", // enable amr by default if compiled with
#endif
@"NO",@"debugenable_preference",
//@"+33",@"countrycode_preference",
nil];
[defaultsToRegister addEntriesFromDictionary:appDefaults];
[[NSUserDefaults standardUserDefaults] registerDefaults:defaultsToRegister];
[defaultsToRegister release];
[[NSUserDefaults standardUserDefaults] synchronize];
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
/*
*Custumization
*/
[self loadDefaultSettings];
//as defined in PhoneMainView.xib
-(void) setupUI {
//as defined in PhoneMainView.xib
//dialer
myPhoneViewController = (PhoneViewController*) [myTabBarController.viewControllers objectAtIndex: DIALER_TAB_INDEX];
myPhoneViewController.myTabBarController = myTabBarController;
@ -217,18 +209,57 @@ int __aeabi_idiv(int a, int b) {
[window makeKeyAndVisible];
[[LinphoneManager instance] setCallDelegate:myPhoneViewController];
[[LinphoneManager instance] startLibLinphone];
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound];
[UIDevice currentDevice].batteryMonitoringEnabled = YES;
}
-(void) setupGSMInteraction {
callCenter = [[CTCallCenter alloc] init];
callCenter.callEventHandler = ^(CTCall* call) {
// post on main thread
[self performSelectorOnMainThread:@selector(handleGSMCallInteration:)
withObject:callCenter
waitUntilDone:YES];
};
return YES;
};
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:
@"NO", @"enable_first_login_view_preference", //
#ifdef HAVE_AMR
@"YES",@"amr_8k_preference", // enable amr by default if compiled with
#endif
#ifdef HAVE_G729
@"YES",@"g729_preference", // enable amr by default if compiled with
#endif
//@"+33",@"countrycode_preference",
nil];
[self loadDefaultSettings: appDefaults];
if ([[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)]
&& [UIApplication sharedApplication].applicationState == UIApplicationStateBackground
&& [[NSUserDefaults standardUserDefaults] boolForKey:@"disable_autoboot_preference"]) {
// autoboot disabled, doing nothing
} else {
[self startApplication];
}
return YES;
}
-(void) startApplication {
/* explicitely instanciate LinphoneManager */
LinphoneManager* lm = [[LinphoneManager alloc] init];
assert(lm == [LinphoneManager instance]);
[self setupUI];
[[LinphoneManager instance] startLibLinphone];
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound];
[self setupGSMInteraction];
}

View file

@ -23,6 +23,7 @@
#include "linphonecore.h"
#import "LogView.h"
#import "LinphoneUIDelegates.h"
typedef enum _Connectivity {
wifi,
wwan
@ -43,10 +44,22 @@ typedef struct _CallContext {
bool_t cameraIsEnabled;
} CallContext;
struct NetworkReachabilityContext {
bool_t testWifi, testWWan;
void (*networkStateChanged) (Connectivity newConnectivity);
};
typedef struct _LinphoneCallAppData {
bool_t batteryWarningShown;
// transfer data
int transferButtonIndex;
} LinphoneCallAppData;
@interface LinphoneManager : NSObject <AVAudioSessionDelegate> {
@private
SCNetworkReachabilityContext proxyReachabilityContext;
@protected
SCNetworkReachabilityRef proxyReachability;
@private
NSTimer* mIterateTimer;
id<LogView> mLogView;
bool isbackgroundModeEnabled;
@ -69,6 +82,8 @@ typedef struct _CallContext {
+(void) set:(UIView*)view hidden: (BOOL) hidden withName:(const char*)name andReason:(const char*) reason;
+(void) logUIElementPressed:(const char*) name;
-(void) displayDialer;
-(void) registerLogView:(id<LogView>) view;
-(void) startLibLinphone;
@ -82,6 +97,7 @@ typedef struct _CallContext {
-(UIImage*) getImageFromAddressBook:(NSString*) number;
-(BOOL) reconfigureLinphoneIfNeeded:(NSDictionary *)oldSettings;
-(void) setupNetworkReachabilityCallback: (const char*) nodeName withContext:(SCNetworkReachabilityContext*) ctx;
@property (nonatomic, retain) id<LinphoneUICallDelegate> callDelegate;
@property (nonatomic, retain) id<LinphoneUIRegistrationDelegate> registrationDelegate;
@ -92,4 +108,3 @@ typedef struct _CallContext {
@end

View file

@ -62,30 +62,18 @@ extern void libmsbcg729_init();
@synthesize backCamId;
-(id) init {
assert (!theLinphoneManager);
if ((self= [super init])) {
mFastAddressBook = [[FastAddressBook alloc] init];
tunnelMode = off;
theLinphoneManager = self;
}
return self;
}
+(LinphoneManager*) instance {
if (theLinphoneManager==nil) {
theLinphoneManager = [[LinphoneManager alloc] init];
}
return theLinphoneManager;
}
-(NSString*) appendCountryCodeIfPossible:(NSString*) number {
if (![number hasPrefix:@"+"] && ![number hasPrefix:@"00"]) {
NSString* lCountryCode = [[NSUserDefaults standardUserDefaults] stringForKey:@"countrycode_preference"];
if (lCountryCode && [lCountryCode length]>0) {
//append country code
return [lCountryCode stringByAppendingString:number];
}
}
return number;
}
-(NSString*) getDisplayNameFromAddressBook:(NSString*) number andUpdateCallLog:(LinphoneCallLog*)log {
//1 normalize
NSString* lNormalizedNumber = [FastAddressBook normalizePhoneNumber:number];
@ -156,6 +144,7 @@ extern void libmsbcg729_init();
[lE164Number release];
return;
}
-(void) onCall:(LinphoneCall*) call StateChanged: (LinphoneCallState) new_state withMessage: (const char *) message {
const char* lUserNameChars=linphone_address_get_username(linphone_call_get_remote_address(call));
NSString* lUserName = lUserNameChars?[[[NSString alloc] initWithUTF8String:lUserNameChars] autorelease]:NSLocalizedString(@"Unknown",nil);
@ -167,17 +156,13 @@ extern void libmsbcg729_init();
bool canHideInCallView = (linphone_core_get_calls([LinphoneManager getLc]) == NULL);
switch (new_state) {
case LinphoneCallStreamsRunning:
//check video
if (linphone_call_params_video_enabled(linphone_call_get_current_params(call))) {
[callDelegate displayVideoCall:call FromUI:mCurrentViewController
forUser:lUserName
withDisplayName:lDisplayName];
}
break;
if (!linphone_call_get_user_pointer(call)) {
LinphoneCallAppData* data = (LinphoneCallAppData*) malloc(sizeof(LinphoneCallAppData));
data->batteryWarningShown = FALSE;
linphone_call_set_user_pointer(call, data);
}
switch (new_state) {
case LinphoneCallIncomingReceived:
[callDelegate displayIncomingCall:call
NotificationFromUI:mCurrentViewController
@ -191,14 +176,38 @@ extern void libmsbcg729_init();
forUser:lUserName
withDisplayName:lDisplayName];
break;
case LinphoneCallPausedByRemote:
case LinphoneCallConnected:
[callDelegate displayInCall: call
FromUI:mCurrentViewController
forUser:lUserName
withDisplayName:lDisplayName];
break;
case LinphoneCallUpdatedByRemote:
{
const LinphoneCallParams* current = linphone_call_get_current_params(call);
const LinphoneCallParams* remote = linphone_call_get_remote_params(call);
/* remote wants to add video */
if (!linphone_call_params_video_enabled(current) && linphone_call_params_video_enabled(remote) && !linphone_core_get_video_policy(theLinphoneCore)->automatically_accept) {
linphone_core_defer_call_update(theLinphoneCore, call);
[callDelegate displayAskToEnableVideoCall:call forUser:lUserName withDisplayName:lDisplayName];
} else if (linphone_call_params_video_enabled(current) && !linphone_call_params_video_enabled(remote)) {
[callDelegate displayInCall:call FromUI:mCurrentViewController forUser:lUserName withDisplayName:lDisplayName];
}
break;
}
case LinphoneCallUpdated:
{
const LinphoneCallParams* current = linphone_call_get_current_params(call);
if (linphone_call_params_video_enabled(current)) {
[callDelegate displayVideoCall:call FromUI:mCurrentViewController forUser:lUserName withDisplayName:lDisplayName];
} else {
[callDelegate displayInCall:call FromUI:mCurrentViewController forUser:lUserName withDisplayName:lDisplayName];
}
break;
}
case LinphoneCallError: {
/*
NSString* lTitle= state->message!=nil?[NSString stringWithCString:state->message length:strlen(state->message)]: @"Error";
@ -255,12 +264,31 @@ extern void libmsbcg729_init();
withDisplayName:lDisplayName];
}
break;
default:
case LinphoneCallStreamsRunning:
//check video
if (linphone_call_params_video_enabled(linphone_call_get_current_params(call))) {
[callDelegate displayVideoCall:call FromUI:mCurrentViewController
forUser:lUserName
withDisplayName:lDisplayName];
} else {
[callDelegate displayInCall:call FromUI:mCurrentViewController forUser:lUserName withDisplayName:lDisplayName];
}
break;
case LinphoneCallReleased:
free (linphone_call_get_user_pointer(call));
break;
default:
break;
}
}
-(void) displayDialer {
[callDelegate displayDialerFromUI:mCurrentViewController
forUser:@""
withDisplayName:@""];
}
+(LinphoneCore*) getLc {
if (theLinphoneCore==nil) {
@throw([NSException exceptionWithName:@"LinphoneCoreException" reason:@"Linphone core not initialized yet" userInfo:nil]);
@ -315,13 +343,18 @@ static void linphone_iphone_call_state(LinphoneCore *lc, LinphoneCall* call, Lin
LinphoneCallPausedByRemote
*/
[(LinphoneManager*)linphone_core_get_user_data(lc) onCall:call StateChanged: state withMessage: message];
}
static void linphone_iphone_transfer_state_changed(LinphoneCore* lc, LinphoneCall* call, LinphoneCallState state) {
/*
LinhoneCallOutgoingProgress -> SalReferTrying
LinphoneCallConnected -> SalReferSuccess
LinphoneCallError -> SalReferFailed | *
*/
}
-(void) onRegister:(LinphoneCore *)lc cfg:(LinphoneProxyConfig*) cfg state:(LinphoneRegistrationState) state message:(const char*) message {
NSLog(@"NEW REGISTRATION STATE: '%s' (message: '%s')", linphone_registration_state_to_string(state), message);
ms_warning("NEW REGISTRATION STATE: '%s' (message: '%s')", linphone_registration_state_to_string(state), message);
LinphoneAddress* lAddress = linphone_address_new(linphone_proxy_config_get_identity(cfg));
NSString* lUserName = linphone_address_get_username(lAddress)? [[NSString alloc] initWithUTF8String:linphone_address_get_username(lAddress) ]:@"";
@ -383,6 +416,23 @@ static void linphone_iphone_registration_state(LinphoneCore *lc, LinphoneProxyCo
[(LinphoneManager*)linphone_core_get_user_data(lc) onRegister:lc cfg:cfg state:state message:message];
}
static LinphoneCoreVTable linphonec_vtable = {
.show =NULL,
.call_state_changed =(LinphoneCallStateCb)linphone_iphone_call_state,
.registration_state_changed = linphone_iphone_registration_state,
.notify_recv = NULL,
.new_subscription_request = NULL,
.auth_info_requested = NULL,
.display_status = linphone_iphone_display_status,
.display_message=linphone_iphone_log,
.display_warning=linphone_iphone_log,
.display_url=NULL,
.text_received=NULL,
.dtmf_received=NULL,
.transfer_state_changed=linphone_iphone_transfer_state_changed
};
static LinphoneCoreVTable linphonec_vtable;
-(void) configurePayloadType:(const char*) type fromPrefKey: (NSString*)key withRate:(int)rate {
@ -406,17 +456,23 @@ static LinphoneCoreVTable linphonec_vtable;
CFWriteStreamClose (writeStream);
}
void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void * info) {
void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* nilCtx) {
ms_message("Network connection flag [%x]",flags);
LinphoneManager* lLinphoneMgr = (LinphoneManager*)info;
LinphoneManager* lLinphoneMgr = [LinphoneManager instance];
if ([LinphoneManager getLc] != nil) {
struct NetworkReachabilityContext* ctx = nilCtx ? ((struct NetworkReachabilityContext*)nilCtx) : 0;
if ((flags == 0) | (flags & (kSCNetworkReachabilityFlagsConnectionRequired |kSCNetworkReachabilityFlagsConnectionOnTraffic))) {
[[LinphoneManager instance] kickOffNetworkConnection];
linphone_core_set_network_reachable([LinphoneManager getLc],false);
((LinphoneManager*)info).connectivity = none;
lLinphoneMgr.connectivity = none;
} else {
LinphoneTunnel *tunnel=linphone_core_get_tunnel([LinphoneManager getLc]);
Connectivity newConnectivity = flags & kSCNetworkReachabilityFlagsIsWWAN ? wwan:wifi;
Connectivity newConnectivity;
if (!ctx || ctx->testWWan)
newConnectivity = flags & kSCNetworkReachabilityFlagsIsWWAN ? wwan:wifi;
else
newConnectivity = wifi;
if (lLinphoneMgr.connectivity == none) {
linphone_core_set_network_reachable([LinphoneManager getLc],true);
} else if (lLinphoneMgr.connectivity != newConnectivity) {
@ -442,13 +498,15 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
ms_message("new network connectivity of type [%s]",(newConnectivity==wifi?"wifi":"wwan"));
}
if (ctx && ctx->networkStateChanged) {
(*ctx->networkStateChanged)(lLinphoneMgr.connectivity);
}
}
}
-(BOOL) reconfigureLinphoneIfNeeded:(NSDictionary *)settings {
if (theLinphoneCore==nil) {
ms_warning("cannot configure linphone beacause not initialized yet");
ms_warning("cannot configure linphone because not initialized yet");
return NO;
}
@ -518,7 +576,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
transportValue.tcp_port=0;
transportValue.udp_port=0;
} else {
ms_error("unexpected trasnport [%s]",[transport cStringUsingEncoding:[NSString defaultCStringEncoding]]);
ms_error("unexpected transport [%s]",[transport cStringUsingEncoding:[NSString defaultCStringEncoding]]);
}
if (linphone_core_set_sip_transports(theLinphoneCore, &transportValue)) {
ms_error("cannot set transport");
@ -702,7 +760,21 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
}
bool enableSrtp = [[NSUserDefaults standardUserDefaults] boolForKey:@"enable_srtp_preference"];
linphone_core_set_media_encryption(theLinphoneCore, enableSrtp?LinphoneMediaEncryptionSRTP:LinphoneMediaEncryptionZRTP);
NSString* stun_server = [[NSUserDefaults standardUserDefaults] stringForKey:@"stun_preference"];
if ([stun_server length]>0){
linphone_core_set_stun_server(theLinphoneCore,[stun_server cStringUsingEncoding:[NSString defaultCStringEncoding]]);
linphone_core_set_firewall_policy(theLinphoneCore, LinphonePolicyUseStun);
}else{
linphone_core_set_stun_server(theLinphoneCore, NULL);
linphone_core_set_firewall_policy(theLinphoneCore, LinphonePolicyNoFirewall);
}
LinphoneVideoPolicy policy;
policy.automatically_accept = [[NSUserDefaults standardUserDefaults] boolForKey:@"start_video_preference"];;
policy.automatically_initiate = [[NSUserDefaults standardUserDefaults] boolForKey:@"start_video_preference"];
linphone_core_set_video_policy(theLinphoneCore, &policy);
UIDevice* device = [UIDevice currentDevice];
bool backgroundSupported = false;
if ([device respondsToSelector:@selector(isMultitaskingSupported)])
@ -750,7 +822,8 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
linphone_core_destroy(theLinphoneCore);
theLinphoneCore = nil;
SCNetworkReachabilityUnscheduleFromRunLoop(proxyReachability, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
CFRelease(proxyReachability);
if (proxyReachability)
CFRelease(proxyReachability);
proxyReachability=nil;
}
}
@ -803,7 +876,6 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
[self destroyLibLinphone];
return NO;
}
}
@ -813,6 +885,32 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
}
-(void) setupNetworkReachabilityCallback: (const char*) nodeName withContext:(SCNetworkReachabilityContext*) ctx {
if (proxyReachability) {
ms_message("Cancel old network reachability check");
SCNetworkReachabilityUnscheduleFromRunLoop(proxyReachability, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
CFRelease(proxyReachability);
proxyReachability = nil;
}
proxyReachability = SCNetworkReachabilityCreateWithName(nil, nodeName);
//initial state is network off should be done as soon as possible
SCNetworkReachabilityFlags flags;
if (!SCNetworkReachabilityGetFlags(proxyReachability, &flags)) {
ms_error("Cannot get reachability flags");
};
networkReachabilityCallBack(proxyReachability, flags, ctx ? ctx->info : 0);
if (!SCNetworkReachabilitySetCallback(proxyReachability, (SCNetworkReachabilityCallBack)networkReachabilityCallBack, ctx)){
ms_error("Cannot register reachability cb");
};
if(!SCNetworkReachabilityScheduleWithRunLoop(proxyReachability, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode)){
ms_error("Cannot register schedule reachability cb");
};
}
/*************
*lib linphone init method
*/
@ -878,22 +976,8 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
linphone_core_set_zrtp_secrets_file(theLinphoneCore, [zrtpSecretsFileName cStringUsingEncoding:[NSString defaultCStringEncoding]]);
proxyReachability=SCNetworkReachabilityCreateWithName(nil, "linphone.org");
proxyReachabilityContext.info=self;
//initial state is network off should be done as soon as possible
SCNetworkReachabilityFlags flags;
if (!SCNetworkReachabilityGetFlags(proxyReachability, &flags)) {
ms_error("Cannot get reachability flags");
};
networkReachabilityCallBack(proxyReachability,flags,self);
[self setupNetworkReachabilityCallback: "linphone.org" withContext:nil];
if (!SCNetworkReachabilitySetCallback(proxyReachability, (SCNetworkReachabilityCallBack)networkReachabilityCallBack,&proxyReachabilityContext)){
ms_error("Cannot register reachability cb");
};
if(!SCNetworkReachabilityScheduleWithRunLoop(proxyReachability, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode)){
ms_error("Cannot register schedule reachability cb");
};
[self reconfigureLinphoneIfNeeded:nil];
// start scheduler
@ -986,13 +1070,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
-(void) endInterruption {
ms_message("Sound interruption ended!");
const MSList* c = linphone_core_get_calls(theLinphoneCore);
if (c) {
ms_message("Auto resuming call");
linphone_core_resume_call(theLinphoneCore, (LinphoneCall*) c->data);
}
//let the user resume the call manually.
}
+(BOOL) runningOnIpad {
#ifdef UI_USER_INTERFACE_IDIOM

View file

@ -28,6 +28,8 @@
-(void) displayVideoCall:(LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName;
//status reporting
-(void) displayStatus:(NSString*) message;
-(void) displayAskToEnableVideoCall:(LinphoneCall*) call forUser:(NSString*) username withDisplayName:(NSString*) displayName;
-(void) firstVideoFrameDecoded:(LinphoneCall*) call;
@end

View file

@ -22,7 +22,11 @@
@interface UICallButton : UIButton {
@private
UITextField* mAddress;
UITextField* mAddress;
}
-(void) initWithAddress:(UITextField*) address;
+(void) enableTransforMode:(BOOL) enable;
+(BOOL) transforModeEnabled;
@end

View file

@ -23,6 +23,17 @@
@implementation UICallButton
static BOOL transferMode = NO;
+(void) enableTransforMode:(BOOL) enable {
transferMode = enable;
}
+(BOOL) transforModeEnabled {
return transferMode;
}
-(void) touchUp:(id) sender {
if (!linphone_core_is_network_reachabled([LinphoneManager getLc])) {
UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Network Error",nil)
@ -54,13 +65,16 @@
LinphoneProxyConfig* proxyCfg;
//get default proxy
linphone_core_get_default_proxy([LinphoneManager getLc],&proxyCfg);
bool startVideo = [[NSUserDefaults standardUserDefaults] boolForKey:@"start_video_preference"];
LinphoneCallParams* lcallParams = linphone_core_create_default_call_parameters([LinphoneManager getLc]);
linphone_call_params_enable_video(lcallParams,startVideo&linphone_core_video_enabled([LinphoneManager getLc]));
if ([mAddress.text length] == 0) return; //just return
if ([mAddress.text hasPrefix:@"sip:"]) {
linphone_core_invite_with_params([LinphoneManager getLc],[mAddress.text cStringUsingEncoding:[NSString defaultCStringEncoding]],lcallParams);
if (transferMode) {
linphone_core_transfer_call([LinphoneManager getLc], linphone_core_get_current_call([LinphoneManager getLc]), [mAddress.text cStringUsingEncoding:[NSString defaultCStringEncoding]]);
} else {
linphone_core_invite_with_params([LinphoneManager getLc],[mAddress.text cStringUsingEncoding:[NSString defaultCStringEncoding]],lcallParams);
}
[UICallButton enableTransforMode:NO];
} else if ( proxyCfg==nil){
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)
@ -80,12 +94,16 @@
linphone_address_set_display_name(tmpAddress,(lDisplayName)?[lDisplayName cStringUsingEncoding:[NSString defaultCStringEncoding]]:nil);
linphone_core_invite_address_with_params([LinphoneManager getLc],tmpAddress,lcallParams) ;
if (transferMode) {
linphone_core_transfer_call([LinphoneManager getLc], linphone_core_get_current_call([LinphoneManager getLc]), normalizedUserName);
} else {
linphone_core_invite_address_with_params([LinphoneManager getLc],tmpAddress,lcallParams) ;
}
linphone_address_destroy(tmpAddress);
}
linphone_call_params_destroy(lcallParams);
[UICallButton enableTransforMode:NO];
} else if (linphone_core_inc_invite_pending([LinphoneManager getLc])) {
linphone_core_accept_call([LinphoneManager getLc],linphone_core_get_current_call([LinphoneManager getLc]));
}
@ -102,6 +120,7 @@
*/
-(void) initWithAddress:(UITextField*) address{
mAddress=[address retain];
transferMode = NO;
[self addTarget:self action:@selector(touchUp:) forControlEvents:UIControlEventTouchUpInside];
}

View file

@ -25,7 +25,7 @@
@synthesize preview;
-(void) touchUp:(id) sender {
if (nextCamId!=currentCamId) {
ms_message("Swithcing from [%s] to [%s]",currentCamId,nextCamId);
ms_message("Switching from [%s] to [%s]",currentCamId,nextCamId);
linphone_core_set_video_device([LinphoneManager getLc], nextCamId);
nextCamId=currentCamId;
currentCamId = linphone_core_get_video_device([LinphoneManager getLc]);

View file

@ -1,4 +1,4 @@
/* UIAddVideoButton.h
/* UIToggleVideoButton.h
*
* Copyright (C) 2011 Belledonne Comunications, Grenoble, France
*
@ -19,6 +19,12 @@
#import <UIKit/UIKit.h>
@interface UIAddVideoButton : UIButton
@interface UIToggleVideoButton : UIButton {
UIActivityIndicatorView* videoUpdateIndicator;
}
- (id)initWithCoder:(NSCoder *)decoder;
@property (nonatomic, retain) IBOutlet UIActivityIndicatorView* videoUpdateIndicator;
@end

View file

@ -1,4 +1,4 @@
/* UIAddVideoButton.m
/* UIToggleVideoButton.m
*
* Copyright (C) 2011 Belledonne Comunications, Grenoble, France
*
@ -17,21 +17,37 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import "UIAddVideoButton.h"
#import "UIToggleVideoButton.h"
#include "LinphoneManager.h"
@implementation UIAddVideoButton
@implementation UIToggleVideoButton
@synthesize videoUpdateIndicator;
-(void) touchUp:(id) sender {
LinphoneCore* lc = [LinphoneManager getLc];
if (!linphone_core_video_enabled(lc))
return;
[videoUpdateIndicator startAnimating];
videoUpdateIndicator.hidden = NO;
self.enabled = NO;
LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]);
if (call) {
LinphoneCallParams* call_params = linphone_call_params_copy(linphone_call_get_current_params(call));
linphone_call_params_enable_video(call_params, TRUE);
if (linphone_call_params_video_enabled(call_params)) {
ms_message("Disabling video");
linphone_call_params_enable_video(call_params, FALSE);
} else {
ms_message("Enabling video");
linphone_call_params_enable_video(call_params, TRUE);
}
linphone_core_update_call(lc, call, call_params);
linphone_call_params_destroy(call_params);
} {
ms_warning("Cannot add video, because no current call");
} else {
ms_warning("Cannot toggle video, because no current call");
}
}

View file

@ -0,0 +1,18 @@
//
// VideoZoomHandler.h
// linphone
//
// Created by Pierre-Eric Pelloux-Prayer on 25/04/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface VideoZoomHandler : NSObject {
float zoomLevel, cx, cy;
UIView* videoView;
}
-(void) setup: (UIView*) videoView;
-(void) resetZoom;
@end

View file

@ -0,0 +1,101 @@
//
// VideoZoomHandler.m
// linphone
//
// Created by Pierre-Eric Pelloux-Prayer on 25/04/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#import "VideoZoomHandler.h"
#include "linphonecore.h"
#import "LinphoneManager.h"
@implementation VideoZoomHandler
-(void) zoomInOut:(UITapGestureRecognizer*) reco {
if (zoomLevel != 1)
zoomLevel = 1;
else
zoomLevel = 2;
if (zoomLevel != 1) {
CGPoint point = [reco locationInView:videoView];
cx = point.x / videoView.frame.size.width;
cy = 1 - point.y / videoView.frame.size.height;
} else {
cx = cy = 0.5;
}
linphone_call_zoom_video(linphone_core_get_current_call([LinphoneManager getLc]), zoomLevel, cx, cy);
}
-(void) videoPan:(UIPanGestureRecognizer*) reco {
if (zoomLevel <= 1.0)
return;
float x,y;
CGPoint translation = [reco translationInView:videoView];
if ([reco state] == UIGestureRecognizerStateEnded) {
cx -= translation.x / videoView.frame.size.width;
cy += translation.y / videoView.frame.size.height;
x = cx;
y = cy;
} else if ([reco state] == UIGestureRecognizerStateChanged) {
x = cx - translation.x / videoView.frame.size.width;
y = cy + translation.y / videoView.frame.size.height;
} else {
return;
}
linphone_call_zoom_video(linphone_core_get_current_call([LinphoneManager getLc]), zoomLevel, x, y);
}
-(void) pinch:(UIPinchGestureRecognizer*) reco {
float s = zoomLevel;
// CGPoint point = [reco locationInView:videoGroup];
// float ccx = cx + (point.x / videoGroup.frame.size.width - 0.5) / s;
// float ccy = cy - (point.y / videoGroup.frame.size.height - 0.5) / s;
if ([reco state] == UIGestureRecognizerStateEnded) {
zoomLevel = MAX(MIN(zoomLevel * reco.scale, 3.0), 1.0);
s = zoomLevel;
// cx = ccx;
// cy = ccy;
} else if ([reco state] == UIGestureRecognizerStateChanged) {
s = zoomLevel * reco.scale;
s = MAX(MIN(s, 3.0), 1.0);
} else if ([reco state] == UIGestureRecognizerStateBegan) {
} else {
return;
}
linphone_call_zoom_video(linphone_core_get_current_call([LinphoneManager getLc]), s, cx, cy);
}
-(void) resetZoom {
zoomLevel = 1;
cx = cy = 0.5;
}
-(void) setup: (UIView*) view {
videoView = view;
UITapGestureRecognizer* doubleFingerTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(zoomInOut:)];
[doubleFingerTap setNumberOfTapsRequired:2];
[doubleFingerTap setNumberOfTouchesRequired:1];
[videoView addGestureRecognizer:doubleFingerTap];
UIPanGestureRecognizer* pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(videoPan:)];
[videoView addGestureRecognizer:pan];
UIPinchGestureRecognizer* pinchReco = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(pinch:)];
[videoView addGestureRecognizer:pinchReco];
[doubleFingerTap release];
[pan release];
[pinchReco release];
[self resetZoom];
}
@end

View file

@ -18,6 +18,7 @@
*/
#import "MainScreenWithVideoPreview.h"
#import <AVFoundation/AVFoundation.h>
#import "LinphoneUI/LinphoneManager.h"
@implementation MainScreenWithVideoPreview
@synthesize window;
@ -71,12 +72,7 @@
- (void)viewDidLoad
{
[super viewDidLoad];
bool enableVideo = [[NSUserDefaults standardUserDefaults] boolForKey:@"enable_video_preference"];
if (enableVideo) {
[self initVideoPreview ];
}
[phoneMainView.switchCamera addTarget:self action:@selector(switchCameraPressed) forControlEvents:UIControlEventTouchUpInside];
}
-(void) switchCameraPressed {
@ -93,6 +89,10 @@
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc]init];
NSArray* array = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
if ( [array count] == 0) {
ms_warning("No camera available (running on simulator ?");
return;
}
currentCamera = camIndex % [array count];
AVCaptureDevice* device = (AVCaptureDevice*) [array objectAtIndex:currentCamera];
input = [[AVCaptureDeviceInput deviceInputWithDevice:device
@ -106,33 +106,51 @@
[session startRunning];
}
-(void) stopPreview:(id) a {
@synchronized (self) {
if (!session.running)
return;
[self.view removeFromSuperview];
[session stopRunning];
}
}
-(void) startPreview:(id) a {
@synchronized (self) {
if (session.running)
return;
[window addSubview:self.view];
[window sendSubviewToBack:self.view];
[session startRunning];
}
}
-(void) showPreview:(BOOL) show {
bool enableVideo = [[NSUserDefaults standardUserDefaults] boolForKey:@"enable_video_preference"];
if (enableVideo) {
LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]);
if (show && call && linphone_call_params_video_enabled(linphone_call_get_current_params(call))) {
return;
}
if (session == nil) {
[self initVideoPreview];
}
if (show && !session.running) {
[window addSubview:self.view];
[window sendSubviewToBack:self.view];
[session startRunning];
[self performSelectorInBackground:@selector(startPreview:) withObject:nil];
} else if (!show && session.running) {
[self.view removeFromSuperview];
[session stopRunning];
[self performSelectorInBackground:@selector(stopPreview:) withObject:nil];
}
} else {
if (session != nil)
[session stopRunning];
[self.view removeFromSuperview];
[self stopPreview:nil];
}
}
-(void) viewDidAppear:(BOOL)animated {
[phoneMainView.switchCamera addTarget:self action:@selector(switchCameraPressed) forControlEvents:UIControlEventTouchUpInside];
[super viewDidAppear:animated];
}
-(void) viewDidDisappear:(BOOL)animated {

View file

@ -163,7 +163,6 @@
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Back</string>
<reference key="IBUIHighlightedTitleColor" ref="839360217"/>
<object class="NSColor" key="IBUINormalTitleColor">

View file

@ -77,7 +77,7 @@
if (config == NULL) {
s = LinphoneRegistrationNone;
m = @"No SIP account configured";
m = linphone_core_is_network_reachabled([LinphoneManager getLc]) ? NSLocalizedString(@"No SIP account configured", nil) : NSLocalizedString(@"Network down", nil);
} else {
s = linphone_proxy_config_get_state(config);
@ -103,9 +103,12 @@
bool zeroCall = (linphone_core_get_calls_nb([LinphoneManager getLc]) == 0);
[LinphoneManager set:callLarge hidden:!zeroCall withName:"CALL_LARGE button" andReason:__FUNCTION__];
[LinphoneManager set:switchCamera hidden:!zeroCall withName:"SWITCH_CAM button" andReason:__FUNCTION__];
[LinphoneManager set:callShort hidden:zeroCall withName:"CALL_SHORT button" andReason:__FUNCTION__];
[LinphoneManager set:backToCallView hidden:zeroCall withName:"BACK button" andReason:__FUNCTION__];
[callShort setTitle:[UICallButton transforModeEnabled] ? @"transfer":@"call" forState:UIControlStateNormal];
if (!callShort.hidden)
[callShort setEnabled:!linphone_core_sound_resources_locked([LinphoneManager getLc])];
} @catch (NSException* exc) {
@ -120,6 +123,7 @@
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"enable_first_login_view_preference"] == true) {
myFirstLoginViewController = [[FirstLoginViewController alloc] initWithNibName:@"FirstLoginViewController"
bundle:[NSBundle mainBundle]];
@ -131,8 +135,8 @@
[self updateCallAndBackButtons];
}
-(void) viewWillDisappear:(BOOL)animated {
[mMainScreenWithVideoPreview showPreview:NO];
-(void) viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
}
@ -195,6 +199,7 @@
-(void)viewWillAppear:(BOOL)animated {
[self updateCallAndBackButtons];
[super viewWillAppear:animated];
}
-(void) displayDialerFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName {
@ -230,7 +235,6 @@
[myTabBarController setSelectedIndex:DIALER_TAB_INDEX];
[mMainScreenWithVideoPreview showPreview:YES];
}
//status reporting
@ -240,7 +244,7 @@
-(void) displayIncomingCall:(LinphoneCall*) call NotificationFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName {
[mMainScreenWithVideoPreview showPreview:NO];
if ([[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)]
&& [UIApplication sharedApplication].applicationState != UIApplicationStateActive) {
// Create a new notification
@ -258,6 +262,7 @@
}
} else {
CallDelegate* cd = [[CallDelegate alloc] init];
cd.eventType = CD_NEW_CALL;
cd.delegate = self;
cd.call = call;
@ -283,13 +288,23 @@
}
-(void) backToCallViewPressed {
[self displayInCall: nil
[UICallButton enableTransforMode:NO];
[self presentModalViewController:(UIViewController*)mIncallViewController animated:true];
LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]);
if (!call || !linphone_call_params_video_enabled(linphone_call_get_current_params(call)) || linphone_call_get_state(call) != LinphoneCallStreamsRunning) {
[self displayInCall: call
FromUI:nil
forUser:nil
withDisplayName:nil];
} else {
[self displayVideoCall:call FromUI:nil forUser:nil withDisplayName:nil];
}
}
-(void) displayCall: (LinphoneCall*) call InProgressFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName {
[mMainScreenWithVideoPreview showPreview:NO];
if (self.presentedViewController != (UIViewController*)mIncallViewController) {
[self presentModalViewController:(UIViewController*)mIncallViewController animated:true];
}
@ -302,6 +317,7 @@
}
-(void) displayInCall: (LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName {
[mMainScreenWithVideoPreview showPreview:NO];
if (self.presentedViewController != (UIViewController*)mIncallViewController && (call == 0x0 ||
linphone_call_get_dir(call)==LinphoneCallIncoming)){
[self presentModalViewController:(UIViewController*)mIncallViewController animated:true];
@ -313,22 +329,34 @@
withDisplayName:displayName];
[LinphoneManager set:callLarge hidden:YES withName:"CALL_LARGE button" andReason:__FUNCTION__];
[LinphoneManager set:switchCamera hidden:YES withName:"SWITCH_CAMERA button" andReason:__FUNCTION__];
[LinphoneManager set:callShort hidden:NO withName:"CALL_SHORT button" andReason:__FUNCTION__];
[LinphoneManager set:backToCallView hidden:NO withName:"CALL_BACK button" andReason:__FUNCTION__];
[self updateCallAndBackButtons];
}
-(void) displayVideoCall:(LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName {
[mMainScreenWithVideoPreview showPreview:NO];
[mIncallViewController displayVideoCall:call FromUI:viewCtrl
forUser:username
withDisplayName:displayName];
[mMainScreenWithVideoPreview showPreview:NO];
[self updateCallAndBackButtons];
}
-(void) displayAskToEnableVideoCall:(LinphoneCall*) call forUser:(NSString*) username withDisplayName:(NSString*) displayName {
[mIncallViewController displayAskToEnableVideoCall:call forUser:username withDisplayName:displayName];
}
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex withUserDatas:(void *)datas{
- (void)actionSheet:(UIActionSheet *)actionSheet ofType:(enum CallDelegateType)type clickedButtonAtIndex:(NSInteger)buttonIndex withUserDatas:(void *)datas {
if (type != CD_NEW_CALL)
return;
LinphoneCall* call = (LinphoneCall*)datas;
if (buttonIndex == actionSheet.destructiveButtonIndex ) {
linphone_core_accept_call([LinphoneManager getLc],call);
@ -388,5 +416,9 @@
[self updateStatusSubView];
}
-(void) firstVideoFrameDecoded: (LinphoneCall*) call {
[mIncallViewController firstVideoFrameDecoded:call];
}
@end

View file

@ -40,7 +40,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrameSize">{320, 460}</string>
<reference key="NSSuperview"/>
<reference key="NSNextKeyView"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MCAwIDAAA</bytes>
@ -129,7 +128,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{211, 418}, {108, 62}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSNextKeyView"/>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
@ -252,7 +250,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{420, 212}, {60, 108}}</string>
<reference key="NSSuperview" ref="977413659"/>
<reference key="NSNextKeyView"/>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
@ -314,6 +311,19 @@
<object class="IBUIView" id="774090532">
<reference key="NSNextResponder" ref="738244138"/>
<int key="NSvFlags">274</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUIImageView" id="359167072">
<reference key="NSNextResponder" ref="774090532"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{8, 285}, {28, 28}}</string>
<reference key="NSSuperview" ref="774090532"/>
<reference key="NSNextKeyView" ref="81113981"/>
<string key="NSReuseIdentifierKey">_NS:567</string>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
<string key="NSFrame">{{60, 0}, {420, 320}}</string>
<reference key="NSSuperview" ref="738244138"/>
<reference key="NSNextKeyView" ref="359167072"/>
@ -392,7 +402,6 @@
<int key="NSvFlags">274</int>
<string key="NSFrame">{{360, 233}, {106, 80}}</string>
<reference key="NSSuperview" ref="738244138"/>
<reference key="NSNextKeyView"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
@ -400,16 +409,6 @@
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIImageView" id="359167072">
<reference key="NSNextResponder" ref="738244138"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{68, 285}, {28, 28}}</string>
<reference key="NSSuperview" ref="738244138"/>
<reference key="NSNextKeyView" ref="81113981"/>
<string key="NSReuseIdentifierKey">_NS:567</string>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
<string key="NSFrameSize">{480, 320}</string>
<reference key="NSSuperview"/>
@ -731,7 +730,6 @@
<reference ref="898336236"/>
<reference ref="93544236"/>
<reference ref="689882425"/>
<reference ref="359167072"/>
<reference ref="774090532"/>
</object>
<reference key="parent" ref="0"/>
@ -780,17 +778,21 @@
<reference key="parent" ref="977413659"/>
<string key="objectName">display</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">59</int>
<reference key="object" ref="359167072"/>
<reference key="parent" ref="738244138"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">39</int>
<reference key="object" ref="774090532"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="359167072"/>
</object>
<reference key="parent" ref="738244138"/>
<string key="objectName">display</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">59</int>
<reference key="object" ref="359167072"/>
<reference key="parent" ref="774090532"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">

17
README
View file

@ -36,19 +36,24 @@ BUILDING THE SDK
* GPL third parties versus non GPL third parties
This sdk can be generated in 2 flavors. Firt 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.
This sdk can be generated in 2 flavors. Firt 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.
To generate the liblinphone multi arch sdk in GPL mode, do:
To generate the liblinphone multi arch sdk in GPL mode, do:
$ cd submodules/build
$ make all
ALTERNATIVELY, you can force liblinphone to use only non GPL code except for liblinphone, mediastremer2, ortp, exosip, osip.
If you choose this flavor, your final application is still subject to GPL except if you have a commercial license for liblinphone, mediastremer2, ortp, exosip, osip.
ALTERNATIVELY, you can force liblinphone to use only non GPL code except for liblinphone, mediastremer2, ortp, exosip, osip.
If you choose this flavor, your final application is still subject to GPL except if you have a commercial license for liblinphone, mediastremer2, ortp, exosip, osip.
To generate the liblinphone multi arch sdkin non GPL mode, do:
To generate the liblinphone multi arch sdkin non GPL mode, do:
$ cd submodules/build
$ make all enable_gpl_third_parties=no
* ZRTP support
You can enable ZRTP support in GPL mode only, by adding "enable_zrtp=yes" to the make command, for example:
$ make all enable_gpl_third_parties=yes enable_zrtp=yes
The resulting sdk is in liblinphone-sdk/ directory.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 4 KiB

BIN
Resources/in_call_video.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

View file

@ -4,6 +4,20 @@
<dict>
<key>PreferenceSpecifiers</key>
<array>
<dict>
<key>Key</key>
<string>stun_preference</string>
<key>Title</key>
<string>Stun server</string>
<key>Type</key>
<string>PSTextFieldSpecifier</string>
<key>AutocapitalizationType</key>
<string>None</string>
<key>AutocorrectionType</key>
<string>No</string>
<key>DefaultValue</key>
<string></string>
</dict>
<dict>
<key>DefaultValue</key>
<false/>
@ -42,6 +56,16 @@
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
</dict>
<dict>
<key>DefaultValue</key>
<false/>
<key>Key</key>
<string>wifi_only_preference</string>
<key>Title</key>
<string>Wifi only</string>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
</dict>
<dict>
<key>DefaultValue</key>
<string>udp</string>
@ -74,6 +98,16 @@
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
</dict>
<dict>
<key>DefaultValue</key>
<false/>
<key>Key</key>
<string>disable_autoboot_preference</string>
<key>Title</key>
<string>Disable application autostart</string>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
</dict>
<dict>
<key>DefaultValue</key>
<true/>

File diff suppressed because it is too large Load diff

View file

@ -45,4 +45,5 @@ capture=1
show_local=0
enabled=1
size=qvga
display_filter_auto_rotate=1

View file

@ -44,4 +44,5 @@ capture=1
show_local=0
enabled=1
size=vga
display_filter_auto_rotate=1

Binary file not shown.

View file

@ -4,6 +4,20 @@
<dict>
<key>PreferenceSpecifiers</key>
<array>
<dict>
<key>Key</key>
<string>stun_preference</string>
<key>Title</key>
<string>Stun server</string>
<key>Type</key>
<string>PSTextFieldSpecifier</string>
<key>AutocapitalizationType</key>
<string>None</string>
<key>AutocorrectionType</key>
<string>No</string>
<key>DefaultValue</key>
<string></string>
</dict>
<dict>
<key>DefaultValue</key>
<false/>

View file

@ -21,8 +21,19 @@
############################################################################
enable_gpl_third_parties=no
enable_zrtp=no
.NOTPARALLEL all: check_options build warning
ifeq ($(enable_gpl_third_parties)$(enable_zrtp),noyes)
check_options:
@echo "ZRTP is not available in non-gpl build."
@exit -1
else
check_options:
endif
.NOTPARALLEL all: build warning
ifeq ($(enable_gpl_third_parties),yes)
warning:
@echo
@ -42,10 +53,12 @@ warning:
@echo "*****************************************************************"
endif
LINPHONE_OPTIONS=enable_gpl_third_parties=$(enable_gpl_third_parties) enable_zrtp=$(enable_zrtp)
build:
make -f builder-iphone-os.mk all enable_gpl_third_parties=$(enable_gpl_third_parties) \
&& make -f builder-iphone-simulator.mk all enable_gpl_third_parties=$(enable_gpl_third_parties)\
&& make -f builder-iphone-os.mk host=armv7-apple-darwin all enable_gpl_third_parties=$(enable_gpl_third_parties)\
make -f builder-iphone-os.mk $(LINPHONE_OPTIONS) all \
&& make -f builder-iphone-simulator.mk $(LINPHONE_OPTIONS) all \
&& make -f builder-iphone-os.mk host=armv7-apple-darwin $(LINPHONE_OPTIONS) all \
&& make -f builder-iphone-os.mk delivery-sdk
ipa: build
@ -68,3 +81,4 @@ veryclean:
make -f builder-iphone-simulator.mk veryclean\
&& make -f builder-iphone-os.mk veryclean\
&& make -f builder-iphone-os.mk host=armv7-apple-darwin veryclean

View file

@ -39,6 +39,12 @@ linphone_configure_controls= \
--enable-tunnel \
--with-srtp=$(prefix)
ifeq ($(enable_zrtp),yes)
linphone_configure_controls+= --enable-zrtp
else
linphone_configure_controls+= --disable-zrtp
endif
#path
BUILDER_SRC_DIR?=$(shell pwd)/../
BUILDER_BUILD_DIR?=$(shell pwd)/../build-$(host)
@ -61,11 +67,11 @@ $(LINPHONE_BUILD_DIR)/disable_gpl_third_parties:
cd $(LINPHONE_BUILD_DIR) && rm -f Makefile && rm -f oRTP/Makefile && rm -f mediastreamer2/Makefile
ifeq ($(enable_gpl_third_parties),yes)
linphone_configure_controls+= --enable-ffmpeg --enable-zrtp
linphone_configure_controls+= --enable-ffmpeg
detect_gpl_mode_switch: $(LINPHONE_BUILD_DIR)/enable_gpl_third_parties
else
linphone_configure_controls+= --disable-ffmpeg --disable-zrtp
linphone_configure_controls+= --disable-ffmpeg
detect_gpl_mode_switch: $(LINPHONE_BUILD_DIR)/disable_gpl_third_parties
endif

@ -1 +1 @@
Subproject commit 12dde4bdc18ee6dddbb6ff407345ede5a277936d
Subproject commit 014f5a021ad4a0c024088edbb721f144a6f96699

File diff suppressed because it is too large Load diff

@ -1 +1 @@
Subproject commit ffe1d65f344a7dd940bcf47b8148cd0d31242935
Subproject commit 38d4730be5d172c13d0bd58a53c397c140f81231

@ -1 +1 @@
Subproject commit 3d49d56a596cf5611b43f7676af9103aacc11624
Subproject commit fbb153573c0ccbda5e7191de9aa7d7d9e114b3d8

@ -1 +1 @@
Subproject commit a0ad1cca900afc17204856fd7c2de7e8d511eaad
Subproject commit 391b6d6b0fdf6854e5a25f287c4d8461730a1d40

@ -1 +1 @@
Subproject commit 16c233f6a08f9e78def1725505b51e415bd88463
Subproject commit 21de31a17e022d0d65d559784cc24ad1dfb99a21