Merge branch 'master' into dev_vcard

This commit is contained in:
Gautier Pelloux-Prayer 2016-01-18 17:05:58 +01:00
commit 6b7c1f66e7
98 changed files with 995 additions and 1183 deletions

2
.gitmodules vendored
View file

@ -9,7 +9,7 @@
url = git://git.linphone.org/speex
[submodule "submodules/externals/opencore-amr"]
path = submodules/externals/opencore-amr
url = git://git.linphone.org/opencore-amr
url = git://git.linphone.org/opencore-amr.git
ignore = dirty
[submodule "submodules/msamr"]
path = submodules/msamr

View file

@ -128,6 +128,6 @@ static UICompositeViewDescription *compositeDescription = nil;
}
- (IBAction)onDialerBackClick:(id)sender {
[PhoneMainView.instance changeCurrentView:DialerView.compositeViewDescription];
[PhoneMainView.instance popToView:DialerView.compositeViewDescription];
}
@end

View file

@ -29,7 +29,7 @@
UIView *nextView;
NSMutableArray *historyViews;
LinphoneProxyConfig *new_config;
LinphoneProxyConfig *previous_default_config;
int number_of_configs_before;
}
@property(nonatomic, strong) IBOutlet TPKeyboardAvoidingScrollView *contentView;

View file

@ -84,31 +84,24 @@ static UICompositeViewDescription *compositeDescription = nil;
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(registrationUpdateEvent:)
name:kLinphoneRegistrationUpdate
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(configuringUpdate:)
name:kLinphoneConfiguringStateUpdate
object:nil];
// we will set the new default proxy config in the assistant
previous_default_config = linphone_core_get_default_proxy_config([LinphoneManager getLc]);
linphone_core_set_default_proxy_config([LinphoneManager getLc], NULL);
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(registrationUpdateEvent:)
name:kLinphoneRegistrationUpdate
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(configuringUpdate:)
name:kLinphoneConfiguringStateUpdate
object:nil];
new_config = NULL;
[self resetTextFields];
[self changeView:_welcomeView back:FALSE animation:FALSE];
number_of_configs_before = ms_list_size(linphone_core_get_proxy_config_list(LC));
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[[NSNotificationCenter defaultCenter] removeObserver:self];
// if we quit assistant without creating a new proxy config, just restore the previous one
if (!linphone_core_get_default_proxy_config([LinphoneManager getLc])) {
linphone_core_set_default_proxy_config([LinphoneManager getLc], previous_default_config);
}
[NSNotificationCenter.defaultCenter removeObserver:self];
}
- (void)fitContent {
@ -132,11 +125,10 @@ static UICompositeViewDescription *compositeDescription = nil;
linphone_account_creator_unref(account_creator);
account_creator = NULL;
}
[[LinphoneManager instance] resetLinphoneCore];
[LinphoneManager.instance resetLinphoneCore];
account_creator = linphone_account_creator_new(
[LinphoneManager getLc],
[LinphoneManager.instance lpConfigStringForKey:@"xmlrpc_url" inSection:@"assistant" withDefault:@""]
.UTF8String);
LC, [LinphoneManager.instance lpConfigStringForKey:@"xmlrpc_url" inSection:@"assistant" withDefault:@""]
.UTF8String);
linphone_account_creator_set_user_data(account_creator, (__bridge void *)(self));
linphone_account_creator_cbs_set_existence_tested(linphone_account_creator_get_callbacks(account_creator),
assistant_existence_tested);
@ -147,25 +139,25 @@ static UICompositeViewDescription *compositeDescription = nil;
}
- (void)loadAssistantConfig:(NSString *)rcFilename {
NSString *fullPath = [@"file://" stringByAppendingString:[LinphoneManager bundleFile:rcFilename]];
linphone_core_set_provisioning_uri([LinphoneManager getLc], fullPath.UTF8String);
[[LinphoneManager instance] lpConfigSetInt:1 forKey:@"transient_provisioning" inSection:@"misc"];
linphone_core_set_provisioning_uri(LC, fullPath.UTF8String);
[LinphoneManager.instance lpConfigSetInt:1 forKey:@"transient_provisioning" inSection:@"misc"];
[self resetLiblinphone];
}
- (void)reset {
[[LinphoneManager instance] removeAllAccounts];
[[LinphoneManager instance] lpConfigSetBool:FALSE forKey:@"pushnotification_preference"];
[LinphoneManager.instance removeAllAccounts];
[LinphoneManager.instance lpConfigSetBool:FALSE forKey:@"pushnotification_preference"];
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneCore *lc = LC;
LCSipTransports transportValue = {5060, 5060, -1, -1};
if (linphone_core_set_sip_transports(lc, &transportValue)) {
LOGE(@"cannot set transport");
}
[[LinphoneManager instance] lpConfigSetBool:FALSE forKey:@"ice_preference"];
[[LinphoneManager instance] lpConfigSetString:@"" forKey:@"stun_preference"];
[LinphoneManager.instance lpConfigSetBool:FALSE forKey:@"ice_preference"];
[LinphoneManager.instance lpConfigSetString:@"" forKey:@"stun_preference"];
linphone_core_set_stun_server(lc, NULL);
linphone_core_set_firewall_policy(lc, LinphonePolicyNoFirewall);
[self resetTextFields];
@ -178,7 +170,7 @@ static UICompositeViewDescription *compositeDescription = nil;
}
+ (NSString *)errorForStatus:(LinphoneAccountCreatorStatus)status {
BOOL usePhoneNumber = [[LinphoneManager instance] lpConfigBoolForKey:@"use_phone_number" inSection:@"assistant"];
BOOL usePhoneNumber = [LinphoneManager.instance lpConfigBoolForKey:@"use_phone_number" inSection:@"assistant"];
switch (status) {
case LinphoneAccountCreatorEmailInvalid:
return NSLocalizedString(@"Invalid email.", nil);
@ -221,8 +213,8 @@ static UICompositeViewDescription *compositeDescription = nil;
}
- (void)configureProxyConfig {
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneManager *lm = [LinphoneManager instance];
LinphoneCore *lc = LC;
LinphoneManager *lm = LinphoneManager.instance;
// remove previous proxy config, if any
if (new_config != NULL) {
@ -240,7 +232,7 @@ static UICompositeViewDescription *compositeDescription = nil;
linphone_core_set_default_proxy_config(lc, new_config);
// reload address book to prepend proxy config domain to contacts' phone number
// todo: STOP doing that!
[[[LinphoneManager instance] fastAddressBook] reload];
[[LinphoneManager.instance fastAddressBook] reload];
}
}
@ -255,10 +247,9 @@ static UICompositeViewDescription *compositeDescription = nil;
[self displayUsernameAsPhoneOrUsername];
if (view == _welcomeView) {
BOOL show_logo =
[[LinphoneManager instance] lpConfigBoolForKey:@"show_assistant_logo_in_choice_view_preference"];
BOOL show_extern = ![[LinphoneManager instance] lpConfigBoolForKey:@"hide_assistant_custom_account"];
BOOL show_new = ![[LinphoneManager instance] lpConfigBoolForKey:@"hide_assistant_create_account"];
BOOL show_logo = [LinphoneManager.instance lpConfigBoolForKey:@"show_assistant_logo_in_choice_view_preference"];
BOOL show_extern = ![LinphoneManager.instance lpConfigBoolForKey:@"hide_assistant_custom_account"];
BOOL show_new = ![LinphoneManager.instance lpConfigBoolForKey:@"hide_assistant_create_account"];
if (!placement_done) {
// visibility
@ -285,7 +276,7 @@ static UICompositeViewDescription *compositeDescription = nil;
}
// Animation
if (animation && [[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"] == true) {
if (animation && ANIMATED) {
CATransition *trans = [CATransition animation];
[trans setType:kCATransitionPush];
[trans setDuration:0.35];
@ -326,18 +317,10 @@ static UICompositeViewDescription *compositeDescription = nil;
- (void)fillDefaultValues {
[self resetTextFields];
LinphoneProxyConfig *current_conf = linphone_core_get_default_proxy_config([LinphoneManager getLc]);
if (current_conf != NULL) {
if (linphone_proxy_config_find_auth_info(current_conf) != NULL) {
LOGI(@"A proxy config was set up with the remote provisioning, skip assistant");
[self onDialerClick:nil];
}
}
LinphoneProxyConfig *default_conf = linphone_core_create_proxy_config([LinphoneManager getLc]);
LinphoneProxyConfig *default_conf = linphone_core_create_proxy_config(LC);
const char *identity = linphone_proxy_config_get_identity(default_conf);
if (identity) {
LinphoneAddress *default_addr = linphone_address_new(identity);
LinphoneAddress *default_addr = linphone_core_interpret_url(LC, identity);
if (default_addr) {
const char *domain = linphone_address_get_domain(default_addr);
const char *username = linphone_address_get_username(default_addr);
@ -486,7 +469,7 @@ static UICompositeViewDescription *compositeDescription = nil;
if ([inputEntry rangeOfString:@"://"].location == NSNotFound) {
inputEntry = [NSString stringWithFormat:@"http://%@", inputEntry];
}
return (linphone_core_set_provisioning_uri([LinphoneManager getLc], inputEntry.UTF8String) != 0);
return (linphone_core_set_provisioning_uri(LC, inputEntry.UTF8String) != 0);
}
return TRUE;
}];
@ -523,7 +506,7 @@ static UICompositeViewDescription *compositeDescription = nil;
switch (state) {
case LinphoneRegistrationOk: {
_waitView.hidden = true;
[PhoneMainView.instance changeCurrentView:DialerView.compositeViewDescription];
[PhoneMainView.instance popToView:DialerView.compositeViewDescription];
break;
}
case LinphoneRegistrationNone:
@ -543,7 +526,7 @@ static UICompositeViewDescription *compositeDescription = nil;
otherButtonTitles:nil];
[alert addButtonWithTitle:@"Continue"
block:^(void) {
[PhoneMainView.instance changeCurrentView:DialerView.compositeViewDescription];
[PhoneMainView.instance popToView:DialerView.compositeViewDescription];
}];
[alert show];
break;
@ -564,6 +547,12 @@ static UICompositeViewDescription *compositeDescription = nil;
switch (status) {
case LinphoneConfiguringSuccessful:
// we successfully loaded a remote provisioned config, go to dialer
if (number_of_configs_before < ms_list_size(linphone_core_get_proxy_config_list(LC))) {
LOGI(@"A proxy config was set up with the remote provisioning, skip assistant");
[self onDialerClick:nil];
}
if (nextView == nil) {
[self fillDefaultValues];
} else {
@ -633,7 +622,7 @@ void assistant_validation_tested(LinphoneAccountCreator *creator, LinphoneAccoun
[alert addButtonWithTitle:NSLocalizedString(@"Skip verification", nil)
block:^{
[thiz configureProxyConfig];
[PhoneMainView.instance changeCurrentView:DialerView.compositeViewDescription];
[PhoneMainView.instance popToView:DialerView.compositeViewDescription];
}];
[alert show];
}
@ -705,7 +694,7 @@ void assistant_validation_tested(LinphoneAccountCreator *creator, LinphoneAccoun
nextView = _remoteProvisioningView;
[self loadAssistantConfig:@"assistant_remote.rc"];
[self findTextField:ViewElement_URL].text =
[[LinphoneManager instance] lpConfigStringForKey:@"config-uri" inSection:@"misc"];
[LinphoneManager.instance lpConfigStringForKey:@"config-uri" inSection:@"misc"];
}
- (IBAction)onCreateAccountClick:(id)sender {
@ -730,7 +719,7 @@ void assistant_validation_tested(LinphoneAccountCreator *creator, LinphoneAccoun
- (IBAction)onRemoteProvisioningLoginClick:(id)sender {
_waitView.hidden = NO;
[[LinphoneManager instance] lpConfigSetInt:1 forKey:@"transient_provisioning" inSection:@"misc"];
[LinphoneManager.instance lpConfigSetInt:1 forKey:@"transient_provisioning" inSection:@"misc"];
[self configureProxyConfig];
}
@ -754,7 +743,7 @@ void assistant_validation_tested(LinphoneAccountCreator *creator, LinphoneAccoun
}
- (IBAction)onDialerClick:(id)sender {
[PhoneMainView.instance changeCurrentView:DialerView.compositeViewDescription];
[PhoneMainView.instance popToView:DialerView.compositeViewDescription];
}
@end

View file

@ -34,13 +34,6 @@
<bool key="isElement" value="YES"/>
</accessibility>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" tag="4" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="John Doe" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="19" id="hjQ-4P-bKP" userLabel="nameLabel">
<rect key="frame" x="0.0" y="149" width="375" height="52"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="33"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" tag="5" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="john.doe@sip.linphone.org" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="8" id="78f-eb-xdx" userLabel="addressLabel">
<rect key="frame" x="0.0" y="209" width="375" height="34"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
@ -48,6 +41,13 @@
<color key="textColor" red="1" green="0.36862745099999999" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" tag="4" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="John Doe" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="19" id="hjQ-4P-bKP" userLabel="nameLabel">
<rect key="frame" x="0.0" y="149" width="375" height="52"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="33"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" tag="2" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="Cro-ww-VIC" userLabel="headerBar">
<rect key="frame" x="0.0" y="0.0" width="375" height="66"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
@ -148,7 +148,7 @@
</subviews>
<color key="backgroundColor" red="1" green="1" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina47"/>
<point key="canvasLocation" x="-86.5" y="508.5"/>
<point key="canvasLocation" x="-88.5" y="47.5"/>
</view>
<view contentMode="scaleToFill" id="Znq-C0-ZAc" userLabel="iphone6MetricsView">
<rect key="frame" x="0.0" y="0.0" width="667" height="375"/>
@ -167,13 +167,6 @@
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
</button>
<label opaque="NO" userInteractionEnabled="NO" tag="4" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="John Doe" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="19" id="WsB-At-ejv" userLabel="nameLabel">
<rect key="frame" x="298" y="121" width="369" height="37"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="33"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" tag="5" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="john.doe@sip.linphone.org" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="8" id="tsb-6p-cAk" userLabel="addressLabel">
<rect key="frame" x="298" y="166" width="369" height="33"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
@ -181,6 +174,13 @@
<color key="textColor" red="1" green="0.36862745099999999" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" tag="4" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="John Doe" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="19" id="WsB-At-ejv" userLabel="nameLabel">
<rect key="frame" x="298" y="121" width="369" height="37"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="33"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<view tag="6" contentMode="scaleToFill" id="0Tc-7G-eqT" userLabel="tabBar">
<rect key="frame" x="0.0" y="270" width="667" height="63"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
@ -281,7 +281,7 @@
<color key="backgroundColor" red="1" green="1" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina47"/>
<point key="canvasLocation" x="59.5" y="-62.5"/>
<point key="canvasLocation" x="476.5" y="-98.5"/>
</view>
</objects>
<resources>

View file

@ -10,6 +10,7 @@
<outlet property="addressLabel" destination="2fa-Ag-3GW" id="2Oe-UW-rPC"/>
<outlet property="avatarImage" destination="bNo-O5-DWh" id="eqo-0s-UoN"/>
<outlet property="landscapeView" destination="Czn-ec-dh8" id="ZIk-2g-9Qk"/>
<outlet property="microButton" destination="26e-Pj-2Oh" id="jXh-0n-yg7"/>
<outlet property="nameLabel" destination="d5s-yP-8VE" id="0VY-HP-ovD"/>
<outlet property="portraitView" destination="25" id="26I-da-00C"/>
<outlet property="routesBluetoothButton" destination="SH1-xD-Agw" id="ifX-Dy-Tcb"/>
@ -40,7 +41,7 @@
</state>
</button>
<view hidden="YES" tag="37" contentMode="scaleToFill" id="iyf-nk-ORJ" userLabel="routesView">
<rect key="frame" x="94" y="364" width="94" height="198"/>
<rect key="frame" x="282" y="364" width="94" height="198"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" tag="38" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="color_F.png" id="xEp-Iw-uII" userLabel="backgroundColor">
@ -120,8 +121,22 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="63"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
</imageView>
<button opaque="NO" tag="11" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="AaM-cH-pvW" userLabel="declineButton">
<rect key="frame" x="0.0" y="0.0" width="188" height="63"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES"/>
<accessibility key="accessibilityConfiguration" label="Decline"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<state key="normal" image="call_hangup_default.png" backgroundImage="color_D.png">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="disabled" image="call_hangup_disabled.png"/>
<state key="highlighted" backgroundImage="color_I.png"/>
<connections>
<action selector="onDeclineClick:" destination="-1" eventType="touchUpInside" id="Ebl-hM-8F9"/>
</connections>
</button>
<button opaque="NO" tag="9" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="26e-Pj-2Oh" userLabel="microButton" customClass="UIMicroButton">
<rect key="frame" x="0.0" y="0.0" width="94" height="63"/>
<rect key="frame" x="188" y="0.0" width="94" height="63"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES"/>
<accessibility key="accessibilityConfiguration" label="Accept"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
@ -133,7 +148,7 @@
<state key="highlighted" backgroundImage="color_E.png"/>
</button>
<button opaque="NO" tag="10" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="G7m-Av-QlR" userLabel="speakerButton" customClass="UISpeakerButton">
<rect key="frame" x="94" y="0.0" width="94" height="63"/>
<rect key="frame" x="282" y="0.0" width="94" height="63"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES"/>
<accessibility key="accessibilityConfiguration" label="Accept"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
@ -145,7 +160,7 @@
<state key="highlighted" backgroundImage="color_E.png"/>
</button>
<button hidden="YES" opaque="NO" tag="54" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="29K-Sd-aHF" userLabel="routesButton" customClass="UIToggleButton">
<rect key="frame" x="94" y="0.0" width="94" height="63"/>
<rect key="frame" x="282" y="0.0" width="94" height="63"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration" label="Route"/>
<inset key="titleEdgeInsets" minX="0.0" minY="38" maxX="0.0" maxY="0.0"/>
@ -159,30 +174,9 @@
<action selector="onRoutesClick:" destination="-1" eventType="touchUpInside" id="hXX-8a-7M4"/>
</connections>
</button>
<button opaque="NO" tag="11" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="AaM-cH-pvW" userLabel="declineButton">
<rect key="frame" x="187" y="0.0" width="188" height="63"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES"/>
<accessibility key="accessibilityConfiguration" label="Decline"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<state key="normal" image="call_hangup_default.png" backgroundImage="color_D.png">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="disabled" image="call_hangup_disabled.png"/>
<state key="highlighted" backgroundImage="color_I.png"/>
<connections>
<action selector="onDeclineClick:" destination="-1" eventType="touchUpInside" id="Ebl-hM-8F9"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
<label opaque="NO" userInteractionEnabled="NO" tag="4" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="John Doe" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" id="d5s-yP-8VE" userLabel="nameLabel">
<rect key="frame" x="0.0" y="152" width="375" height="52"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="33"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" tag="5" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="john.doe@sip.linphone.org" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" id="2fa-Ag-3GW" userLabel="addressLabel">
<rect key="frame" x="4" y="206" width="367" height="34"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
@ -190,6 +184,13 @@
<color key="textColor" red="1" green="0.36862745099999999" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" tag="4" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="John Doe" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" id="d5s-yP-8VE" userLabel="nameLabel">
<rect key="frame" x="0.0" y="152" width="375" height="52"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="33"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" tag="6" contentMode="scaleAspectFit" image="avatar.png" id="bNo-O5-DWh" userLabel="avatarImage" customClass="UIRoundedImageView">
<rect key="frame" x="87" y="274" width="200" height="200"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
@ -223,13 +224,6 @@
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
</button>
<label opaque="NO" userInteractionEnabled="NO" tag="4" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="John Doe" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="19" id="ubQ-ZN-AhT" userLabel="nameLabel">
<rect key="frame" x="298" y="121" width="369" height="37"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="33"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" tag="5" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="john.doe@sip.linphone.org" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="8" id="Fj8-Pu-ShI" userLabel="addressLabel">
<rect key="frame" x="298" y="166" width="368" height="33"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
@ -237,6 +231,13 @@
<color key="textColor" red="1" green="0.36862745099999999" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" tag="4" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="John Doe" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="19" id="ubQ-ZN-AhT" userLabel="nameLabel">
<rect key="frame" x="298" y="121" width="369" height="37"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="33"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" tag="6" contentMode="scaleAspectFit" image="avatar.png" id="1ZH-n6-QZ0" userLabel="avatarImage" customClass="UIRoundedImageView">
<rect key="frame" x="110" y="74" width="180" height="180"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES"/>
@ -246,7 +247,7 @@
</accessibility>
</imageView>
<view hidden="YES" tag="37" contentMode="scaleToFill" id="EaW-SR-bqv" userLabel="routesView">
<rect key="frame" x="167" y="72" width="167" height="198"/>
<rect key="frame" x="501" y="72" width="167" height="198"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" tag="38" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="color_F.png" id="Tvo-Jg-0h8" userLabel="backgroundColor">
@ -317,44 +318,8 @@
<rect key="frame" x="0.0" y="0.0" width="667" height="63"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
</imageView>
<button opaque="NO" tag="9" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="jLg-1u-ulZ" userLabel="microButton" customClass="UIMicroButton">
<rect key="frame" x="0.0" y="0.0" width="167" height="63"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES"/>
<accessibility key="accessibilityConfiguration" label="Accept"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<state key="normal" image="micro_default.png">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="disabled" image="micro_disabled.png"/>
<state key="selected" image="micro_selected.png"/>
<state key="highlighted" backgroundImage="color_E.png"/>
</button>
<button opaque="NO" tag="10" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="5CY-aN-NLX" userLabel="speakerButton" customClass="UISpeakerButton">
<rect key="frame" x="167" y="0.0" width="167" height="63"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES"/>
<accessibility key="accessibilityConfiguration" label="Accept"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<state key="normal" image="speaker_default.png">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="disabled" image="speaker_disabled.png"/>
<state key="selected" image="speaker_selected.png"/>
<state key="highlighted" backgroundImage="color_E.png"/>
</button>
<button hidden="YES" opaque="NO" tag="54" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="61B-DK-jZ6" userLabel="routesButton" customClass="UIToggleButton">
<rect key="frame" x="167" y="0.0" width="167" height="63"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES"/>
<accessibility key="accessibilityConfiguration" label="Route"/>
<inset key="titleEdgeInsets" minX="0.0" minY="38" maxX="0.0" maxY="0.0"/>
<state key="normal" image="routes_default.png">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="disabled" image="routes_disabled.png"/>
<state key="selected" image="routes_selected.png"/>
<state key="highlighted" backgroundImage="color_E.png"/>
</button>
<button opaque="NO" tag="11" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="jfG-HJ-FPI" userLabel="declineButton">
<rect key="frame" x="333" y="0.0" width="334" height="63"/>
<rect key="frame" x="0.0" y="0.0" width="334" height="63"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES"/>
<accessibility key="accessibilityConfiguration" label="Decline"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
@ -367,6 +332,42 @@
<action selector="onDeclineClick:" destination="-1" eventType="touchUpInside" id="voJ-Cd-XHg"/>
</connections>
</button>
<button opaque="NO" tag="9" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="jLg-1u-ulZ" userLabel="microButton" customClass="UIMicroButton">
<rect key="frame" x="334" y="0.0" width="167" height="63"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES"/>
<accessibility key="accessibilityConfiguration" label="Accept"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<state key="normal" image="micro_default.png">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="disabled" image="micro_disabled.png"/>
<state key="selected" image="micro_selected.png"/>
<state key="highlighted" backgroundImage="color_E.png"/>
</button>
<button opaque="NO" tag="10" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="5CY-aN-NLX" userLabel="speakerButton" customClass="UISpeakerButton">
<rect key="frame" x="501" y="0.0" width="167" height="63"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES"/>
<accessibility key="accessibilityConfiguration" label="Accept"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<state key="normal" image="speaker_default.png">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="disabled" image="speaker_disabled.png"/>
<state key="selected" image="speaker_selected.png"/>
<state key="highlighted" backgroundImage="color_E.png"/>
</button>
<button hidden="YES" opaque="NO" tag="54" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="61B-DK-jZ6" userLabel="routesButton" customClass="UIToggleButton">
<rect key="frame" x="501" y="0.0" width="167" height="63"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES"/>
<accessibility key="accessibilityConfiguration" label="Route"/>
<inset key="titleEdgeInsets" minX="0.0" minY="38" maxX="0.0" maxY="0.0"/>
<state key="normal" image="routes_default.png">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="disabled" image="routes_disabled.png"/>
<state key="selected" image="routes_selected.png"/>
<state key="highlighted" backgroundImage="color_E.png"/>
</button>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>

View file

@ -716,8 +716,8 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" flexibleMaxY="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" tag="7" contentMode="scaleAspectFit" image="avatar.png" id="gyO-uH-sSi" userLabel="avatarImage" customClass="UIRoundedImageView">
<rect key="frame" x="248" y="74" width="171" height="171"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
<rect key="frame" x="253" y="80" width="161" height="161"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration" label="Contact avatar">
<accessibilityTraits key="traits" image="YES" notEnabled="YES"/>
<bool key="isElement" value="YES"/>

View file

@ -47,7 +47,7 @@
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="color_F.png" id="56Z-ia-Pln" userLabel="backgroundColor">
<rect key="frame" x="0.0" y="0.0" width="540" height="66"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" flexibleMaxY="YES"/>
</imageView>
<textField opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Enter a number or an address" adjustsFontSizeToFit="NO" minimumFontSize="5" id="4" userLabel="addressField" customClass="UIAddressTextField">
<rect key="frame" x="31" y="0.0" width="426" height="66"/>
@ -55,7 +55,7 @@
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<accessibility key="accessibilityConfiguration" label="Enter a address"/>
<fontDescription key="fontDescription" type="system" pointSize="33"/>
<textInputTraits key="textInputTraits" autocorrectionType="no" keyboardType="alphabet"/>
<textInputTraits key="textInputTraits" autocorrectionType="no" keyboardType="alphabet" returnKeyType="join"/>
<connections>
<action selector="onAddressChange:" destination="-1" eventType="editingChanged" id="FdS-Kl-3dS"/>
<outlet property="delegate" destination="-1" id="190"/>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9531" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
@ -63,8 +63,8 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" tag="6" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="color_F.png" id="56Z-ia-Pln" userLabel="backgroundColor">
<rect key="frame" x="0.0" y="0.0" width="310" height="66"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<rect key="frame" x="0.0" y="0.0" width="310" height="80"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" flexibleMaxY="YES"/>
</imageView>
<textField opaque="NO" clearsContextBeforeDrawing="NO" tag="7" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Enter a number or an address" adjustsFontSizeToFit="NO" minimumFontSize="5" id="4" userLabel="addressField" customClass="UIAddressTextField">
<rect key="frame" x="8" y="0.0" width="239" height="80"/>
@ -72,7 +72,7 @@
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<accessibility key="accessibilityConfiguration" label="Enter a address"/>
<fontDescription key="fontDescription" type="system" pointSize="21"/>
<textInputTraits key="textInputTraits" autocorrectionType="no" keyboardType="alphabet"/>
<textInputTraits key="textInputTraits" autocorrectionType="no" keyboardType="alphabet" returnKeyType="join"/>
<connections>
<action selector="onAddressChange:" destination="-1" eventType="editingChanged" id="FdS-Kl-3dS"/>
<outlet property="delegate" destination="-1" id="190"/>
@ -389,8 +389,8 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" tag="6" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="color_F.png" id="oRb-An-MG9" userLabel="backgroundColor">
<rect key="frame" x="0.0" y="0.0" width="308" height="66"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<rect key="frame" x="0.0" y="0.0" width="308" height="80"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" flexibleMaxY="YES"/>
</imageView>
<textField opaque="NO" clearsContextBeforeDrawing="NO" tag="7" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Enter a number or an address" adjustsFontSizeToFit="NO" minimumFontSize="5" id="Omx-NU-xKz" userLabel="addressField" customClass="UIAddressTextField">
<rect key="frame" x="8" y="0.0" width="237" height="80"/>
@ -398,7 +398,7 @@
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<accessibility key="accessibilityConfiguration" label="Enter a address"/>
<fontDescription key="fontDescription" type="system" pointSize="21"/>
<textInputTraits key="textInputTraits" autocorrectionType="no" keyboardType="alphabet"/>
<textInputTraits key="textInputTraits" autocorrectionType="no" keyboardType="alphabet" returnKeyType="join"/>
<connections>
<action selector="onAddressChange:" destination="-1" eventType="editingChanged" id="Mrk-Jf-aVG"/>
<outlet property="delegate" destination="-1" id="I1Q-pW-WqW"/>
@ -709,7 +709,7 @@
<image name="color_L.png" width="2" height="2"/>
<image name="contact_add_default.png" width="34" height="29"/>
<image name="contact_add_disabled.png" width="34" height="29"/>
<image name="dialer_background.png" width="246" height="211"/>
<image name="dialer_background.png" width="408" height="350"/>
<image name="numpad_0_default.png" width="52" height="48"/>
<image name="numpad_0_over.png" width="52" height="48"/>
<image name="numpad_1_default.png" width="52" height="48"/>

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9060" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="SideMenuView">
@ -31,10 +31,9 @@
<rect key="frame" x="0.0" y="42" width="375" height="625"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view hidden="YES" alpha="0.80000000000000004" contentMode="scaleToFill" id="ccB-VK-LF9">
<view hidden="YES" alpha="0.69999999999999996" contentMode="scaleToFill" id="ccB-VK-LF9">
<rect key="frame" x="0.0" y="0.0" width="375" height="625"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
<connections>
<outletCollection property="gestureRecognizers" destination="56h-cQ-B5V" appends="YES" id="umX-R7-2IR"/>
@ -47,12 +46,10 @@
<imageView contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="color_F.png" id="90B-Re-hmt" userLabel="backgroundColor">
<rect key="frame" x="0.0" y="0.0" width="300" height="100"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" flexibleMaxY="YES"/>
<animations/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="John Doe" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="19" id="XbU-2B-u1b" userLabel="nameLabel">
<rect key="frame" x="76" y="15" width="224" height="31"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<animations/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="25"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
@ -60,7 +57,6 @@
<button opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" lineBreakMode="tailTruncation" id="MFj-XQ-w5V" userLabel="adressButton" customClass="UIRightImageButton">
<rect key="frame" x="76" y="54" width="224" height="22"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<animations/>
<inset key="titleEdgeInsets" minX="3" minY="0.0" maxX="0.0" maxY="0.0"/>
<state key="normal" title="john.doe@sip.linphone.org" image="led_connected.png">
<color key="titleColor" red="1" green="0.36862745099999999" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@ -70,13 +66,11 @@
<imageView contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="avatar.png" id="BNQ-7N-NGT" userLabel="avatarImage" customClass="UIRoundedImageView">
<rect key="frame" x="8" y="20" width="60" height="60"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<animations/>
<connections>
<outletCollection property="gestureRecognizers" destination="Kej-uL-ntg" appends="YES" id="eog-XV-xok"/>
</connections>
</imageView>
</subviews>
<animations/>
<gestureRecognizers/>
<connections>
<outletCollection property="gestureRecognizers" destination="1kD-az-BAx" appends="YES" id="OGc-fj-HQy"/>
@ -85,7 +79,6 @@
<tableView clipsSubviews="YES" contentMode="scaleToFill" bounces="NO" style="plain" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="Ttt-1k-jAm">
<rect key="frame" x="0.0" y="100" width="300" height="525"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" heightSizable="YES" flexibleMaxY="YES"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<connections>
<outlet property="dataSource" destination="Yyh-z6-IGO" id="ytx-b8-NGX"/>
@ -93,7 +86,6 @@
</connections>
</tableView>
</subviews>
<animations/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<gestureRecognizers/>
<connections>
@ -101,7 +93,6 @@
</connections>
</view>
</subviews>
<animations/>
<color key="backgroundColor" red="1" green="1" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina47"/>
<point key="canvasLocation" x="322.5" y="209.5"/>

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9060" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="SideMenuView">
@ -34,7 +34,6 @@
<view hidden="YES" alpha="0.80000000000000004" contentMode="scaleToFill" id="ccB-VK-LF9">
<rect key="frame" x="0.0" y="0.0" width="375" height="625"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
<connections>
<outletCollection property="gestureRecognizers" destination="56h-cQ-B5V" appends="YES" id="umX-R7-2IR"/>
@ -47,12 +46,10 @@
<imageView contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="color_F.png" id="90B-Re-hmt" userLabel="backgroundColor">
<rect key="frame" x="0.0" y="0.0" width="187" height="100"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" flexibleMaxY="YES"/>
<animations/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="John Doe" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="19" id="XbU-2B-u1b" userLabel="nameLabel">
<rect key="frame" x="76" y="15" width="111" height="31"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<animations/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="25"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
@ -60,7 +57,6 @@
<button opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" lineBreakMode="tailTruncation" id="MFj-XQ-w5V" userLabel="adressButton" customClass="UIRightImageButton">
<rect key="frame" x="76" y="54" width="111" height="22"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<animations/>
<inset key="titleEdgeInsets" minX="3" minY="0.0" maxX="0.0" maxY="0.0"/>
<state key="normal" title="john.doe@sip.linphone.org" image="led_connected.png">
<color key="titleColor" red="1" green="0.36862745099999999" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@ -70,13 +66,11 @@
<imageView contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="avatar.png" id="BNQ-7N-NGT" userLabel="avatarImage" customClass="UIRoundedImageView">
<rect key="frame" x="8" y="20" width="60" height="60"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<animations/>
<connections>
<outletCollection property="gestureRecognizers" destination="Kej-uL-ntg" appends="YES" id="eog-XV-xok"/>
</connections>
</imageView>
</subviews>
<animations/>
<gestureRecognizers/>
<connections>
<outletCollection property="gestureRecognizers" destination="1kD-az-BAx" appends="YES" id="OGc-fj-HQy"/>
@ -85,7 +79,6 @@
<tableView clipsSubviews="YES" contentMode="scaleToFill" bounces="NO" style="plain" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="Ttt-1k-jAm">
<rect key="frame" x="0.0" y="100" width="187" height="525"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES" flexibleMaxY="YES"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<connections>
<outlet property="dataSource" destination="Yyh-z6-IGO" id="ytx-b8-NGX"/>
@ -93,7 +86,6 @@
</connections>
</tableView>
</subviews>
<animations/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<gestureRecognizers/>
<connections>
@ -101,7 +93,6 @@
</connections>
</view>
</subviews>
<animations/>
<color key="backgroundColor" red="1" green="1" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina47"/>
<point key="canvasLocation" x="322.5" y="209.5"/>

View file

@ -48,7 +48,7 @@
#pragma mark - UITableViewDataSource Functions
- (LinphoneCall *)conferenceCallForRow:(NSInteger)row {
const MSList *calls = linphone_core_get_calls([LinphoneManager getLc]);
const MSList *calls = linphone_core_get_calls(LC);
int i = -1;
while (calls) {
if (linphone_call_params_get_local_conference_mode(linphone_call_get_current_params(calls->data))) {
@ -74,7 +74,7 @@
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
const MSList *calls = linphone_core_get_calls([LinphoneManager getLc]);
const MSList *calls = linphone_core_get_calls(LC);
int count = 0;
while (calls) {
if (linphone_call_params_get_local_conference_mode(linphone_call_get_current_params(calls->data))) {

View file

@ -30,16 +30,16 @@
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(callUpdateEvent:)
name:kLinphoneCallUpdate
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(callUpdateEvent:)
name:kLinphoneCallUpdate
object:nil];
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[[NSNotificationCenter defaultCenter] removeObserver:self name:kLinphoneCallUpdate object:nil];
[NSNotificationCenter.defaultCenter removeObserver:self name:kLinphoneCallUpdate object:nil];
}
#pragma mark - UICompositeViewDelegate Functions

View file

@ -35,6 +35,7 @@
@property(weak, nonatomic) IBOutlet UIBluetoothButton *routesBluetoothButton;
@property(weak, nonatomic) IBOutlet UIButton *routesEarpieceButton;
@property(weak, nonatomic) IBOutlet UISpeakerButton *routesSpeakerButton;
@property(weak, nonatomic) IBOutlet UIMicroButton *microButton;
- (IBAction)onDeclineClick:(id)sender;

View file

@ -48,16 +48,14 @@ static UICompositeViewDescription *compositeDescription = nil;
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(bluetoothAvailabilityUpdateEvent:)
name:kLinphoneBluetoothAvailabilityUpdate
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(bluetoothAvailabilityUpdateEvent:)
name:kLinphoneBluetoothAvailabilityUpdate
object:nil];
LinphoneCall *call = linphone_core_get_current_call([LinphoneManager getLc]);
LinphoneCall *call = linphone_core_get_current_call(LC);
if (!call) {
if (![PhoneMainView.instance popCurrentView]) {
[PhoneMainView.instance changeCurrentView:DialerView.compositeViewDescription];
}
[PhoneMainView.instance popCurrentView];
} else {
const LinphoneAddress *addr = linphone_call_get_remote_address(call);
[ContactDisplay setDisplayNameLabel:_nameLabel forAddress:addr];
@ -68,6 +66,10 @@ static UICompositeViewDescription *compositeDescription = nil;
}
[self hideSpeaker:LinphoneManager.instance.bluetoothAvailable];
[_speakerButton update];
[_microButton update];
[_routesButton update];
}
- (void)viewWillDisappear:(BOOL)animated {
@ -77,35 +79,32 @@ static UICompositeViewDescription *compositeDescription = nil;
- (IBAction)onRoutesBluetoothClick:(id)sender {
[self hideRoutes:TRUE animated:TRUE];
[[LinphoneManager instance] setBluetoothEnabled:TRUE];
[LinphoneManager.instance setBluetoothEnabled:TRUE];
}
- (IBAction)onRoutesEarpieceClick:(id)sender {
[self hideRoutes:TRUE animated:TRUE];
[[LinphoneManager instance] setSpeakerEnabled:FALSE];
[[LinphoneManager instance] setBluetoothEnabled:FALSE];
[LinphoneManager.instance setSpeakerEnabled:FALSE];
[LinphoneManager.instance setBluetoothEnabled:FALSE];
}
- (IBAction)onRoutesSpeakerClick:(id)sender {
[self hideRoutes:TRUE animated:TRUE];
[[LinphoneManager instance] setSpeakerEnabled:TRUE];
[LinphoneManager.instance setSpeakerEnabled:TRUE];
}
- (IBAction)onRoutesClick:(id)sender {
if ([_routesView isHidden]) {
[self hideRoutes:FALSE animated:[[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"]];
[self hideRoutes:FALSE animated:ANIMATED];
} else {
[self hideRoutes:TRUE animated:[[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"]];
[self hideRoutes:TRUE animated:ANIMATED];
}
}
- (IBAction)onDeclineClick:(id)sender {
LinphoneCall *call = linphone_core_get_current_call([LinphoneManager getLc]);
LinphoneCall *call = linphone_core_get_current_call(LC);
if (call) {
linphone_core_terminate_call([LinphoneManager getLc], call);
}
if (![PhoneMainView.instance popCurrentView]) {
[PhoneMainView.instance changeCurrentView:DialerView.compositeViewDescription];
linphone_core_terminate_call(LC, call);
}
}
@ -124,11 +123,7 @@ static UICompositeViewDescription *compositeDescription = nil;
_routesEarpieceButton.selected = !_routesBluetoothButton.selected && !_routesSpeakerButton.selected;
if (hidden != _routesView.hidden) {
// if (animated) {
// [self hideAnimation:hidden forView:_routesView completion:nil];
// } else {
[_routesView setHidden:hidden];
// }
}
}

View file

@ -54,7 +54,7 @@
#pragma mark - UITableViewDataSource Functions
- (LinphoneCall *)conferenceCallForRow:(NSInteger)row {
const MSList *calls = linphone_core_get_calls([LinphoneManager getLc]);
const MSList *calls = linphone_core_get_calls(LC);
int i = -1;
while (calls) {
if (linphone_call_get_state(calls->data) == LinphoneCallPaused) {
@ -81,7 +81,7 @@
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
const MSList *calls = linphone_core_get_calls([LinphoneManager getLc]);
const MSList *calls = linphone_core_get_calls(LC);
int count = 0;
int conference_in_pause = 0;
while (calls) {
@ -90,7 +90,7 @@
count++;
}
if (linphone_call_params_get_local_conference_mode(linphone_call_get_current_params(call)) &&
!linphone_core_is_in_conference([LinphoneManager getLc])) {
!linphone_core_is_in_conference(LC)) {
conference_in_pause = 1;
}
calls = calls->next;

View file

@ -134,7 +134,7 @@
}
- (void)updateStats:(NSTimer *)timer {
LinphoneCall *call = linphone_core_get_current_call([LinphoneManager getLc]);
LinphoneCall *call = linphone_core_get_current_call(LC);
if (!call) {
_statsLabel.text = NSLocalizedString(@"No call in progress", nil);

View file

@ -123,7 +123,7 @@ static UICompositeViewDescription *compositeDescription = nil;
- (void)viewDidUnload {
[PhoneMainView.instance.view removeGestureRecognizer:singleFingerTap];
// Remove all observer
[[NSNotificationCenter defaultCenter] removeObserver:self];
[NSNotificationCenter.defaultCenter removeObserver:self];
[super viewDidUnload];
}
@ -134,7 +134,7 @@ static UICompositeViewDescription *compositeDescription = nil;
[self updateUnreadMessage:FALSE];
// Update on show
LinphoneCall *call = linphone_core_get_current_call([LinphoneManager getLc]);
LinphoneCall *call = linphone_core_get_current_call(LC);
LinphoneCallState state = (call != NULL) ? linphone_call_get_state(call) : 0;
[self callUpdate:call state:state animated:FALSE];
[self hideRoutes:TRUE animated:FALSE];
@ -144,24 +144,26 @@ static UICompositeViewDescription *compositeDescription = nil;
[self callDurationUpdate];
[self onCurrentCallChange];
// Set windows (warn memory leaks)
linphone_core_set_native_video_window_id([LinphoneManager getLc], (__bridge void *)(_videoView));
linphone_core_set_native_preview_window_id([LinphoneManager getLc], (__bridge void *)(_videoPreview));
linphone_core_set_native_video_window_id(LC, (__bridge void *)(_videoView));
linphone_core_set_native_preview_window_id(LC, (__bridge void *)(_videoPreview));
[self previewTouchLift];
// Enable tap
[singleFingerTap setEnabled:TRUE];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(messageReceived:)
name:kLinphoneMessageReceived
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(bluetoothAvailabilityUpdateEvent:)
name:kLinphoneBluetoothAvailabilityUpdate
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(callUpdateEvent:)
name:kLinphoneCallUpdate
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(messageReceived:)
name:kLinphoneMessageReceived
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(bluetoothAvailabilityUpdateEvent:)
name:kLinphoneBluetoothAvailabilityUpdate
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(callUpdateEvent:)
name:kLinphoneCallUpdate
object:nil];
[NSTimer scheduledTimerWithTimeInterval:1
target:self
@ -202,7 +204,7 @@ static UICompositeViewDescription *compositeDescription = nil;
}
// Remove observer
[[NSNotificationCenter defaultCenter] removeObserver:self];
[NSNotificationCenter.defaultCenter removeObserver:self];
}
- (void)viewDidDisappear:(BOOL)animated {
@ -215,7 +217,7 @@ static UICompositeViewDescription *compositeDescription = nil;
// Disable tap
[singleFingerTap setEnabled:FALSE];
if (linphone_core_get_calls_nb([LinphoneManager getLc]) == 0) {
if (linphone_core_get_calls_nb(LC) == 0) {
// reseting speaker button because no more call
_speakerButton.selected = FALSE;
}
@ -240,7 +242,7 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
}
- (void)updateBottomBar:(LinphoneCall *)call state:(LinphoneCallState)state {
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneCore *lc = LC;
[_speakerButton update];
[_microButton update];
@ -356,7 +358,7 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
// only show camera switch button if we have more than 1 camera
_videoCameraSwitch.hidden = (disabled || !LinphoneManager.instance.frontCamId);
_videoPreview.hidden = (disabled || !linphone_core_self_view_enabled([LinphoneManager getLc]));
_videoPreview.hidden = (disabled || !linphone_core_self_view_enabled(LC));
if (hideControlsTimer != nil) {
[hideControlsTimer invalidate];
@ -379,7 +381,7 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
[_videoWaitingForFirstImage setHidden:NO];
[_videoWaitingForFirstImage startAnimating];
LinphoneCall *call = linphone_core_get_current_call([LinphoneManager getLc]);
LinphoneCall *call = linphone_core_get_current_call(LC);
// linphone_call_params_get_used_video_codec return 0 if no video stream enabled
if (call != NULL && linphone_call_params_get_used_video_codec(linphone_call_get_current_params(call))) {
linphone_call_set_next_video_frame_decoded_callback(call, hideSpinner, (__bridge void *)(self));
@ -403,14 +405,13 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
}
- (void)callDurationUpdate {
int duration = linphone_core_get_current_call([LinphoneManager getLc])
? linphone_call_get_duration(linphone_core_get_current_call([LinphoneManager getLc]))
: 0;
int duration =
linphone_core_get_current_call(LC) ? linphone_call_get_duration(linphone_core_get_current_call(LC)) : 0;
_durationLabel.text = [LinphoneUtils durationToString:duration];
}
- (void)onCurrentCallChange {
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneCore *lc = LC;
LinphoneCall *call = linphone_core_get_current_call(lc);
_noActiveCallView.hidden = (call || linphone_core_is_in_conference(lc));
@ -504,7 +505,7 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
}
- (void)callUpdate:(LinphoneCall *)call state:(LinphoneCallState)state animated:(BOOL)animated {
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneCore *lc = LC;
[self updateBottomBar:call state:state];
if (hiddenVolume) {
[PhoneMainView.instance setVolumeHidden:FALSE];
@ -594,7 +595,7 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
#pragma mark - ActionSheet Functions
- (void)displayAskToEnableVideoCall:(LinphoneCall *)call {
if (linphone_core_get_video_policy([LinphoneManager getLc])->automatically_accept)
if (linphone_core_get_video_policy(LC)->automatically_accept)
return;
NSString *username = [FastAddressBook displayNameForAddress:linphone_call_get_remote_address(call)];
@ -604,9 +605,9 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
confirmMessage:NSLocalizedString(@"ACCEPT", nil)
onCancelClick:^() {
LOGI(@"User declined video proposal");
if (call == linphone_core_get_current_call([LinphoneManager getLc])) {
if (call == linphone_core_get_current_call(LC)) {
LinphoneCallParams *paramsCopy = linphone_call_params_copy(linphone_call_get_current_params(call));
linphone_core_accept_call_update([LinphoneManager getLc], call, paramsCopy);
linphone_core_accept_call_update(LC, call, paramsCopy);
linphone_call_params_destroy(paramsCopy);
[videoDismissTimer invalidate];
videoDismissTimer = nil;
@ -614,10 +615,10 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
}
onConfirmationClick:^() {
LOGI(@"User accept video proposal");
if (call == linphone_core_get_current_call([LinphoneManager getLc])) {
if (call == linphone_core_get_current_call(LC)) {
LinphoneCallParams *paramsCopy = linphone_call_params_copy(linphone_call_get_current_params(call));
linphone_call_params_enable_video(paramsCopy, TRUE);
linphone_core_accept_call_update([LinphoneManager getLc], call, paramsCopy);
linphone_core_accept_call_update(LC, call, paramsCopy);
linphone_call_params_destroy(paramsCopy);
[videoDismissTimer invalidate];
videoDismissTimer = nil;
@ -674,71 +675,66 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
- (IBAction)onNumpadClick:(id)sender {
if ([_numpadView isHidden]) {
[self hidePad:FALSE animated:[[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"]];
[self hidePad:FALSE animated:ANIMATED];
} else {
[self hidePad:TRUE animated:[[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"]];
[self hidePad:TRUE animated:ANIMATED];
}
}
- (IBAction)onChatClick:(id)sender {
ChatsListView *view = VIEW(ChatsListView);
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
[PhoneMainView.instance changeCurrentView:ChatsListView.compositeViewDescription];
}
- (IBAction)onRoutesBluetoothClick:(id)sender {
[self hideRoutes:TRUE animated:TRUE];
[[LinphoneManager instance] setBluetoothEnabled:TRUE];
[LinphoneManager.instance setBluetoothEnabled:TRUE];
}
- (IBAction)onRoutesEarpieceClick:(id)sender {
[self hideRoutes:TRUE animated:TRUE];
[[LinphoneManager instance] setSpeakerEnabled:FALSE];
[[LinphoneManager instance] setBluetoothEnabled:FALSE];
[LinphoneManager.instance setSpeakerEnabled:FALSE];
[LinphoneManager.instance setBluetoothEnabled:FALSE];
}
- (IBAction)onRoutesSpeakerClick:(id)sender {
[self hideRoutes:TRUE animated:TRUE];
[[LinphoneManager instance] setSpeakerEnabled:TRUE];
[LinphoneManager.instance setSpeakerEnabled:TRUE];
}
- (IBAction)onRoutesClick:(id)sender {
if ([_routesView isHidden]) {
[self hideRoutes:FALSE animated:[[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"]];
[self hideRoutes:FALSE animated:ANIMATED];
} else {
[self hideRoutes:TRUE animated:[[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"]];
[self hideRoutes:TRUE animated:ANIMATED];
}
}
- (IBAction)onOptionsTransferClick:(id)sender {
[self hideOptions:TRUE animated:TRUE];
// Go to dialer view
DialerView *view = VIEW(DialerView);
[view setAddress:@""];
[view setTransferMode:TRUE];
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
if (view != nil) {
[view setAddress:@""];
[view setTransferMode:TRUE];
}
}
- (IBAction)onOptionsAddClick:(id)sender {
[self hideOptions:TRUE animated:TRUE];
// Go to dialer view
DialerView *view = VIEW(DialerView);
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
[view setAddress:@""];
[view setTransferMode:FALSE];
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
}
- (IBAction)onOptionsClick:(id)sender {
if ([_optionsView isHidden]) {
[self hideOptions:FALSE animated:[[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"]];
[self hideOptions:FALSE animated:ANIMATED];
} else {
[self hideOptions:TRUE animated:[[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"]];
[self hideOptions:TRUE animated:ANIMATED];
}
}
- (IBAction)onOptionsConferenceClick:(id)sender {
linphone_core_add_all_to_conference([LinphoneManager getLc]);
linphone_core_add_all_to_conference(LC);
}
#pragma mark - Animation

View file

@ -45,7 +45,7 @@
}];
// also add current entry, if not listed
NSString *nsuri = filter.lowercaseString;
LinphoneAddress *addr = linphone_core_interpret_url([LinphoneManager getLc], nsuri.UTF8String);
LinphoneAddress *addr = linphone_core_interpret_url(LC, nsuri.UTF8String);
if (addr) {
char *uri = linphone_address_as_string(addr);
nsuri = [NSString stringWithUTF8String:uri];
@ -81,7 +81,7 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
LinphoneChatRoom *room = linphone_core_get_chat_room_from_uri(
[LinphoneManager getLc], ((NSString *)[_contacts.allKeys objectAtIndex:indexPath.row]).UTF8String);
LC, ((NSString *)[_contacts.allKeys objectAtIndex:indexPath.row]).UTF8String);
if (!room) {
[PhoneMainView.instance popCurrentView];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Invalid address", nil)
@ -94,7 +94,7 @@
ChatConversationView *view = VIEW(ChatConversationView);
[view setChatRoom:room];
[PhoneMainView.instance popCurrentView];
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE];
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
}
}

View file

@ -54,7 +54,7 @@
messageList = linphone_chat_room_get_history(chatRoom, 0);
// also append transient upload messages because they are not in history yet!
for (FileTransferDelegate *ftd in [[LinphoneManager instance] fileTransferDelegates]) {
for (FileTransferDelegate *ftd in [LinphoneManager.instance fileTransferDelegates]) {
const LinphoneAddress *ftd_peer =
linphone_chat_room_get_peer_address(linphone_chat_message_get_chat_room(ftd.message));
const LinphoneAddress *peer = linphone_chat_room_get_peer_address(chatRoom);
@ -103,20 +103,6 @@
}
}
- (void)debugMessages {
if (!messageList) {
LOGE(@"No data to debug");
return;
}
MSList *item = messageList;
int count = 0;
while (item) {
LinphoneChatMessage *msg = (LinphoneChatMessage *)item->data;
LOGI(@"Message %d: %s", count++, linphone_chat_message_get_text(msg));
item = item->next;
}
}
- (void)scrollToLastUnread:(BOOL)animated {
if (messageList == nil || chatRoom == nil) {
return;

View file

@ -42,7 +42,7 @@
}
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[NSNotificationCenter.defaultCenter removeObserver:self];
}
#pragma mark - UICompositeViewDelegate Functions
@ -88,34 +88,34 @@ static UICompositeViewDescription *compositeDescription = nil;
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(applicationWillEnterForeground:)
name:UIApplicationDidBecomeActiveNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillShow:)
name:UIKeyboardWillShowNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillHide:)
name:UIKeyboardWillHideNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(textReceivedEvent:)
name:kLinphoneMessageReceived
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(onMessageChange:)
name:UITextViewTextDidChangeNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(textComposeEvent:)
name:kLinphoneTextComposeEvent
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(callUpdateEvent:)
name:kLinphoneCallUpdate
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(applicationWillEnterForeground:)
name:UIApplicationDidBecomeActiveNotification
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(keyboardWillShow:)
name:UIKeyboardWillShowNotification
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(keyboardWillHide:)
name:UIKeyboardWillHideNotification
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(textReceivedEvent:)
name:kLinphoneMessageReceived
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(onMessageChange:)
name:UITextViewTextDidChangeNotification
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(textComposeEvent:)
name:kLinphoneTextComposeEvent
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(callUpdateEvent:)
name:kLinphoneCallUpdate
object:nil];
[_backToCallButton update];
@ -124,7 +124,7 @@ static UICompositeViewDescription *compositeDescription = nil;
}
[[_tableController tableView] reloadData];
BOOL fileSharingEnabled = linphone_core_get_file_transfer_server([LinphoneManager getLc]) != NULL;
BOOL fileSharingEnabled = linphone_core_get_file_transfer_server(LC) != NULL;
[_pictureButton setEnabled:fileSharingEnabled];
[self callUpdateEvent:nil];
@ -137,7 +137,7 @@ static UICompositeViewDescription *compositeDescription = nil;
[self setComposingVisible:FALSE withDelay:0]; // will hide the "user is composing.." message
[[NSNotificationCenter defaultCenter] removeObserver:self];
[NSNotificationCenter.defaultCenter removeObserver:self];
}
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
@ -182,8 +182,7 @@ static UICompositeViewDescription *compositeDescription = nil;
}
- (void)callUpdateEvent:(NSNotification *)notif {
_callButton.hidden =
(_tableController.isEditing || linphone_core_get_current_call([LinphoneManager getLc]) != NULL);
_callButton.hidden = (_tableController.isEditing || linphone_core_get_current_call(LC) != NULL);
}
- (void)update {
@ -237,8 +236,7 @@ static UICompositeViewDescription *compositeDescription = nil;
- (void)saveAndSend:(UIImage *)image url:(NSURL *)url {
// photo from Camera, must be saved first
if (url == nil) {
[[LinphoneManager instance]
.photoLibrary
[LinphoneManager.instance.photoLibrary
writeImageToSavedPhotosAlbum:image.CGImage
orientation:(ALAssetOrientation)[image imageOrientation]
completionBlock:^(NSURL *assetURL, NSError *error) {
@ -331,7 +329,7 @@ static UICompositeViewDescription *compositeDescription = nil;
if (strcasecmp(cr_from_string, fromStr) == 0) {
if ([UIApplication sharedApplication].applicationState != UIApplicationStateBackground) {
linphone_chat_room_mark_as_read(room);
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneMessageReceived object:self];
[NSNotificationCenter.defaultCenter postNotificationName:kLinphoneMessageReceived object:self];
}
[_tableController addChatEntry:chat];
[_tableController scrollToLastUnread:TRUE];
@ -496,6 +494,7 @@ static UICompositeViewDescription *compositeDescription = nil;
}
- (IBAction)onDeleteClick:(id)sender {
LOGI(@"onDeleteClick");
NSString *msg = [NSString stringWithFormat:NSLocalizedString(@"Do you want to delete selected messages?", nil)];
[UIConfirmationDialog ShowWithMessage:msg
cancelMessage:nil
@ -516,13 +515,7 @@ static UICompositeViewDescription *compositeDescription = nil;
}
- (IBAction)onCallClick:(id)sender {
NSString *displayName = [FastAddressBook displayNameForAddress:linphone_chat_room_get_peer_address(chatRoom)];
// Go to dialer view
DialerView *view = VIEW(DialerView);
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
char *uri = linphone_address_as_string(linphone_chat_room_get_peer_address(chatRoom));
[view call:[NSString stringWithUTF8String:uri] displayName:displayName];
ms_free(uri);
[LinphoneManager.instance call:linphone_chat_room_get_peer_address(chatRoom) transfer:NO];
}
- (IBAction)onListSwipe:(id)sender {

View file

@ -58,8 +58,8 @@
[super viewDidAppear:animated];
// we cannot do that in viewWillAppear because we will change view while previous transition
// was not finished, leading to "[CALayer retain]: message sent to deallocated instance" error msg
if (IPAD && [self totalNumberOfItems] == 0) {
[PhoneMainView.instance changeCurrentView:ChatConversationCreateView.compositeViewDescription];
if (IPAD && [self totalNumberOfItems] > 0) {
[PhoneMainView.instance changeCurrentView:ChatConversationView.compositeViewDescription];
}
}
@ -82,7 +82,7 @@ static int sorted_history_comparison(LinphoneChatRoom *to_insert, LinphoneChatRo
- (MSList *)sortChatRooms {
MSList *sorted = nil;
const MSList *unsorted = linphone_core_get_chat_rooms([LinphoneManager getLc]);
const MSList *unsorted = linphone_core_get_chat_rooms(LC);
const MSList *iter = unsorted;
while (iter) {
@ -163,7 +163,7 @@ static void chatTable_free_chatrooms(void *data) {
UIChatCell *cell = (UIChatCell *)[tableView cellForRowAtIndexPath:indexPath];
[cell updateUnreadBadge];
}
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE];
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
}
}
@ -181,7 +181,7 @@ static void chatTable_free_chatrooms(void *data) {
}
FileTransferDelegate *ftdToDelete = nil;
for (FileTransferDelegate *ftd in [[LinphoneManager instance] fileTransferDelegates]) {
for (FileTransferDelegate *ftd in [LinphoneManager.instance fileTransferDelegates]) {
if (linphone_chat_message_get_chat_room(ftd.message) == chatRoom) {
ftdToDelete = ftd;
break;
@ -193,7 +193,7 @@ static void chatTable_free_chatrooms(void *data) {
data = ms_list_remove(data, chatRoom);
// will force a call to [self loadData]
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneMessageReceived object:self];
[NSNotificationCenter.defaultCenter postNotificationName:kLinphoneMessageReceived object:self];
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
withRowAnimation:UITableViewRowAnimationFade];
@ -211,7 +211,7 @@ static void chatTable_free_chatrooms(void *data) {
}
FileTransferDelegate *ftdToDelete = nil;
for (FileTransferDelegate *ftd in [[LinphoneManager instance] fileTransferDelegates]) {
for (FileTransferDelegate *ftd in [LinphoneManager.instance fileTransferDelegates]) {
if (linphone_chat_message_get_chat_room(ftd.message) == chatRoom) {
ftdToDelete = ftd;
break;
@ -223,7 +223,7 @@ static void chatTable_free_chatrooms(void *data) {
data = ms_list_remove(data, chatRoom);
// will force a call to [self loadData]
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneMessageReceived object:self];
[NSNotificationCenter.defaultCenter postNotificationName:kLinphoneMessageReceived object:self];
}];
}

View file

@ -27,10 +27,10 @@
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(textReceivedEvent:)
name:kLinphoneMessageReceived
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(textReceivedEvent:)
name:kLinphoneMessageReceived
object:nil];
[_backToCallButton update];
[self setEditing:NO];
}
@ -38,7 +38,7 @@
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[[NSNotificationCenter defaultCenter] removeObserver:self name:kLinphoneMessageReceived object:nil];
[NSNotificationCenter.defaultCenter removeObserver:self name:kLinphoneMessageReceived object:nil];
}
#pragma mark - Event Functions
@ -59,7 +59,7 @@ static UICompositeViewDescription *compositeDescription = nil;
sideMenu:SideMenuView.class
fullscreen:false
isLeftFragment:YES
fragmentWith:ChatConversationView.class];
fragmentWith:ChatConversationCreateView.class];
}
return compositeDescription;
}
@ -71,8 +71,7 @@ static UICompositeViewDescription *compositeDescription = nil;
#pragma mark - Action Functions
- (IBAction)onAddClick:(id)event {
ChatConversationCreateView *view = VIEW(ChatConversationCreateView);
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:YES];
[PhoneMainView.instance changeCurrentView:ChatConversationCreateView.compositeViewDescription];
}
- (IBAction)onEditionChangeClick:(id)sender {

View file

@ -64,7 +64,7 @@
for (int i = 0; i < ABMultiValueGetCount(map); ++i) {
CFDictionaryRef lDict = ABMultiValueCopyValueAtIndex(map, i);
if (CFDictionaryContainsKey(lDict, kABPersonInstantMessageServiceKey)) {
if (CFStringCompare((CFStringRef)[LinphoneManager instance].contactSipField,
if (CFStringCompare((CFStringRef)LinphoneManager.instance.contactSipField,
CFDictionaryGetValue(lDict, kABPersonInstantMessageServiceKey),
kCFCompareCaseInsensitive) == 0) {
NSString *value = (NSString *)(CFDictionaryGetValue(lDict, kABPersonInstantMessageUsernameKey));
@ -211,7 +211,7 @@
- (BOOL)addSipAddress:(NSString *)sip {
NSDictionary *lDict = @{
(NSString *) kABPersonInstantMessageUsernameKey : sip, (NSString *)
kABPersonInstantMessageServiceKey : [LinphoneManager instance].contactSipField
kABPersonInstantMessageServiceKey : LinphoneManager.instance.contactSipField
};
BOOL ret = [self addInProperty:kABPersonInstantMessageProperty value:(__bridge CFTypeRef)(lDict)];

View file

@ -34,7 +34,7 @@
} else if (section == ContactSections_Sip) {
return _contact.sipAddresses;
} else if (section == ContactSections_Email) {
if ([[LinphoneManager instance] lpConfigBoolForKey:@"show_contacts_emails_preference"] == true) {
if ([LinphoneManager.instance lpConfigBoolForKey:@"show_contacts_emails_preference"] == true) {
return _contact.emails;
}
}
@ -166,8 +166,8 @@
} else if ([indexPath section] == ContactSections_Sip) {
value = _contact.sipAddresses[indexPath.row];
LinphoneAddress *addr = NULL;
if ([[LinphoneManager instance] lpConfigBoolForKey:@"contact_display_username_only"] &&
(addr = linphone_address_new([value UTF8String]))) {
if ([LinphoneManager.instance lpConfigBoolForKey:@"contact_display_username_only"] &&
(addr = linphone_core_interpret_url(LC, [value UTF8String]))) {
value = [NSString stringWithCString:linphone_address_get_username(addr)
encoding:[NSString defaultCStringEncoding]];
linphone_address_destroy(addr);
@ -201,7 +201,7 @@
#pragma mark - UITableViewDelegate Functions
- (void)setEditing:(BOOL)editing animated:(BOOL)animated {
BOOL showEmails = [[LinphoneManager instance] lpConfigBoolForKey:@"show_contacts_emails_preference"];
BOOL showEmails = [LinphoneManager.instance lpConfigBoolForKey:@"show_contacts_emails_preference"];
if (editing) {
// add phone/SIP/email entries so that the user can add new data
for (int section = 0; section < [self numberOfSectionsInTableView:[self tableView]]; ++section) {

View file

@ -78,7 +78,7 @@ static void sync_address_book(ABAddressBookRef addressBook, CFDictionaryRef info
- (void)removeContact {
if (_contact != NULL) {
inhibUpdate = TRUE;
[[[LinphoneManager instance] fastAddressBook] removeContact:_contact];
[[LinphoneManager.instance fastAddressBook] removeContact:_contact];
inhibUpdate = FALSE;
}
[PhoneMainView.instance popCurrentView];
@ -111,7 +111,7 @@ static void sync_address_book(ABAddressBookRef addressBook, CFDictionaryRef info
} else {
LOGI(@"Save AddressBook: Success!");
}
[[LinphoneManager instance].fastAddressBook reload];
[LinphoneManager.instance.fastAddressBook reload];
}
- (void)selectContact:(ABRecordRef)acontact andReload:(BOOL)reload {
@ -131,15 +131,15 @@ static void sync_address_book(ABAddressBookRef addressBook, CFDictionaryRef info
}
- (void)addCurrentContactContactField:(NSString *)address {
LinphoneAddress *linphoneAddress = linphone_core_interpret_url([LinphoneManager getLc], address.UTF8String);
LinphoneAddress *linphoneAddress = linphone_core_interpret_url(LC, address.UTF8String);
NSString *username =
linphoneAddress ? [NSString stringWithUTF8String:linphone_address_get_username(linphoneAddress)] : address;
if (([username rangeOfString:@"@"].length > 0) &&
([[LinphoneManager instance] lpConfigBoolForKey:@"show_contacts_emails_preference"] == true)) {
([LinphoneManager.instance lpConfigBoolForKey:@"show_contacts_emails_preference"] == true)) {
[_tableController addEmailField:username];
} else if ((linphone_proxy_config_is_phone_number(NULL, [username UTF8String])) &&
([[LinphoneManager instance] lpConfigBoolForKey:@"save_new_contacts_as_phone_number"] == true)) {
([LinphoneManager.instance lpConfigBoolForKey:@"save_new_contacts_as_phone_number"] == true)) {
[_tableController addPhoneField:username];
} else {
[_tableController addSipField:address];
@ -312,7 +312,7 @@ static UICompositeViewDescription *compositeDescription = nil;
[VIEW(ImagePickerView).popoverController dismissPopoverAnimated:TRUE];
}
FastAddressBook *fab = [LinphoneManager instance].fastAddressBook;
FastAddressBook *fab = LinphoneManager.instance.fastAddressBook;
CFErrorRef error = NULL;
if (!ABPersonRemoveImageData(_contact, (CFErrorRef *)&error)) {
LOGI(@"Can't remove entry: %@", [(__bridge NSError *)error localizedDescription]);

View file

@ -229,7 +229,7 @@ static void sync_address_book(ABAddressBookRef addressBook, CFDictionaryRef info
// Go to Contact details view
ContactDetailsView *view = VIEW(ContactDetailsView);
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE];
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
if ([ContactSelection getSelectionMode] != ContactSelectionModeEdit) {
[view setContact:lPerson];
} else {
@ -254,7 +254,7 @@ static void sync_address_book(ABAddressBookRef addressBook, CFDictionaryRef info
[tableView deleteSections:[NSIndexSet indexSetWithIndex:indexPath.section]
withRowAnimation:UITableViewRowAnimationFade];
}
[[[LinphoneManager instance] fastAddressBook] removeContact:contact];
[[LinphoneManager.instance fastAddressBook] removeContact:contact];
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
withRowAnimation:UITableViewRowAnimationFade];
[tableView endUpdates];
@ -273,7 +273,7 @@ static void sync_address_book(ABAddressBookRef addressBook, CFDictionaryRef info
if ([self.tableView numberOfRowsInSection:indexPath.section] == 1) {
[addressBookMap removeObjectForKey:firstChar];
}
[[[LinphoneManager instance] fastAddressBook] removeContact:contact];
[[LinphoneManager.instance fastAddressBook] removeContact:contact];
}];
}

View file

@ -131,7 +131,7 @@ static UICompositeViewDescription *compositeDescription = nil;
cancelButtonTitle:NSLocalizedString(@"Continue", nil)
otherButtonTitles:nil];
[error show];
[PhoneMainView.instance changeCurrentView:DialerView.compositeViewDescription];
[PhoneMainView.instance popCurrentView];
}
}
@ -178,9 +178,8 @@ static UICompositeViewDescription *compositeDescription = nil;
}
- (IBAction)onAddContactClick:(id)event {
// Go to Contact details view
ContactDetailsView *view = VIEW(ContactDetailsView);
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE];
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
if ([ContactSelection getAddAddress] == nil) {
[view newContact];
} else {

View file

@ -31,8 +31,6 @@
}
- (void)setAddress:(NSString *)address;
- (void)call:(NSString *)address displayName:(NSString *)displayName;
- (void)call:(NSString *)address;
@property(nonatomic, assign) BOOL transferMode;

View file

@ -64,7 +64,7 @@
- (void)dealloc {
// Remove all observers
[[NSNotificationCenter defaultCenter] removeObserver:self];
[NSNotificationCenter.defaultCenter removeObserver:self];
}
#pragma mark - UICompositeViewDelegate Functions
@ -98,15 +98,15 @@ static UICompositeViewDescription *compositeDescription = nil;
!IPAD && UIInterfaceOrientationIsLandscape(PhoneMainView.instance.mainViewController.currentOrientation);
// Set observer
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(callUpdateEvent:)
name:kLinphoneCallUpdate
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(callUpdateEvent:)
name:kLinphoneCallUpdate
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(coreUpdateEvent:)
name:kLinphoneCoreUpdate
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(coreUpdateEvent:)
name:kLinphoneCoreUpdate
object:nil];
// technically not needed, but older versions of linphone had this button
// disabled by default. In this case, updating by pushing a new version with
@ -115,8 +115,8 @@ static UICompositeViewDescription *compositeDescription = nil;
[callButton setEnabled:TRUE];
// Update on show
LinphoneManager *mgr = [LinphoneManager instance];
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneManager *mgr = LinphoneManager.instance;
LinphoneCore *lc = LC;
LinphoneCall *call = linphone_core_get_current_call(lc);
LinphoneCallState state = (call != NULL) ? linphone_call_get_state(call) : 0;
[self callUpdate:call state:state];
@ -140,13 +140,15 @@ static UICompositeViewDescription *compositeDescription = nil;
[backgroundView setHidden:TRUE];
[videoCameraSwitch setHidden:TRUE];
}
} else {
linphone_core_enable_video_preview(lc, FALSE);
}
[addressField setText:@""];
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[[NSNotificationCenter defaultCenter] removeObserver:self];
[NSNotificationCenter.defaultCenter removeObserver:self];
}
- (void)viewDidLoad {
@ -180,7 +182,7 @@ static UICompositeViewDescription *compositeDescription = nil;
[oneButton addGestureRecognizer:oneLongGesture];
if (IPAD) {
if ([LinphoneManager instance].frontCamId != nil) {
if (LinphoneManager.instance.frontCamId != nil) {
// only show camera switch button if we have more than 1 camera
[videoCameraSwitch setHidden:FALSE];
}
@ -222,7 +224,7 @@ static UICompositeViewDescription *compositeDescription = nil;
- (void)coreUpdateEvent:(NSNotification *)notif {
if (IPAD) {
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneCore *lc = LC;
if (linphone_core_video_display_enabled(lc) && linphone_core_video_preview_enabled(lc)) {
linphone_core_set_native_preview_window_id(lc, (__bridge void *)(videoPreview));
[backgroundView setHidden:FALSE];
@ -288,7 +290,7 @@ static UICompositeViewDescription *compositeDescription = nil;
}
- (BOOL)displayDebugPopup:(NSString *)address {
LinphoneManager *mgr = [LinphoneManager instance];
LinphoneManager *mgr = LinphoneManager.instance;
NSString *debugAddress = [mgr lpConfigStringForKey:@"debug_popup_magic" withDefault:@""];
if (![debugAddress isEqualToString:@""] && [address isEqualToString:debugAddress]) {
@ -307,15 +309,14 @@ static UICompositeViewDescription *compositeDescription = nil;
[self presentMailViewWithTitle:appName forRecipients:@[ logsAddress ] attachLogs:true];
}];
BOOL debugEnabled = [[LinphoneManager instance] lpConfigBoolForKey:@"debugenable_preference"];
BOOL debugEnabled = [LinphoneManager.instance lpConfigBoolForKey:@"debugenable_preference"];
NSString *actionLog =
(debugEnabled ? NSLocalizedString(@"Disable logs", nil) : NSLocalizedString(@"Enable logs", nil));
[alertView addButtonWithTitle:actionLog
block:^{
// enable / disable
BOOL enableDebug = ![mgr lpConfigBoolForKey:@"debugenable_preference"];
[mgr lpConfigSetBool:enableDebug forKey:@"debugenable_preference"];
[mgr setLogsEnabled:enableDebug];
BOOL enableDebug = !debugEnabled;
[Log enableLogs:enableDebug];
}];
[alertView show];
@ -327,7 +328,7 @@ static UICompositeViewDescription *compositeDescription = nil;
#pragma mark -
- (void)callUpdate:(LinphoneCall *)call state:(LinphoneCallState)state {
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneCore *lc = LC;
BOOL callInProgress = (linphone_core_get_calls_nb(lc) > 0);
addCallButton.hidden = (!callInProgress || transferMode);
transferButton.hidden = (!callInProgress || !transferMode);
@ -342,23 +343,11 @@ static UICompositeViewDescription *compositeDescription = nil;
- (void)setTransferMode:(BOOL)atransferMode {
transferMode = atransferMode;
LinphoneCall *call = linphone_core_get_current_call([LinphoneManager getLc]);
LinphoneCall *call = linphone_core_get_current_call(LC);
LinphoneCallState state = (call != NULL) ? linphone_call_get_state(call) : 0;
[self callUpdate:call state:state];
}
- (void)call:(NSString *)address {
LinphoneAddress *addr = linphone_address_new(address.UTF8String);
NSString *displayName = addr ? [FastAddressBook displayNameForAddress:addr] : nil;
if (addr)
linphone_address_destroy(addr);
[self call:address displayName:displayName];
}
- (void)call:(NSString *)address displayName:(NSString *)displayName {
[[LinphoneManager instance] call:address displayName:displayName transfer:transferMode];
}
#pragma mark - UITextFieldDelegate Functions
- (BOOL)textField:(UITextField *)textField
@ -372,6 +361,12 @@ static UICompositeViewDescription *compositeDescription = nil;
if (textField == addressField) {
[addressField resignFirstResponder];
}
if (textField.text.length > 0) {
LinphoneAddress *addr = linphone_core_interpret_url(LC, textField.text.UTF8String);
[LinphoneManager.instance call:addr transfer:FALSE];
if (addr)
linphone_address_destroy(addr);
}
return YES;
}
@ -394,12 +389,11 @@ static UICompositeViewDescription *compositeDescription = nil;
[ContactSelection setSipFilter:nil];
[ContactSelection setNameOrEmailFilter:nil];
[ContactSelection enableEmailFilter:FALSE];
ContactsListView *view = VIEW(ContactsListView);
[PhoneMainView.instance changeCurrentView:view.class.compositeViewDescription push:TRUE];
[PhoneMainView.instance changeCurrentView:ContactsListView.compositeViewDescription];
}
- (IBAction)onBackClick:(id)event {
[PhoneMainView.instance changeCurrentView:CallView.compositeViewDescription];
[PhoneMainView.instance popToView:CallView.compositeViewDescription];
}
- (IBAction)onAddressChange:(id)sender {
@ -428,12 +422,15 @@ static UICompositeViewDescription *compositeDescription = nil;
}
- (void)onOneLongClick:(id)sender {
LinphoneManager *lm = [LinphoneManager instance];
LinphoneManager *lm = LinphoneManager.instance;
NSString *voiceMail = [lm lpConfigStringForKey:@"voice_mail_uri"];
if (voiceMail != nil) {
[lm call:voiceMail displayName:NSLocalizedString(@"Voice mail", nil) transfer:FALSE];
LinphoneAddress *addr = linphone_core_interpret_url(LC, voiceMail ? voiceMail.UTF8String : NULL);
if (addr) {
linphone_address_set_display_name(addr, NSLocalizedString(@"Voice mail", nil).UTF8String);
[lm call:addr transfer:FALSE];
linphone_address_destroy(addr);
} else {
LOGE(@"Cannot call voice mail because URI not set!");
LOGE(@"Cannot call voice mail because URI not set or invalid!");
}
}
@end

View file

@ -51,16 +51,16 @@ static UICompositeViewDescription *compositeDescription = nil;
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
// Set observer
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(registrationUpdateEvent:)
name:kLinphoneRegistrationUpdate
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(registrationUpdateEvent:)
name:kLinphoneRegistrationUpdate
object:nil];
[_usernameField setText:[[LinphoneManager instance] lpConfigStringForKey:@"assistant_username"]];
[_passwordField setText:[[LinphoneManager instance] lpConfigStringForKey:@"assistant_password"]];
[_usernameField setText:[LinphoneManager.instance lpConfigStringForKey:@"assistant_username"]];
[_passwordField setText:[LinphoneManager.instance lpConfigStringForKey:@"assistant_password"]];
// Update on show
const MSList *list = linphone_core_get_proxy_config_list([LinphoneManager getLc]);
const MSList *list = linphone_core_get_proxy_config_list(LC);
if (list != NULL) {
LinphoneProxyConfig *config = (LinphoneProxyConfig *)list->data;
if (config) {
@ -97,18 +97,18 @@ static UICompositeViewDescription *compositeDescription = nil;
[super viewWillDisappear:animated];
// Remove observer
[[NSNotificationCenter defaultCenter] removeObserver:self name:kLinphoneRegistrationUpdate object:nil];
[NSNotificationCenter.defaultCenter removeObserver:self name:kLinphoneRegistrationUpdate object:nil];
}
- (void)viewDidLoad {
[super viewDidLoad];
NSString *siteUrl = [[LinphoneManager instance] lpConfigStringForKey:@"first_login_view_url"];
NSString *siteUrl = [LinphoneManager.instance lpConfigStringForKey:@"first_login_view_url"];
if (siteUrl == nil) {
siteUrl = @"http://www.linphone.org";
}
[_siteButton setTitle:siteUrl forState:UIControlStateNormal];
account_creator = linphone_account_creator_new([LinphoneManager getLc], siteUrl.UTF8String);
account_creator = linphone_account_creator_new(LC, siteUrl.UTF8String);
}
- (void)shouldEnableNextButton {
@ -128,7 +128,7 @@ static UICompositeViewDescription *compositeDescription = nil;
- (void)registrationUpdate:(LinphoneRegistrationState)state {
switch (state) {
case LinphoneRegistrationOk: {
[[LinphoneManager instance] lpConfigSetBool:FALSE forKey:@"enable_first_login_view_preference"];
[LinphoneManager.instance lpConfigSetBool:FALSE forKey:@"enable_first_login_view_preference"];
[_waitView setHidden:true];
[PhoneMainView.instance changeCurrentView:DialerView.compositeViewDescription];
break;
@ -142,8 +142,8 @@ static UICompositeViewDescription *compositeDescription = nil;
[_waitView setHidden:true];
// erase uername passwd
[[LinphoneManager instance] lpConfigSetString:nil forKey:@"assistant_username"];
[[LinphoneManager instance] lpConfigSetString:nil forKey:@"assistant_password"];
[LinphoneManager.instance lpConfigSetString:nil forKey:@"assistant_username"];
[LinphoneManager.instance lpConfigSetString:nil forKey:@"assistant_password"];
break;
}
case LinphoneRegistrationProgress: {
@ -170,8 +170,8 @@ static UICompositeViewDescription *compositeDescription = nil;
domain:_domainField.text
OnSuccess:^(NSString *url) {
if (url) {
linphone_core_set_provisioning_uri([LinphoneManager getLc], url.UTF8String);
[[LinphoneManager instance] resetLinphoneCore];
linphone_core_set_provisioning_uri(LC, url.UTF8String);
[LinphoneManager.instance resetLinphoneCore];
} else {
_waitView.hidden = YES;
}

View file

@ -20,7 +20,7 @@
}
if (peer) {
const MSList *logs = linphone_core_get_call_history_for_address([LinphoneManager getLc], peer);
const MSList *logs = linphone_core_get_call_history_for_address(LC, peer);
while (logs != NULL) {
LinphoneCallLog *log = (LinphoneCallLog *)logs->data;
if (linphone_address_weak_equal(linphone_call_log_get_remote_address(log), peer)) {

View file

@ -72,20 +72,20 @@ static UICompositeViewDescription *compositeDescription = nil;
[self update];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(update)
name:kLinphoneAddressBookUpdate
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(update)
name:kLinphoneAddressBookUpdate
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(coreUpdateEvent:)
name:kLinphoneCoreUpdate
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(coreUpdateEvent:)
name:kLinphoneCoreUpdate
object:nil];
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[[NSNotificationCenter defaultCenter] removeObserver:self];
[NSNotificationCenter.defaultCenter removeObserver:self];
}
#pragma mark - Event Functions
@ -100,7 +100,7 @@ static UICompositeViewDescription *compositeDescription = nil;
// Look for the call log
callLog = NULL;
if (_callLogId) {
const MSList *list = linphone_core_get_call_logs([LinphoneManager getLc]);
const MSList *list = linphone_core_get_call_logs(LC);
while (list != NULL) {
LinphoneCallLog *log = (LinphoneCallLog *)list->data;
const char *cid = linphone_call_log_get_call_id(log);
@ -143,7 +143,7 @@ static UICompositeViewDescription *compositeDescription = nil;
ABRecordRef contact = [FastAddressBook getContactWithAddress:addr];
if (contact) {
ContactDetailsView *view = VIEW(ContactDetailsView);
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE];
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
[ContactSelection setSelectionMode:ContactSelectionModeNone];
[view setContact:contact];
}
@ -159,33 +159,24 @@ static UICompositeViewDescription *compositeDescription = nil;
[ContactSelection setSipFilter:nil];
[ContactSelection enableEmailFilter:FALSE];
[ContactSelection setNameOrEmailFilter:nil];
[PhoneMainView.instance changeCurrentView:ContactsListView.compositeViewDescription push:TRUE];
[PhoneMainView.instance changeCurrentView:ContactsListView.compositeViewDescription];
ms_free(lAddress);
}
}
- (IBAction)onCallClick:(id)event {
LinphoneAddress *addr = linphone_call_log_get_remote_address(callLog);
char *lAddress = linphone_address_as_string_uri_only(addr);
if (lAddress == NULL)
return;
NSString *displayName = [FastAddressBook displayNameForAddress:addr];
DialerView *view = VIEW(DialerView);
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
[view call:[NSString stringWithUTF8String:lAddress] displayName:displayName];
ms_free(lAddress);
[LinphoneManager.instance call:addr transfer:NO];
}
- (IBAction)onChatClick:(id)event {
const LinphoneAddress *addr = linphone_call_log_get_remote_address(callLog);
if (addr == NULL)
return;
[PhoneMainView.instance changeCurrentView:ChatsListView.compositeViewDescription];
ChatConversationView *view = VIEW(ChatConversationView);
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE];
LinphoneChatRoom *room = linphone_core_get_chat_room([LinphoneManager getLc], addr);
LinphoneChatRoom *room = linphone_core_get_chat_room(LC, addr);
[view setChatRoom:room];
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
}
@end

View file

@ -53,24 +53,24 @@
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(loadData)
name:kLinphoneAddressBookUpdate
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(loadData)
name:kLinphoneAddressBookUpdate
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(coreUpdateEvent:)
name:kLinphoneCoreUpdate
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(coreUpdateEvent:)
name:kLinphoneCoreUpdate
object:nil];
[self loadData];
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[[NSNotificationCenter defaultCenter] removeObserver:self name:kLinphoneAddressBookUpdate object:nil];
[NSNotificationCenter.defaultCenter removeObserver:self name:kLinphoneAddressBookUpdate object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:kLinphoneCoreUpdate object:nil];
[NSNotificationCenter.defaultCenter removeObserver:self name:kLinphoneCoreUpdate object:nil];
}
#pragma mark - Event Functions
@ -110,7 +110,7 @@
}
}
const MSList *logs = linphone_core_get_call_logs([LinphoneManager getLc]);
const MSList *logs = linphone_core_get_call_logs(LC);
self.sections = [NSMutableDictionary dictionary];
while (logs != NULL) {
LinphoneCallLog *log = (LinphoneCallLog *)logs->data;
@ -228,12 +228,7 @@
[cell onDetails:self];
} else {
LinphoneAddress *addr = linphone_call_log_get_remote_address(callLog);
char *uri = linphone_address_as_string(addr);
DialerView *view = VIEW(DialerView);
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
[view call:[NSString stringWithUTF8String:uri]
displayName:[FastAddressBook displayNameForAddress:addr]];
ms_free(uri);
[LinphoneManager.instance call:addr transfer:NO];
}
}
}
@ -248,10 +243,10 @@
LinphoneCallLog *callLog = [log pointerValue];
MSList *count = linphone_call_log_get_user_data(callLog);
while (count) {
linphone_core_remove_call_log([LinphoneManager getLc], count->data);
linphone_core_remove_call_log(LC, count->data);
count = count->next;
}
linphone_core_remove_call_log([LinphoneManager getLc], callLog);
linphone_core_remove_call_log(LC, callLog);
linphone_call_log_unref(callLog);
[[_sections objectForKey:_sortedDays[indexPath.section]] removeObject:log];
if (((NSArray *)[_sections objectForKey:_sortedDays[indexPath.section]]).count == 0) {
@ -273,10 +268,10 @@
LinphoneCallLog *callLog = [log pointerValue];
MSList *count = linphone_call_log_get_user_data(callLog);
while (count) {
linphone_core_remove_call_log([LinphoneManager getLc], count->data);
linphone_core_remove_call_log(LC, count->data);
count = count->next;
}
linphone_core_remove_call_log([LinphoneManager getLc], callLog);
linphone_core_remove_call_log(LC, callLog);
linphone_call_log_unref(callLog);
[[_sections objectForKey:_sortedDays[indexPath.section]] removeObject:log];
if (((NSArray *)[_sections objectForKey:_sortedDays[indexPath.section]]).count == 0) {

View file

@ -58,9 +58,9 @@ static UICompositeViewDescription *compositeDescription = nil;
[self onEditionChangeClick:nil];
// Reset missed call
linphone_core_reset_missed_calls_count([LinphoneManager getLc]);
linphone_core_reset_missed_calls_count(LC);
// Fake event
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneCallUpdate object:self];
[NSNotificationCenter.defaultCenter postNotificationName:kLinphoneCallUpdate object:self];
}
#pragma mark -

View file

@ -173,7 +173,7 @@ static UICompositeViewDescription *compositeDescription = nil;
void (^block)(UIImagePickerControllerSourceType) = ^(UIImagePickerControllerSourceType type) {
ImagePickerView *view = VIEW(ImagePickerView);
if (!(IPAD && ipadView && ipadPopoverView)) {
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE];
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
}
view.sourceType = type;

View file

@ -44,7 +44,7 @@
- (instancetype)init {
if ((self = [super init]) != nil) {
_enabled = (([SKPaymentQueue canMakePayments]) &&
([[LinphoneManager instance] lpConfigBoolForKey:@"enabled" inSection:@"in_app_purchase"]));
([LinphoneManager.instance lpConfigBoolForKey:@"enabled" inSection:@"in_app_purchase"]));
_initialized = false;
_available = false;
_accountActivationInProgress = false;
@ -107,8 +107,8 @@
monthly:(BOOL)monthly {
if (phoneNumber) {
NSString *productID =
[[LinphoneManager instance] lpConfigStringForKey:(monthly ? @"paid_account_id_monthly" : @"paid_account_id")
inSection:@"in_app_purchase"];
[LinphoneManager.instance lpConfigStringForKey:(monthly ? @"paid_account_id_monthly" : @"paid_account_id")
inSection:@"in_app_purchase"];
self.accountCreationData = @{ @"phoneNumber" : phoneNumber, @"password" : password, @"email" : email };
if (![self purchaseWitID:productID]) {
@ -123,8 +123,8 @@
if (phoneNumber) {
NSString *receiptBase64 = [self getReceipt];
if (receiptBase64) {
NSURL *URL = [NSURL URLWithString:[[LinphoneManager instance] lpConfigStringForKey:@"receipt_validation_url"
inSection:@"in_app_purchase"]];
NSURL *URL = [NSURL URLWithString:[LinphoneManager.instance lpConfigStringForKey:@"receipt_validation_url"
inSection:@"in_app_purchase"]];
XMLRPCRequest *request = [[XMLRPCRequest alloc] initWithURL:URL];
// buying for the first time: need to create the account
// if ([transaction.transactionIdentifier
@ -175,7 +175,7 @@
#pragma mark ProductListLoading
- (void)loadProducts {
NSArray *list = [[[[LinphoneManager instance] lpConfigStringForKey:@"products_list" inSection:@"in_app_purchase"]
NSArray *list = [[[LinphoneManager.instance lpConfigStringForKey:@"products_list" inSection:@"in_app_purchase"]
stringByReplacingOccurrencesOfString:@" "
withString:@""] componentsSeparatedByString:@","];
@ -262,8 +262,8 @@
if (latestReceiptMD5 == nil || ![latestReceiptMD5 isEqualToString:[receiptBase64 md5]]) {
// transaction is null when restoring user purchases at application start or if user clicks the "restore" button
// We must validate the receipt on our server
NSURL *URL = [NSURL URLWithString:[[LinphoneManager instance] lpConfigStringForKey:@"receipt_validation_url"
inSection:@"in_app_purchase"]];
NSURL *URL = [NSURL URLWithString:[LinphoneManager.instance lpConfigStringForKey:@"receipt_validation_url"
inSection:@"in_app_purchase"]];
XMLRPCRequest *request = [[XMLRPCRequest alloc] initWithURL:URL];
// buying for the first time: need to create the account
// if ([transaction.transactionIdentifier
@ -299,11 +299,11 @@
- (NSString *)getPhoneNumber {
NSString *phoneNumber = @"";
LinphoneProxyConfig *config = linphone_core_get_default_proxy_config([LinphoneManager getLc]);
LinphoneProxyConfig *config = linphone_core_get_default_proxy_config(LC);
if (config) {
const char *identity = linphone_proxy_config_get_identity(config);
if (identity) {
LinphoneAddress *addr = linphone_address_new(identity);
LinphoneAddress *addr = linphone_core_interpret_url(LC, identity);
if (addr) {
phoneNumber = [NSString stringWithUTF8String:linphone_address_get_username(addr)];
linphone_address_destroy(addr);
@ -374,7 +374,7 @@
- (void)postNotificationforStatus:(IAPPurchaseNotificationStatus)status withDict:(NSDictionary *)dict {
_status = status;
LOGI(@"Triggering notification for status %@", status);
[[NSNotificationCenter defaultCenter] postNotificationName:status object:self userInfo:dict];
[NSNotificationCenter.defaultCenter postNotificationName:status object:self userInfo:dict];
}
- (void)XMLRPCRequest:(XMLRPCRequest *)request didReceiveResponse:(XMLRPCResponse *)response {
@ -389,7 +389,7 @@
LOGI(@"XMLRPC response %@: %@", [request method], [response body]);
NSString *productID =
[[LinphoneManager instance] lpConfigStringForKey:@"paid_account_id" inSection:@"in_app_purchase"];
[LinphoneManager.instance lpConfigStringForKey:@"paid_account_id" inSection:@"in_app_purchase"];
// validation succeeded
if (![response isFault] && [response object] != nil) {
@ -479,7 +479,7 @@
#else
- (void)postNotificationforStatus:(IAPPurchaseNotificationStatus)status {
_status = status;
[[NSNotificationCenter defaultCenter] postNotificationName:status object:self userInfo:nil];
[NSNotificationCenter.defaultCenter postNotificationName:status object:self userInfo:nil];
LOGE(@"Not supported, triggering %@", status);
}
- (BOOL)purchaseAccount:(NSString *)phoneNumber
@ -526,11 +526,11 @@
#pragma mark - XMLRPCConnectionDelegate Functions
- (void)request:(XMLRPCRequest *)request didReceiveResponse:(XMLRPCResponse *)response {
[[[LinphoneManager instance] iapManager] XMLRPCRequest:request didReceiveResponse:response];
[[LinphoneManager.instance iapManager] XMLRPCRequest:request didReceiveResponse:response];
}
- (void)request:(XMLRPCRequest *)request didFailWithError:(NSError *)error {
[[[LinphoneManager instance] iapManager] XMLRPCRequest:request didFailWithError:error];
[[LinphoneManager.instance iapManager] XMLRPCRequest:request didFailWithError:error];
}
- (BOOL)request:(XMLRPCRequest *)request canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace {

@ -1 +1 @@
Subproject commit 21a137bc8068f9fb738f835c6e285d44fe2ce4dd
Subproject commit c01c063616dbdab05bea25eb94c7643a52f2b7dc

View file

@ -48,17 +48,17 @@
- (void)applicationDidEnterBackground:(UIApplication *)application {
LOGI(@"%@", NSStringFromSelector(_cmd));
[[LinphoneManager instance] enterBackgroundMode];
[LinphoneManager.instance enterBackgroundMode];
}
- (void)applicationWillResignActive:(UIApplication *)application {
LOGI(@"%@", NSStringFromSelector(_cmd));
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneCore *lc = LC;
LinphoneCall *call = linphone_core_get_current_call(lc);
if (call) {
/* save call context */
LinphoneManager *instance = [LinphoneManager instance];
LinphoneManager *instance = LinphoneManager.instance;
instance->currentCallContextBeforeGoingBackground.call = call;
instance->currentCallContextBeforeGoingBackground.cameraIsEnabled = linphone_call_camera_enabled(call);
@ -68,7 +68,7 @@
}
}
if (![[LinphoneManager instance] resignActive]) {
if (![LinphoneManager.instance resignActive]) {
}
}
@ -80,11 +80,11 @@
[PhoneMainView.instance startUp];
[PhoneMainView.instance updateStatusBar:nil];
}
LinphoneManager *instance = [LinphoneManager instance];
LinphoneManager *instance = LinphoneManager.instance;
[instance becomeActive];
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneCore *lc = LC;
LinphoneCall *call = linphone_core_get_current_call(lc);
if (call) {
@ -159,7 +159,7 @@
UIApplication *app = [UIApplication sharedApplication];
UIApplicationState state = app.applicationState;
LinphoneManager *instance = [LinphoneManager instance];
LinphoneManager *instance = LinphoneManager.instance;
BOOL background_mode = [instance lpConfigBoolForKey:@"backgroundmode_preference"];
BOOL start_at_boot = [instance lpConfigBoolForKey:@"start_at_boot_preference"];
@ -199,7 +199,7 @@
[[UIApplication sharedApplication] endBackgroundTask:bgStartId];
}];
[[LinphoneManager instance] startLinphoneCore];
[LinphoneManager.instance startLinphoneCore];
// initialize UI
[self.window makeKeyAndVisible];
[RootViewManager setupWithPortrait:(PhoneMainView *)self.window.rootViewController];
@ -220,15 +220,15 @@
- (void)applicationWillTerminate:(UIApplication *)application {
LOGI(@"%@", NSStringFromSelector(_cmd));
linphone_core_terminate_all_calls([LinphoneManager getLc]);
linphone_core_terminate_all_calls(LC);
// destroyLinphoneCore automatically unregister proxies but if we are using
// remote push notifications, we want to continue receiving them
if ([LinphoneManager instance].pushNotificationToken != nil) {
if (LinphoneManager.instance.pushNotificationToken != nil) {
// trick me! setting network reachable to false will avoid sending unregister
linphone_core_set_network_reachable([LinphoneManager getLc], FALSE);
linphone_core_set_network_reachable(LC, FALSE);
}
[[LinphoneManager instance] destroyLinphoneCore];
[LinphoneManager.instance destroyLinphoneCore];
}
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
@ -276,26 +276,23 @@
NSString *loc_key = [alert objectForKey:@"loc-key"];
/*if we receive a remote notification, it is probably because our TCP background socket was no more working.
As a result, break it and refresh registers in order to make sure to receive incoming INVITE or MESSAGE*/
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneCore *lc = LC;
if (linphone_core_get_calls(lc) == NULL) { // if there are calls, obviously our TCP socket shall be working
linphone_core_set_network_reachable(lc, FALSE);
[LinphoneManager instance].connectivity = none; /*force connectivity to be discovered again*/
[[LinphoneManager instance] refreshRegisters];
LinphoneManager.instance.connectivity = none; /*force connectivity to be discovered again*/
[LinphoneManager.instance refreshRegisters];
if (loc_key != nil) {
NSString *callId = [userInfo objectForKey:@"call-id"];
if (callId != nil) {
[[LinphoneManager instance] addPushCallId:callId];
[LinphoneManager.instance addPushCallId:callId];
} else {
LOGE(@"PushNotification: does not have call-id yet, fix it !");
}
if ([loc_key isEqualToString:@"IM_MSG"] || [loc_key isEqualToString:@"IM_FULLMSG"]) {
[PhoneMainView.instance changeCurrentView:ChatsListView.compositeViewDescription];
} else if ([loc_key isEqualToString:@"IC_MSG"]) {
[self fixRing];
}
}
@ -311,7 +308,7 @@
}
- (LinphoneChatRoom *)findChatRoomForContact:(NSString *)contact {
const MSList *rooms = linphone_core_get_chat_rooms([LinphoneManager getLc]);
const MSList *rooms = linphone_core_get_chat_rooms(LC);
const char *from = [contact UTF8String];
while (rooms) {
const LinphoneAddress *room_from_address = linphone_chat_room_get_peer_address((LinphoneChatRoom *)rooms->data);
@ -333,24 +330,23 @@
BOOL auto_answer = TRUE;
// some local notifications have an internal timer to relaunch themselves at specified intervals
if ([[notification.userInfo objectForKey:@"timer"] intValue] == 1) {
[[LinphoneManager instance] cancelLocalNotifTimerForCallId:[notification.userInfo objectForKey:@"callId"]];
auto_answer = [[LinphoneManager instance] lpConfigBoolForKey:@"autoanswer_notif_preference"];
[LinphoneManager.instance cancelLocalNotifTimerForCallId:[notification.userInfo objectForKey:@"callId"]];
auto_answer = [LinphoneManager.instance lpConfigBoolForKey:@"autoanswer_notif_preference"];
}
if (auto_answer) {
[[LinphoneManager instance] acceptCallForCallId:[notification.userInfo objectForKey:@"callId"]];
[LinphoneManager.instance acceptCallForCallId:[notification.userInfo objectForKey:@"callId"]];
}
} else if ([notification.userInfo objectForKey:@"from_addr"] != nil) {
NSString *remoteContact = (NSString *)[notification.userInfo objectForKey:@"from_addr"];
[PhoneMainView.instance changeCurrentView:ChatsListView.compositeViewDescription];
LinphoneChatRoom *room = [self findChatRoomForContact:remoteContact];
ChatConversationView *view = VIEW(ChatConversationView);
[view setChatRoom:room];
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE];
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
} else if ([notification.userInfo objectForKey:@"callLog"] != nil) {
NSString *callLog = (NSString *)[notification.userInfo objectForKey:@"callLog"];
HistoryDetailsView *view = VIEW(HistoryDetailsView);
[view setCallLogId:callLog];
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE];
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
}
}
@ -360,7 +356,7 @@
didReceiveRemoteNotification:(NSDictionary *)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
LOGI(@"%@ : %@", NSStringFromSelector(_cmd), userInfo);
LinphoneManager *lm = [LinphoneManager instance];
LinphoneManager *lm = LinphoneManager.instance;
// save the completion handler for later execution.
// 2 outcomes:
@ -373,7 +369,7 @@
userInfo:nil
repeats:FALSE];
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneCore *lc = LC;
// If no call is yet received at this time, then force Linphone to drop the current socket and make new one to
// register, so that we get
// a better chance to receive the INVITE.
@ -389,12 +385,12 @@
- (void)application:(UIApplication *)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
LOGI(@"%@ : %@", NSStringFromSelector(_cmd), deviceToken);
[[LinphoneManager instance] setPushNotificationToken:deviceToken];
[LinphoneManager.instance setPushNotificationToken:deviceToken];
}
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {
LOGI(@"%@ : %@", NSStringFromSelector(_cmd), [error localizedDescription]);
[[LinphoneManager instance] setPushNotificationToken:nil];
[LinphoneManager.instance setPushNotificationToken:nil];
}
#pragma mark - User notifications
@ -411,7 +407,7 @@
LOGI(@"%@", NSStringFromSelector(_cmd));
if ([[UIDevice currentDevice].systemVersion floatValue] >= 8) {
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneCore *lc = LC;
LOGI(@"%@", NSStringFromSelector(_cmd));
if ([notification.category isEqualToString:@"incoming_call"]) {
if ([identifier isEqualToString:@"answer"]) {
@ -455,7 +451,7 @@
- (void)ConfigurationStateUpdateEvent:(NSNotification *)notif {
LinphoneConfiguringState state = [[notif.userInfo objectForKey:@"state"] intValue];
if (state == LinphoneConfiguringSuccessful) {
[[NSNotificationCenter defaultCenter] removeObserver:self name:kLinphoneConfiguringStateUpdate object:nil];
[NSNotificationCenter.defaultCenter removeObserver:self name:kLinphoneConfiguringStateUpdate object:nil];
[_waitingIndicator dismissWithClickedButtonIndex:0 animated:true];
UIAlertView *error = [[UIAlertView alloc]
@ -468,7 +464,7 @@
[PhoneMainView.instance startUp];
}
if (state == LinphoneConfiguringFailed) {
[[NSNotificationCenter defaultCenter] removeObserver:self name:kLinphoneConfiguringStateUpdate object:nil];
[NSNotificationCenter.defaultCenter removeObserver:self name:kLinphoneConfiguringStateUpdate object:nil];
[_waitingIndicator dismissWithClickedButtonIndex:0 animated:true];
UIAlertView *error =
[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Failure", nil)
@ -507,13 +503,13 @@
- (void)attemptRemoteConfiguration {
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(ConfigurationStateUpdateEvent:)
name:kLinphoneConfiguringStateUpdate
object:nil];
linphone_core_set_provisioning_uri([LinphoneManager getLc], [configURL UTF8String]);
[[LinphoneManager instance] destroyLinphoneCore];
[[LinphoneManager instance] startLinphoneCore];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(ConfigurationStateUpdateEvent:)
name:kLinphoneConfiguringStateUpdate
object:nil];
linphone_core_set_provisioning_uri(LC, [configURL UTF8String]);
[LinphoneManager.instance destroyLinphoneCore];
[LinphoneManager.instance startLinphoneCore];
}
@end

View file

@ -99,7 +99,7 @@
}
- (void)transformCodecsToKeys:(const MSList *)codecs {
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneCore *lc = LC;
const MSList *elem = codecs;
for (; elem != NULL; elem = elem->next) {
@ -115,7 +115,7 @@
}
- (void)transformAccountToKeys:(NSString *)username {
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneCore *lc = LC;
const MSList *proxies = linphone_core_get_proxy_config_list(lc);
while (username && proxies &&
strcmp(username.UTF8String,
@ -151,7 +151,7 @@
const LinphoneAddress *identity_addr = linphone_proxy_config_get_identity_address(proxy);
if (identity_addr) {
const char *server_addr = linphone_proxy_config_get_server_addr(proxy);
LinphoneAddress *proxy_addr = linphone_address_new(server_addr);
LinphoneAddress *proxy_addr = linphone_core_interpret_url(LC, server_addr);
int port = linphone_address_get_port(proxy_addr);
[self setCString:linphone_address_get_username(identity_addr)
@ -218,12 +218,12 @@
}
- (void)transformLinphoneCoreToKeys {
LinphoneManager *lm = [LinphoneManager instance];
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneManager *lm = LinphoneManager.instance;
LinphoneCore *lc = LC;
// root section
{
const MSList *accounts = linphone_core_get_proxy_config_list([LinphoneManager getLc]);
const MSList *accounts = linphone_core_get_proxy_config_list(LC);
int count = ms_list_size(accounts);
for (int i = 1; i <= count; i++, accounts = accounts->next) {
NSString *key = [NSString stringWithFormat:@"menu_account_%d", i];
@ -265,7 +265,7 @@
[self setBool:(pol->automatically_accept) forKey:@"accept_video_preference"];
[self setBool:linphone_core_self_view_enabled(lc) forKey:@"self_video_preference"];
BOOL previewEnabled = [lm lpConfigBoolForKey:@"preview_preference" withDefault:YES];
[self setBool:previewEnabled forKey:@"preview_preference"];
[self setBool:IPAD && previewEnabled forKey:@"preview_preference"];
const char *preset = linphone_core_get_video_preset(lc);
[self setCString:preset ? preset : "default" forKey:@"video_preset_preference"];
@ -348,7 +348,7 @@
// tunnel section
if (linphone_core_tunnel_available()) {
LinphoneTunnel *tunnel = linphone_core_get_tunnel([LinphoneManager getLc]);
LinphoneTunnel *tunnel = linphone_core_get_tunnel(LC);
[self setObject:[lm lpConfigStringForKey:@"tunnel_mode_preference" withDefault:@"off"]
forKey:@"tunnel_mode_preference"];
const MSList *configs = linphone_tunnel_get_servers(tunnel);
@ -364,17 +364,13 @@
// advanced section
{
[self setBool:[lm lpConfigBoolForKey:@"debugenable_preference" withDefault:NO]
forKey:@"debugenable_preference"];
[self setBool:[lm lpConfigBoolForKey:@"animations_preference" withDefault:NO] forKey:@"animations_preference"];
[self setBool:[lm lpConfigBoolForKey:@"backgroundmode_preference" withDefault:NO]
forKey:@"backgroundmode_preference"];
[self setBool:[lm lpConfigBoolForKey:@"start_at_boot_preference" withDefault:NO]
forKey:@"start_at_boot_preference"];
[self setBool:[lm lpConfigBoolForKey:@"autoanswer_notif_preference" withDefault:NO]
forKey:@"autoanswer_notif_preference"];
[self setBool:[lm lpConfigBoolForKey:@"debugenable_preference"] forKey:@"debugenable_preference"];
[self setBool:ANIMATED forKey:@"animations_preference"];
[self setBool:[lm lpConfigBoolForKey:@"backgroundmode_preference"] forKey:@"backgroundmode_preference"];
[self setBool:[lm lpConfigBoolForKey:@"start_at_boot_preference"] forKey:@"start_at_boot_preference"];
[self setBool:[lm lpConfigBoolForKey:@"autoanswer_notif_preference"] forKey:@"autoanswer_notif_preference"];
[self setBool:[lm lpConfigBoolForKey:@"show_msg_in_notif" withDefault:YES] forKey:@"show_msg_in_notif"];
[self setBool:[lm lpConfigBoolForKey:@"enable_first_login_view_preference" withDefault:NO]
[self setBool:[lm lpConfigBoolForKey:@"enable_first_login_view_preference"]
forKey:@"enable_first_login_view_preference"];
LinphoneAddress *parsed = linphone_core_get_primary_contact_parsed(lc);
if (parsed != NULL) {
@ -389,7 +385,7 @@
// Post event
NSDictionary *eventDic = [NSDictionary dictionaryWithObject:self forKey:@"settings"];
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneLogsUpdate object:self userInfo:eventDic];
[NSNotificationCenter.defaultCenter postNotificationName:kLinphoneLogsUpdate object:self userInfo:eventDic];
}
- (void)alertAccountError:(NSString *)error {
@ -403,8 +399,8 @@
- (void)synchronizeAccounts {
LOGI(@"Account changed, synchronizing.");
LinphoneManager *lm = [LinphoneManager instance];
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneManager *lm = LinphoneManager.instance;
LinphoneCore *lc = LC;
LinphoneProxyConfig *proxyCfg = NULL;
NSString *error = nil;
@ -457,7 +453,7 @@
const char *route = NULL;
if (isWifiOnly && [LinphoneManager instance].connectivity == wwan)
if (isWifiOnly && LinphoneManager.instance.connectivity == wwan)
expire = 0;
if ((!proxyAddress || [proxyAddress length] < 1) && domain) {
@ -469,7 +465,7 @@
}
char *proxy = ms_strdup(proxyAddress.UTF8String);
LinphoneAddress *proxy_addr = linphone_address_new(proxy);
LinphoneAddress *proxy_addr = linphone_core_interpret_url(LC, proxy);
if (proxy_addr) {
LinphoneTransportType type = LinphoneTransportUdp;
@ -484,7 +480,7 @@
}
char normalizedUserName[256];
LinphoneAddress *linphoneAddress = linphone_address_new("sip:user@domain.com");
LinphoneAddress *linphoneAddress = linphone_core_interpret_url(LC, "sip:user@domain.com");
proxyCfg = ms_list_nth_data(linphone_core_get_proxy_config_list(lc),
[self integerForKey:@"current_proxy_config_preference"]);
@ -527,7 +523,7 @@
}
[lm lpConfigSetInt:pushnotification forKey:@"pushnotification_preference"];
[[LinphoneManager instance] configurePushTokenForProxyConfig:proxyCfg];
[LinphoneManager.instance configurePushTokenForProxyConfig:proxyCfg];
linphone_proxy_config_enable_register(proxyCfg, is_enabled);
linphone_proxy_config_enable_avpf(proxyCfg, use_avpf);
@ -548,7 +544,7 @@
if (proxyAi) {
linphone_core_remove_auth_info(lc, proxyAi);
}
LinphoneAddress *from = linphone_address_new(identity);
LinphoneAddress *from = linphone_core_interpret_url(LC, identity);
if (from) {
const char *userid_str = (userID != nil) ? [userID UTF8String] : NULL;
LinphoneAuthInfo *info = linphone_auth_info_new(
@ -577,11 +573,11 @@
}
}
// reload address book to prepend proxy config domain to contacts' phone number
[[[LinphoneManager instance] fastAddressBook] reload];
[[LinphoneManager.instance fastAddressBook] reload];
}
- (void)synchronizeCodecs:(const MSList *)codecs {
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneCore *lc = LC;
PayloadType *pt;
const MSList *elem;
@ -593,8 +589,8 @@
}
- (BOOL)synchronize {
LinphoneManager *lm = [LinphoneManager instance];
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneManager *lm = LinphoneManager.instance;
LinphoneCore *lc = LC;
// root section
{
BOOL account_changed = NO;
@ -640,7 +636,7 @@
BOOL equalizer = [self boolForKey:@"eq_active"];
[lm lpConfigSetBool:equalizer forKey:@"eq_active" inSection:@"sound"];
[[LinphoneManager instance] configureVbrCodecs];
[LinphoneManager.instance configureVbrCodecs];
NSString *au_device = @"AU: Audio Unit Receiver";
if (!voice_processing) {
@ -659,7 +655,7 @@
policy.automatically_accept = [self boolForKey:@"accept_video_preference"];
linphone_core_set_video_policy(lc, &policy);
linphone_core_enable_self_view(lc, [self boolForKey:@"self_video_preference"]);
BOOL preview_preference = [self boolForKey:@"preview_preference"];
BOOL preview_preference = IPAD && [self boolForKey:@"preview_preference"];
[lm lpConfigSetInt:preview_preference forKey:@"preview_preference"];
NSString *videoPreset = [self stringForKey:@"video_preset_preference"];
@ -713,7 +709,7 @@
BOOL wifiOnly = [self boolForKey:@"wifi_only_preference"];
[lm lpConfigSetInt:wifiOnly forKey:@"wifi_only_preference"];
if ([self valueChangedForKey:@"wifi_only_preference"]) {
[[LinphoneManager instance] setupNetworkReachabilityCallback];
[LinphoneManager.instance setupNetworkReachabilityCallback];
}
NSString *stun_server = [self stringForKey:@"stun_preference"];
@ -762,7 +758,7 @@
NSString *lTunnelPrefMode = [self stringForKey:@"tunnel_mode_preference"];
NSString *lTunnelPrefAddress = [self stringForKey:@"tunnel_address_preference"];
int lTunnelPrefPort = [self integerForKey:@"tunnel_port_preference"];
LinphoneTunnel *tunnel = linphone_core_get_tunnel([LinphoneManager getLc]);
LinphoneTunnel *tunnel = linphone_core_get_tunnel(LC);
TunnelMode mode = tunnel_off;
int lTunnelPort = 443;
if (lTunnelPrefPort) {
@ -790,16 +786,12 @@
}
[lm lpConfigSetString:lTunnelPrefMode forKey:@"tunnel_mode_preference"];
[[LinphoneManager instance] setTunnelMode:mode];
[LinphoneManager.instance setTunnelMode:mode];
}
}
// advanced section
{
BOOL debugmode = [self boolForKey:@"debugenable_preference"];
[lm lpConfigSetInt:debugmode forKey:@"debugenable_preference"];
[[LinphoneManager instance] setLogsEnabled:debugmode];
BOOL animations = [self boolForKey:@"animations_preference"];
[lm lpConfigSetInt:animations forKey:@"animations_preference"];
@ -839,13 +831,13 @@
// Post event
NSDictionary *eventDic = [NSDictionary dictionaryWithObject:self forKey:@"settings"];
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneSettingsUpdate object:self userInfo:eventDic];
[NSNotificationCenter.defaultCenter postNotificationName:kLinphoneSettingsUpdate object:self userInfo:eventDic];
return YES;
}
- (void)removeAccount {
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneCore *lc = LC;
LinphoneProxyConfig *config = ms_list_nth_data(linphone_core_get_proxy_config_list(lc),
[self integerForKey:@"current_proxy_config_preference"]);

View file

@ -154,7 +154,6 @@ typedef struct _LinphoneManagerSounds {
- (bool)allowSpeaker;
- (void)configureVbrCodecs;
- (void)setLogsEnabled:(BOOL)enabled;
+ (BOOL)copyFile:(NSString*)src destination:(NSString*)dst override:(BOOL)override;
+ (NSString*)bundleFile:(NSString*)file;
@ -162,8 +161,7 @@ typedef struct _LinphoneManagerSounds {
+ (NSString*)cacheDirectory;
- (void)acceptCall:(LinphoneCall *)call evenWithVideo:(BOOL)video;
- (void)call:(NSString *)address displayName:(NSString*)displayName transfer:(BOOL)transfer;
- (BOOL)call:(const LinphoneAddress *)address transfer:(BOOL)transfer;
+(id)getMessageAppDataForKey:(NSString*)key inMessage:(LinphoneChatMessage*)msg;
+(void)setValueInMessageAppData:(id)value forKey:(NSString*)key inMessage:(LinphoneChatMessage*)msg;

View file

@ -72,13 +72,13 @@ NSString *const kLinphoneFileTransferRecvUpdate = @"LinphoneFileTransferRecvUpda
const int kLinphoneAudioVbrCodecDefaultBitrate = 36; /*you can override this from linphonerc or linphonerc-factory*/
extern void libmsilbc_init(void);
extern void libmsamr_init(void);
extern void libmsx264_init(void);
extern void libmsopenh264_init(void);
extern void libmssilk_init(void);
extern void libmsbcg729_init(void);
extern void libmswebrtc_init(void);
extern void libmsilbc_init(MSFactory *factory);
extern void libmsamr_init(MSFactory *factory);
extern void libmsx264_init(MSFactory *factory);
extern void libmsopenh264_init(MSFactory *factory);
extern void libmssilk_init(MSFactory *factory);
extern void libmsbcg729_init(MSFactory *factory);
extern void libmswebrtc_init(MSFactory *factory);
#define FRONT_CAM_NAME \
"AV Capture: com.apple.avfoundation.avcapturedevice.built-in_video:1" /*"AV Capture: Front Camera"*/
@ -251,10 +251,10 @@ struct codec_name_pref_table codec_pref_table[] = {{"speex", 8000, "speex_8k_pre
- (id)init {
if ((self = [super init])) {
AudioSessionInitialize(NULL, NULL, NULL, NULL);
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(audioRouteChangeListenerCallback2:)
name:AVAudioSessionRouteChangeNotification
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(audioRouteChangeListenerCallback2:)
name:AVAudioSessionRouteChangeNotification
object:nil];
NSString *path = [[NSBundle mainBundle] pathForResource:@"msg" ofType:@"wav"];
self.messagePlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL URLWithString:path] error:nil];
@ -292,7 +292,7 @@ struct codec_name_pref_table codec_pref_table[] = {{"speex", 8000, "speex_8k_pre
}
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[NSNotificationCenter.defaultCenter removeObserver:self];
}
- (void)silentPushFailed:(NSTimer *)timer {
@ -440,7 +440,6 @@ exit_dbmigration:
return;
if ([self lpConfigIntForKey:migration_flag withDefault:0]) {
LOGI(@"UserPrefs migration already performed, skip");
return;
}
@ -519,9 +518,8 @@ exit_dbmigration:
/* File transfer migration */
if ([self lpConfigBoolForKey:@"file_transfer_migration_done"] == FALSE) {
const char *newURL = "https://www.linphone.org:444/lft.php";
LOGI(@"Migrating sharing server url from %s to %s",
linphone_core_get_file_transfer_server([LinphoneManager getLc]), newURL);
linphone_core_set_file_transfer_server([LinphoneManager getLc], newURL);
LOGI(@"Migrating sharing server url from %s to %s", linphone_core_get_file_transfer_server(LC), newURL);
linphone_core_set_file_transfer_server(LC, newURL);
[self lpConfigSetBool:TRUE forKey:@"file_transfer_migration_done"];
}
}
@ -568,7 +566,7 @@ static void dump_section(const char *section, void *data) {
+ (void)dumpLcConfig {
if (theLinphoneCore) {
LpConfig *conf = [LinphoneManager instance].configDb;
LpConfig *conf = LinphoneManager.instance.configDb;
lp_config_for_each_section(conf, dump_section, conf);
}
}
@ -585,11 +583,11 @@ static void linphone_iphone_log_user_warning(struct _LinphoneCore *lc, const cha
- (void)displayStatus:(NSString *)message {
// Post event
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneDisplayStatusUpdate
object:self
userInfo:@{
@"message" : message
}];
[NSNotificationCenter.defaultCenter postNotificationName:kLinphoneDisplayStatusUpdate
object:self
userInfo:@{
@"message" : message
}];
}
static void linphone_iphone_display_status(struct _LinphoneCore *lc, const char *message) {
@ -650,7 +648,7 @@ static void linphone_iphone_display_status(struct _LinphoneCore *lc, const char
LinphoneCallLog *callLog = linphone_call_get_call_log(call);
NSString *callId = [NSString stringWithUTF8String:linphone_call_log_get_call_id(callLog)];
if (![[LinphoneManager instance] popPushCallID:callId]) {
if (![LinphoneManager.instance popPushCallID:callId]) {
// case where a remote notification is not already received
// Create a new local notification
data->notification = [[UILocalNotification alloc] init];
@ -773,8 +771,7 @@ static void linphone_iphone_display_status(struct _LinphoneCore *lc, const char
@"state" : [NSNumber numberWithInt:state],
@"message" : [NSString stringWithUTF8String:message]
};
LOGI(@"Call %p changed to state %s: %s", call, linphone_call_state_to_string(state), message);
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneCallUpdate object:self userInfo:dict];
[NSNotificationCenter.defaultCenter postNotificationName:kLinphoneCallUpdate object:self userInfo:dict];
}
static void linphone_iphone_call_state(LinphoneCore *lc, LinphoneCall *call, LinphoneCallState state,
@ -802,7 +799,7 @@ static void linphone_iphone_global_state_changed(LinphoneCore *lc, LinphoneGloba
// dispatch the notification asynchronously
dispatch_async(dispatch_get_main_queue(), ^(void) {
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneGlobalStateUpdate object:self userInfo:dict];
[NSNotificationCenter.defaultCenter postNotificationName:kLinphoneGlobalStateUpdate object:self userInfo:dict];
});
}
@ -829,9 +826,9 @@ static void linphone_iphone_configuring_status_changed(LinphoneCore *lc, Linphon
// dispatch the notification asynchronously
dispatch_async(dispatch_get_main_queue(), ^(void) {
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneConfiguringStateUpdate
object:self
userInfo:dict];
[NSNotificationCenter.defaultCenter postNotificationName:kLinphoneConfiguringStateUpdate
object:self
userInfo:dict];
});
}
@ -856,7 +853,7 @@ static void linphone_iphone_configuring_status_changed(LinphoneCore *lc, Linphon
NSDictionary *dict = [NSDictionary
dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:state], @"state", [NSValue valueWithPointer:cfg], @"cfg",
[NSString stringWithUTF8String:message], @"message", nil];
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneRegistrationUpdate object:self userInfo:dict];
[NSNotificationCenter.defaultCenter postNotificationName:kLinphoneRegistrationUpdate object:self userInfo:dict];
}
static void linphone_iphone_registration_state(LinphoneCore *lc, LinphoneProxyConfig *cfg,
@ -906,13 +903,12 @@ static void linphone_iphone_popup_password_request(LinphoneCore *lc, const char
LinphoneAuthInfo *info =
linphone_auth_info_new(username.UTF8String, NULL, password.UTF8String, NULL,
realm.UTF8String, domain.UTF8String);
linphone_core_add_auth_info([LinphoneManager getLc], info);
linphone_core_add_auth_info(LC, info);
[LinphoneManager.instance refreshRegisters];
}];
[alertView addButtonWithTitle:NSLocalizedString(@"Go to settings", nil)
block:^{
SettingsView *view = VIEW(SettingsView);
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
[PhoneMainView.instance changeCurrentView:SettingsView.compositeViewDescription];
}];
[alertView show];
}
@ -933,9 +929,6 @@ static void linphone_iphone_popup_password_request(LinphoneCore *lc, const char
NSString *from = [FastAddressBook displayNameForAddress:remoteAddress];
char *c_address = linphone_address_as_string_uri_only(remoteAddress);
NSString *remote_uri = [NSString stringWithUTF8String:c_address];
const char *chat = linphone_chat_message_get_text(msg);
if (chat == NULL)
chat = "";
ms_free(c_address);
@ -943,12 +936,13 @@ static void linphone_iphone_popup_password_request(LinphoneCore *lc, const char
// Create a new notification
UILocalNotification *notif = [[UILocalNotification alloc] init];
if (notif) {
NSString *chat = [UIChatBubbleTextCell TextMessageForChat:msg];
notif.repeatInterval = 0;
if ([[UIDevice currentDevice].systemVersion floatValue] >= 8) {
notif.category = @"incoming_msg";
}
if ([[LinphoneManager instance] lpConfigBoolForKey:@"show_msg_in_notif" withDefault:YES]) {
notif.alertBody = [NSString stringWithFormat:NSLocalizedString(@"IM_FULLMSG", nil), from, @(chat)];
if ([LinphoneManager.instance lpConfigBoolForKey:@"show_msg_in_notif" withDefault:YES]) {
notif.alertBody = [NSString stringWithFormat:NSLocalizedString(@"IM_FULLMSG", nil), from, chat];
} else {
notif.alertBody = [NSString stringWithFormat:NSLocalizedString(@"IM_MSG", nil), from];
}
@ -968,7 +962,7 @@ static void linphone_iphone_popup_password_request(LinphoneCore *lc, const char
@"call-id" : callID
};
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneMessageReceived object:self userInfo:dict];
[NSNotificationCenter.defaultCenter postNotificationName:kLinphoneMessageReceived object:self userInfo:dict];
}
static void linphone_iphone_message_received(LinphoneCore *lc, LinphoneChatRoom *room, LinphoneChatMessage *message) {
@ -986,7 +980,7 @@ static void linphone_iphone_message_received(LinphoneCore *lc, LinphoneChatRoom
if (body != NULL) {
[dict setObject:[NSValue valueWithPointer:body] forKey:@"content"];
}
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneNotifyReceived object:self userInfo:dict];
[NSNotificationCenter.defaultCenter postNotificationName:kLinphoneNotifyReceived object:self userInfo:dict];
}
static void linphone_iphone_notify_received(LinphoneCore *lc, LinphoneEvent *lev, const char *notified_event,
@ -1014,19 +1008,17 @@ static void linphone_iphone_call_encryption_changed(LinphoneCore *lc, LinphoneCa
[dict setObject:[NSValue valueWithPointer:call] forKey:@"call"];
[dict setObject:[NSNumber numberWithBool:on] forKey:@"on"];
[dict setObject:[NSString stringWithUTF8String:authentication_token] forKey:@"token"];
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneCallEncryptionChanged
object:self
userInfo:dict];
[NSNotificationCenter.defaultCenter postNotificationName:kLinphoneCallEncryptionChanged object:self userInfo:dict];
}
#pragma mark - Message composition start
- (void)onMessageComposeReceived:(LinphoneCore *)core forRoom:(LinphoneChatRoom *)room {
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneTextComposeEvent
object:self
userInfo:@{
@"room" : [NSValue valueWithPointer:room]
}];
[NSNotificationCenter.defaultCenter postNotificationName:kLinphoneTextComposeEvent
object:self
userInfo:@{
@"room" : [NSValue valueWithPointer:room]
}];
}
static void linphone_iphone_is_composing_received(LinphoneCore *lc, LinphoneChatRoom *room) {
@ -1135,7 +1127,7 @@ static void showNetworkFlags(SCNetworkReachabilityFlags flags) {
static void networkReachabilityNotification(CFNotificationCenterRef center, void *observer, CFStringRef name,
const void *object, CFDictionaryRef userInfo) {
LinphoneManager *mgr = [LinphoneManager instance];
LinphoneManager *mgr = LinphoneManager.instance;
SCNetworkReachabilityFlags flags;
// for an unknown reason, we are receiving multiple time the notification, so
@ -1153,7 +1145,7 @@ static void networkReachabilityNotification(CFNotificationCenterRef center, void
void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void *nilCtx) {
showNetworkFlags(flags);
LinphoneManager *lm = [LinphoneManager instance];
LinphoneManager *lm = LinphoneManager.instance;
SCNetworkReachabilityFlags networkDownFlags = kSCNetworkReachabilityFlagsConnectionRequired |
kSCNetworkReachabilityFlagsConnectionOnTraffic |
kSCNetworkReachabilityFlagsConnectionOnDemand;
@ -1167,7 +1159,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
lm.connectivity = none;
[LinphoneManager kickOffNetworkConnection];
} else {
LinphoneTunnel *tunnel = linphone_core_get_tunnel([LinphoneManager getLc]);
LinphoneTunnel *tunnel = linphone_core_get_tunnel(LC);
Connectivity newConnectivity;
BOOL isWifiOnly = [lm lpConfigBoolForKey:@"wifi_only_preference" withDefault:FALSE];
if (!ctx || ctx->testWWan)
@ -1390,9 +1382,9 @@ static LinphoneCoreVTable linphonec_vtable = {
// Post event
NSDictionary *dict = [NSDictionary dictionaryWithObject:[NSValue valueWithPointer:theLinphoneCore] forKey:@"core"];
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneCoreUpdate
object:[LinphoneManager instance]
userInfo:dict];
[NSNotificationCenter.defaultCenter postNotificationName:kLinphoneCoreUpdate
object:LinphoneManager.instance
userInfo:dict];
}
static BOOL libStarted = FALSE;
@ -1448,18 +1440,18 @@ static BOOL libStarted = FALSE;
return;
}
linphone_core_set_log_collection_path([[LinphoneManager cacheDirectory] UTF8String]);
[self setLogsEnabled:[self lpConfigBoolForKey:@"debugenable_preference"]];
[Log enableLogs:[self lpConfigBoolForKey:@"debugenable_preference"]];
connectivity = none;
ms_init(); // Need to initialize mediastreamer2 before loading the plugins
// Load plugins if available in the linphone SDK - otherwise these calls will do nothing
libmsilbc_init();
libmssilk_init();
libmsamr_init();
libmsx264_init();
libmsopenh264_init();
libmsbcg729_init();
libmswebrtc_init();
libmsilbc_init(ms_factory_get_fallback());
libmssilk_init(ms_factory_get_fallback());
libmsamr_init(ms_factory_get_fallback());
libmsx264_init(ms_factory_get_fallback());
libmsopenh264_init(ms_factory_get_fallback());
libmsbcg729_init(ms_factory_get_fallback());
libmswebrtc_init(ms_factory_get_fallback());
theLinphoneCore = linphone_core_new_with_config(&linphonec_vtable, configDb, (__bridge void *)(self));
LOGI(@"Create linphonecore %p", theLinphoneCore);
@ -1495,19 +1487,19 @@ static BOOL libStarted = FALSE;
(or skipped).
Wait for this to finish the code configuration */
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(audioSessionInterrupted:)
name:AVAudioSessionInterruptionNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(globalStateChangedNotificationHandler:)
name:kLinphoneGlobalStateUpdate
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(configuringStateChangedNotificationHandler:)
name:kLinphoneConfiguringStateUpdate
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(inappReady:) name:kIAPReady object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(audioSessionInterrupted:)
name:AVAudioSessionInterruptionNotification
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(globalStateChangedNotificationHandler:)
name:kLinphoneGlobalStateUpdate
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(configuringStateChangedNotificationHandler:)
name:kLinphoneConfiguringStateUpdate
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(inappReady:) name:kIAPReady object:nil];
/*call iterate once immediately in order to initiate background connections with sip server or remote provisioning
* grab, if any */
@ -1522,7 +1514,7 @@ static BOOL libStarted = FALSE;
// just in case
[self removeCTCallCenterCb];
[[NSNotificationCenter defaultCenter] removeObserver:self];
[NSNotificationCenter.defaultCenter removeObserver:self];
if (theLinphoneCore != nil) { // just in case application terminate before linphone core initialization
@ -1539,9 +1531,9 @@ static BOOL libStarted = FALSE;
// Post event
NSDictionary *dict =
[NSDictionary dictionaryWithObject:[NSValue valueWithPointer:theLinphoneCore] forKey:@"core"];
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneCoreUpdate
object:[LinphoneManager instance]
userInfo:dict];
[NSNotificationCenter.defaultCenter postNotificationName:kLinphoneCoreUpdate
object:LinphoneManager.instance
userInfo:dict];
SCNetworkReachabilityUnscheduleFromRunLoop(proxyReachability, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
if (proxyReachability)
@ -1625,7 +1617,7 @@ static int comp_call_id(const LinphoneCall *call, const char *callid) {
if (!success) {
LOGE(@"Could not play the message sound");
}
AudioServicesPlaySystemSound([LinphoneManager instance].sounds.vibrate);
AudioServicesPlaySystemSound(LinphoneManager.instance.sounds.vibrate);
}
static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
@ -1646,14 +1638,14 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
// handle proxy config if any
if (proxyCfg) {
if ([[LinphoneManager instance] lpConfigBoolForKey:@"backgroundmode_preference"] ||
[[LinphoneManager instance] lpConfigBoolForKey:@"pushnotification_preference"]) {
if ([LinphoneManager.instance lpConfigBoolForKey:@"backgroundmode_preference"] ||
[LinphoneManager.instance lpConfigBoolForKey:@"pushnotification_preference"]) {
// For registration register
[self refreshRegisters];
}
if ([[LinphoneManager instance] lpConfigBoolForKey:@"backgroundmode_preference"]) {
if ([LinphoneManager.instance lpConfigBoolForKey:@"backgroundmode_preference"]) {
// register keepalive
if ([[UIApplication sharedApplication]
@ -1699,7 +1691,7 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
LOGI(@"Entering [%s] bg mode", shouldEnterBgMode ? "normal" : "lite");
if (!shouldEnterBgMode) {
if ([[LinphoneManager instance] lpConfigBoolForKey:@"pushnotification_preference"]) {
if ([LinphoneManager.instance lpConfigBoolForKey:@"pushnotification_preference"]) {
LOGI(@"Keeping lc core to handle push");
/*destroy voip socket if any and reset connectivity mode*/
connectivity = none;
@ -1727,8 +1719,7 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
linphone_core_start_dtmf_stream(theLinphoneCore);
/*start the video preview in case we are in the main view*/
if (IPAD && linphone_core_video_display_enabled(theLinphoneCore) &&
[self lpConfigBoolForKey:@"preview_preference"]) {
if (linphone_core_video_display_enabled(theLinphoneCore) && [self lpConfigBoolForKey:@"preview_preference"]) {
linphone_core_enable_video_preview(theLinphoneCore, TRUE);
}
/*check last keepalive handler date*/
@ -1844,9 +1835,9 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
}
NSDictionary *dict =
[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:bluetoothAvailable], @"available", nil];
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneBluetoothAvailabilityUpdate
object:self
userInfo:dict];
[NSNotificationCenter.defaultCenter postNotificationName:kLinphoneBluetoothAvailabilityUpdate
object:self
userInfo:dict];
CFRelease(newRoute);
}
}
@ -1916,7 +1907,7 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
linphone_core_accept_call_with_params(theLinphoneCore, call, lcallParams);
}
- (void)call:(NSString *)address displayName:(NSString *)displayName transfer:(BOOL)transfer {
- (BOOL)call:(const LinphoneAddress *)iaddr transfer:(BOOL)transfer {
// First verify that network is available, abort otherwise.
if (!linphone_core_is_network_reachable(theLinphoneCore)) {
UIAlertView *error = [[UIAlertView alloc]
@ -1929,7 +1920,7 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
cancelButtonTitle:NSLocalizedString(@"Cancel", nil)
otherButtonTitles:nil];
[error show];
return;
return FALSE;
}
// Then check that no GSM calls are in progress, abort otherwise.
@ -1943,14 +1934,11 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
cancelButtonTitle:NSLocalizedString(@"Cancel", nil)
otherButtonTitles:nil];
[error show];
return;
return FALSE;
}
LinphoneAddress *addr = NULL;
// Continue by checking that the provided address is a valid SIP address, abort otherwise.
if ([address length] == 0) {
// no address provided... nothing to do
} else if ((addr = linphone_core_interpret_url([LinphoneManager getLc], address.UTF8String)) == NULL) {
// Then check that the supplied address is valid
if (!iaddr) {
UIAlertView *error = [[UIAlertView alloc]
initWithTitle:NSLocalizedString(@"Invalid SIP address", nil)
message:NSLocalizedString(@"Either configure a SIP proxy server from settings prior to place a "
@ -1960,44 +1948,48 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
cancelButtonTitle:NSLocalizedString(@"Cancel", nil)
otherButtonTitles:nil];
[error show];
return FALSE;
}
LinphoneAddress *addr = linphone_address_clone(iaddr);
NSString *displayName = [FastAddressBook displayNameForAddress:addr];
// Finally we can make the call
LinphoneCallParams *lcallParams = linphone_core_create_call_params(theLinphoneCore, NULL);
if ([self lpConfigBoolForKey:@"edge_opt_preference"] && (self.network == network_2g)) {
LOGI(@"Enabling low bandwidth mode");
linphone_call_params_enable_low_bandwidth(lcallParams, YES);
}
if (displayName != nil) {
linphone_address_set_display_name(addr, displayName.UTF8String);
}
if ([LinphoneManager.instance lpConfigBoolForKey:@"override_domain_with_default_one"]) {
linphone_address_set_domain(
addr, [[LinphoneManager.instance lpConfigStringForKey:@"domain" inSection:@"assistant"] UTF8String]);
}
if (transfer) {
char *caddr = linphone_address_as_string(addr);
linphone_core_transfer_call(theLinphoneCore, linphone_core_get_current_call(theLinphoneCore), caddr);
ms_free(caddr);
} else {
// Finally we can make the call
LinphoneCallParams *lcallParams = linphone_core_create_call_params(theLinphoneCore, NULL);
if ([self lpConfigBoolForKey:@"edge_opt_preference"] && (self.network == network_2g)) {
LOGI(@"Enabling low bandwidth mode");
linphone_call_params_enable_low_bandwidth(lcallParams, YES);
}
if (displayName != nil) {
linphone_address_set_display_name(addr, displayName.UTF8String);
}
if ([[LinphoneManager instance] lpConfigBoolForKey:@"override_domain_with_default_one"]) {
linphone_address_set_domain(
addr, [[[LinphoneManager instance] lpConfigStringForKey:@"domain" inSection:@"assistant"] UTF8String]);
}
if (transfer) {
char *caddr = linphone_address_as_string(addr);
linphone_core_transfer_call(theLinphoneCore, linphone_core_get_current_call(theLinphoneCore), caddr);
ms_free(caddr);
} else {
LinphoneCall *call = linphone_core_invite_address_with_params(theLinphoneCore, addr, lcallParams);
if (call) {
// The LinphoneCallAppData object should be set on call creation with callback
// - (void)onCall:StateChanged:withMessage:. If not, we are in big trouble and expect it to crash
// We are NOT responsible for creating the AppData.
LinphoneCallAppData *data = (__bridge LinphoneCallAppData *)linphone_call_get_user_data(call);
if (data == nil) {
LOGE(@"New call instanciated but app data was not set. Expect it to crash.");
/* will be used later to notify user if video was not activated because of the linphone core*/
} else {
data->videoRequested = linphone_call_params_video_enabled(lcallParams);
}
LinphoneCall *call = linphone_core_invite_address_with_params(theLinphoneCore, addr, lcallParams);
if (call) {
// The LinphoneCallAppData object should be set on call creation with callback
// - (void)onCall:StateChanged:withMessage:. If not, we are in big trouble and expect it to crash
// We are NOT responsible for creating the AppData.
LinphoneCallAppData *data = (__bridge LinphoneCallAppData *)linphone_call_get_user_data(call);
if (data == nil) {
LOGE(@"New call instanciated but app data was not set. Expect it to crash.");
/* will be used later to notify user if video was not activated because of the linphone core*/
} else {
data->videoRequested = linphone_call_params_video_enabled(lcallParams);
}
}
linphone_address_destroy(addr);
linphone_call_params_destroy(lcallParams);
}
linphone_address_destroy(addr);
linphone_call_params_destroy(lcallParams);
return TRUE;
}
#pragma mark - Property Functions
@ -2084,7 +2076,7 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
+ (int)unreadMessageCount {
int count = 0;
const MSList *rooms = linphone_core_get_chat_rooms([LinphoneManager getLc]);
const MSList *rooms = linphone_core_get_chat_rooms(LC);
const MSList *item = rooms;
while (item) {
LinphoneChatRoom *room = (LinphoneChatRoom *)item->data;
@ -2140,25 +2132,6 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
}
}
- (void)setLogsEnabled:(BOOL)enabled {
if ([LinphoneManager isRunningTests]) {
NSLog(@"Running tests, forcing logs to MESSAGE level");
linphone_core_enable_logs_with_cb((OrtpLogFunc)linphone_iphone_log_handler);
linphone_core_set_log_level(ORTP_MESSAGE);
} else {
if (enabled) {
NSLog(@"Enabling debug logs");
linphone_core_enable_logs_with_cb((OrtpLogFunc)linphone_iphone_log_handler);
linphone_core_set_log_level(ORTP_DEBUG);
linphone_core_enable_log_collection(enabled);
} else {
NSLog(@"Disabling debug logs");
linphone_core_enable_log_collection(enabled);
linphone_core_disable_logs();
}
}
}
+ (id)getMessageAppDataForKey:(NSString *)key inMessage:(LinphoneChatMessage *)msg {
if (msg == nil)
@ -2353,15 +2326,15 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
#pragma mark -
- (void)removeAllAccounts {
linphone_core_clear_proxy_config([LinphoneManager getLc]);
linphone_core_clear_all_auth_info([LinphoneManager getLc]);
linphone_core_clear_proxy_config(LC);
linphone_core_clear_all_auth_info(LC);
}
+ (BOOL)isMyself:(const LinphoneAddress *)addr {
if (!addr)
return NO;
const MSList *it = linphone_core_get_proxy_config_list([LinphoneManager getLc]);
const MSList *it = linphone_core_get_proxy_config_list(LC);
while (it) {
if (linphone_address_weak_equal(addr, linphone_proxy_config_get_identity_address(it->data))) {
return YES;

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9060" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies>
<deployment identifier="iOS"/>
<development version="6000" identifier="xcode"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="UICompositeView">
@ -26,17 +26,12 @@
<view autoresizesSubviews="NO" tag="5" contentMode="scaleToFill" id="UhA-h1-Cu8" userLabel="detailsView">
<rect key="frame" x="187" y="42" width="187" height="559"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<gestureRecognizers/>
<connections>
<outletCollection property="gestureRecognizers" destination="40" appends="YES" id="tJn-gF-d0A"/>
</connections>
</view>
<view autoresizesSubviews="NO" tag="1" contentMode="scaleToFill" id="15" userLabel="mainView">
<rect key="frame" x="0.0" y="42" width="188" height="559"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<gestureRecognizers/>
<connections>
@ -46,22 +41,18 @@
<view autoresizesSubviews="NO" tag="2" contentMode="scaleToFill" id="14" userLabel="statusBar">
<rect key="frame" x="0.0" y="0.0" width="375" height="42"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
<view autoresizesSubviews="NO" tag="3" contentMode="scaleToFill" id="16" userLabel="tabBar">
<rect key="frame" x="0.0" y="601" width="375" height="66"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
<view clearsContextBeforeDrawing="NO" tag="4" contentMode="scaleToFill" id="26" userLabel="sideMenuView">
<rect key="frame" x="-375" y="42" width="375" height="625"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" heightSizable="YES"/>
<animations/>
</view>
</subviews>
<animations/>
<nil key="simulatedStatusBarMetrics"/>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina47"/>
<point key="canvasLocation" x="-96.5" y="-25.5"/>
@ -73,34 +64,28 @@
<view autoresizesSubviews="NO" tag="5" contentMode="scaleToFill" id="Vgs-Nv-m9Q" userLabel="detailsView">
<rect key="frame" x="379" y="42" width="288" height="333"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES" flexibleMaxY="YES"/>
<animations/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
<view autoresizesSubviews="NO" tag="1" contentMode="scaleToFill" id="23" userLabel="mainView">
<rect key="frame" x="90" y="42" width="289" height="333"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES" flexibleMaxY="YES"/>
<animations/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
<view autoresizesSubviews="NO" tag="2" contentMode="scaleToFill" id="22" userLabel="statusBar">
<rect key="frame" x="0.0" y="0.0" width="667" height="42"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<animations/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
<view autoresizesSubviews="NO" tag="3" contentMode="scaleToFill" id="21" userLabel="tabBar">
<rect key="frame" x="0.0" y="42" width="90" height="333"/>
<autoresizingMask key="autoresizingMask" heightSizable="YES" flexibleMaxY="YES"/>
<animations/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
<view clearsContextBeforeDrawing="NO" tag="4" contentMode="scaleToFill" id="JXU-o0-1po" userLabel="sideMenuView">
<rect key="frame" x="0.0" y="42" width="667" height="333"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" flexibleMaxY="YES"/>
<animations/>
</view>
</subviews>
<animations/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<nil key="simulatedStatusBarMetrics"/>
<simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9531" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies>
<deployment identifier="iOS"/>
<development version="6000" identifier="xcode"/>
@ -28,9 +28,6 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<gestureRecognizers/>
<connections>
<outletCollection property="gestureRecognizers" destination="40" appends="YES" id="tJn-gF-d0A"/>
</connections>
</view>
<view autoresizesSubviews="NO" tag="1" contentMode="scaleToFill" id="15" userLabel="mainView">
<rect key="frame" x="0.0" y="60" width="400" height="1130"/>

View file

@ -31,7 +31,7 @@
#pragma mark - Lifecycle Functions
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[NSNotificationCenter.defaultCenter removeObserver:self];
[callQualityTimer invalidate];
}
@ -41,37 +41,36 @@
[super viewWillAppear:animated];
// Set observer
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(registrationUpdate:)
name:kLinphoneRegistrationUpdate
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(registrationUpdate:)
name:kLinphoneRegistrationUpdate
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(globalStateUpdate:)
name:kLinphoneGlobalStateUpdate
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(globalStateUpdate:)
name:kLinphoneGlobalStateUpdate
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(notifyReceived:)
name:kLinphoneNotifyReceived
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(notifyReceived:)
name:kLinphoneNotifyReceived
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(callUpdate:)
name:kLinphoneCallUpdate
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(onCallEncryptionChanged:)
name:kLinphoneCallEncryptionChanged
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(callUpdate:)
name:kLinphoneCallUpdate
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(onCallEncryptionChanged:)
name:kLinphoneCallEncryptionChanged
object:nil];
// Update to default state
LinphoneProxyConfig *config = linphone_core_get_default_proxy_config([LinphoneManager getLc]);
messagesUnreadCount =
lp_config_get_int(linphone_core_get_config([LinphoneManager getLc]), "app", "voice_mail_messages_count", 0);
LinphoneProxyConfig *config = linphone_core_get_default_proxy_config(LC);
messagesUnreadCount = lp_config_get_int(linphone_core_get_config(LC), "app", "voice_mail_messages_count", 0);
[self proxyConfigUpdate:config];
[self updateUI:linphone_core_get_calls_nb([LinphoneManager getLc])];
[self updateUI:linphone_core_get_calls_nb(LC)];
[self updateVoicemail];
}
@ -79,10 +78,10 @@
[super viewWillDisappear:animated];
// Remove observer
[[NSNotificationCenter defaultCenter] removeObserver:self name:kLinphoneRegistrationUpdate object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:kLinphoneGlobalStateUpdate object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:kLinphoneNotifyReceived object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:kLinphoneCallUpdate object:nil];
[NSNotificationCenter.defaultCenter removeObserver:self name:kLinphoneRegistrationUpdate object:nil];
[NSNotificationCenter.defaultCenter removeObserver:self name:kLinphoneGlobalStateUpdate object:nil];
[NSNotificationCenter.defaultCenter removeObserver:self name:kLinphoneNotifyReceived object:nil];
[NSNotificationCenter.defaultCenter removeObserver:self name:kLinphoneCallUpdate object:nil];
if (callQualityTimer != nil) {
[callQualityTimer invalidate];
@ -102,7 +101,7 @@
#pragma mark - Event Functions
- (void)registrationUpdate:(NSNotification *)notif {
LinphoneProxyConfig *config = linphone_core_get_default_proxy_config([LinphoneManager getLc]);
LinphoneProxyConfig *config = linphone_core_get_default_proxy_config(LC);
[self proxyConfigUpdate:config];
}
@ -111,7 +110,7 @@
}
- (void)onCallEncryptionChanged:(NSNotification *)notif {
LinphoneCall *call = linphone_core_get_current_call([LinphoneManager getLc]);
LinphoneCall *call = linphone_core_get_current_call(LC);
if (call && (linphone_call_params_get_media_encryption(linphone_call_get_current_params(call)) ==
LinphoneMediaEncryptionZRTP) &&
@ -139,8 +138,7 @@
LOGI(@"Received new NOTIFY from voice mail: there is/are now %d message(s) unread", messagesUnreadCount);
// save in lpconfig for future
lp_config_set_int(linphone_core_get_config([LinphoneManager getLc]), "app", "voice_mail_messages_count",
messagesUnreadCount);
lp_config_set_int(linphone_core_get_config(LC), "app", "voice_mail_messages_count", messagesUnreadCount);
[self updateVoicemail];
}
@ -152,7 +150,7 @@
- (void)callUpdate:(NSNotification *)notif {
// show voice mail only when there is no call
[self updateUI:linphone_core_get_calls([LinphoneManager getLc]) != NULL];
[self updateUI:linphone_core_get_calls(LC) != NULL];
[self updateVoicemail];
}
@ -174,7 +172,7 @@
- (void)proxyConfigUpdate:(LinphoneProxyConfig *)config {
LinphoneRegistrationState state = LinphoneRegistrationNone;
NSString *message = nil;
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneCore *lc = LC;
LinphoneGlobalState gstate = linphone_core_get_global_state(lc);
if (gstate == LinphoneGlobalConfiguring) {
@ -182,7 +180,7 @@
} else if (config == NULL) {
state = LinphoneRegistrationNone;
if (linphone_core_get_proxy_config_list(lc) != NULL) {
if (linphone_core_is_network_reachable([LinphoneManager getLc])) {
if (linphone_core_is_network_reachable(LC)) {
message = NSLocalizedString(@"No default account", nil);
} else {
message = NSLocalizedString(@"Network down", nil);
@ -258,7 +256,7 @@
BOOL pending = false;
BOOL security = true;
const MSList *list = linphone_core_get_calls([LinphoneManager getLc]);
const MSList *list = linphone_core_get_calls(LC);
if (list == NULL) {
if (securityDialog) {
[securityDialog dismiss];
@ -285,7 +283,7 @@
}
- (void)callQualityUpdate {
LinphoneCall *call = linphone_core_get_current_call([LinphoneManager getLc]);
LinphoneCall *call = linphone_core_get_current_call(LC);
if (call != NULL) {
int quality = MIN(4, floor(linphone_call_get_average_quality(call)));
NSString *accessibilityValue = [NSString stringWithFormat:NSLocalizedString(@"Call quality: %d", nil), quality];
@ -304,8 +302,8 @@
#pragma mark - Action Functions
- (IBAction)onSecurityClick:(id)sender {
if (linphone_core_get_calls_nb([LinphoneManager getLc])) {
LinphoneCall *call = linphone_core_get_current_call([LinphoneManager getLc]);
if (linphone_core_get_calls_nb(LC)) {
LinphoneCall *call = linphone_core_get_current_call(LC);
if (call != NULL) {
LinphoneMediaEncryption enc =
linphone_call_params_get_media_encryption(linphone_call_get_current_params(call));
@ -319,13 +317,13 @@
cancelMessage:NSLocalizedString(@"DENY", nil)
confirmMessage:NSLocalizedString(@"ACCEPT", nil)
onCancelClick:^() {
if (linphone_core_get_current_call([LinphoneManager getLc]) == call) {
if (linphone_core_get_current_call(LC) == call) {
linphone_call_set_authentication_token_verified(call, NO);
}
weakSelf->securityDialog = nil;
}
onConfirmationClick:^() {
if (linphone_core_get_current_call([LinphoneManager getLc]) == call) {
if (linphone_core_get_current_call(LC) == call) {
linphone_call_set_authentication_token_verified(call, YES);
}
weakSelf->securityDialog = nil;
@ -342,7 +340,7 @@
}
- (IBAction)onRegistrationStateClick:(id)sender {
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneCore *lc = LC;
if (linphone_core_get_default_proxy_config(lc)) {
linphone_core_refresh_registers(lc);
} else if (linphone_core_get_proxy_config_list(lc)) {

View file

@ -27,24 +27,24 @@
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(changeViewEvent:)
name:kLinphoneMainViewChange
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(callUpdate:)
name:kLinphoneCallUpdate
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(messageReceived:)
name:kLinphoneMessageReceived
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(changeViewEvent:)
name:kLinphoneMainViewChange
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(callUpdate:)
name:kLinphoneCallUpdate
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(messageReceived:)
name:kLinphoneMessageReceived
object:nil];
[self update:FALSE];
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[[NSNotificationCenter defaultCenter] removeObserver:self];
[NSNotificationCenter.defaultCenter removeObserver:self];
}
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
@ -56,7 +56,7 @@
- (void)callUpdate:(NSNotification *)notif {
// LinphoneCall *call = [[notif.userInfo objectForKey: @"call"] pointerValue];
// LinphoneCallState state = [[notif.userInfo objectForKey: @"state"] intValue];
[self updateMissedCall:linphone_core_get_missed_calls_count([LinphoneManager getLc]) appear:TRUE];
[self updateMissedCall:linphone_core_get_missed_calls_count(LC) appear:TRUE];
}
- (void)changeViewEvent:(NSNotification *)notif {
@ -74,7 +74,7 @@
- (void)update:(BOOL)appear {
[self updateSelectedButton:[PhoneMainView.instance currentView]];
[self updateMissedCall:linphone_core_get_missed_calls_count([LinphoneManager getLc]) appear:appear];
[self updateMissedCall:linphone_core_get_missed_calls_count(LC) appear:appear];
[self updateUnreadMessage:appear];
}
@ -131,7 +131,7 @@
: -selectedNewFrame.size.height /*hide it if none is selected*/))));
}
CGFloat delay = [[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"] ? 0.3 : 0;
CGFloat delay = ANIMATED ? 0.3 : 0;
[UIView animateWithDuration:delay
animations:^{
_selectedButtonImage.frame = selectedNewFrame;

View file

@ -14,16 +14,16 @@
- (instancetype)init {
if (self = [super init]) {
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(callUpdateEvent:)
name:kLinphoneCallUpdate
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(callUpdateEvent:)
name:kLinphoneCallUpdate
object:nil];
}
return self;
}
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[NSNotificationCenter.defaultCenter removeObserver:self];
}
- (void)callUpdateEvent:(NSNotification *)notif {
@ -31,12 +31,11 @@
}
- (void)update {
self.hidden = (_tableView.isEditing || linphone_core_get_current_call([LinphoneManager getLc]) == NULL);
self.hidden = (_tableView.isEditing || linphone_core_get_current_call(LC) == NULL);
}
- (IBAction)onBackToCallClick:(id)sender {
CallView *view = VIEW(CallView);
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
[PhoneMainView.instance popToView:CallView.compositeViewDescription];
}
@end

View file

@ -18,23 +18,23 @@ static NSString *const kDisappearAnimation = @"disappear";
@implementation UIBouncingView
INIT_WITH_COMMON_CF {
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(settingsUpdate:)
name:kLinphoneSettingsUpdate
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(applicationWillEnterForeground:)
name:UIApplicationWillEnterForegroundNotification
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(settingsUpdate:)
name:kLinphoneSettingsUpdate
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(applicationWillEnterForeground:)
name:UIApplicationWillEnterForegroundNotification
object:nil];
return self;
}
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[NSNotificationCenter.defaultCenter removeObserver:self];
}
- (void)settingsUpdate:(NSNotification *)notif {
if ([[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"] == false) {
if (ANIMATED == false) {
[self stopAnimating:NO];
} else {
if (![self isHidden]) {
@ -105,7 +105,7 @@ INIT_WITH_COMMON_CF {
}
[self setHidden:FALSE];
if ([[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"] == true) {
if (ANIMATED) {
if (animated) {
[self appearAnimation:kAppearAnimation
target:self

View file

@ -61,7 +61,7 @@
- (void)touchUp:(id)sender {
NSString *address = addressField.text;
if (address.length == 0) {
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneCore *lc = LC;
LinphoneCallLog *log = linphone_core_get_last_outgoing_call_log(lc);
if (log) {
LinphoneAddress *to = linphone_call_log_get_to(log);
@ -87,16 +87,15 @@
}
if ([address length] > 0) {
LinphoneAddress *addr = linphone_address_new(address.UTF8String);
NSString *displayName = addr ? [FastAddressBook displayNameForAddress:addr] : nil;
LinphoneAddress *addr = linphone_core_interpret_url(LC, address.UTF8String);
[LinphoneManager.instance call:addr transfer:FALSE];
if (addr)
linphone_address_destroy(addr);
[LinphoneManager.instance call:address displayName:displayName transfer:FALSE];
}
}
- (void)updateVideoPolicy {
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneCore *lc = LC;
if (linphone_core_video_capture_enabled(lc) && linphone_core_get_video_policy(lc)->automatically_initiate) {
[self setImage:[UIImage imageNamed:@"call_video_start_default.png"] forState:UIControlStateNormal];
[self setImage:[UIImage imageNamed:@"call_video_start_disabled.png"] forState:UIControlStateDisabled];

View file

@ -43,6 +43,6 @@
}
- (IBAction)onKickClick:(id)sender {
linphone_core_remove_from_conference([LinphoneManager getLc], _call);
linphone_core_remove_from_conference(LC, _call);
}
@end

View file

@ -34,8 +34,8 @@ INIT_WITH_COMMON_CF {
#pragma mark -
- (void)touchUp:(id)sender {
const char *currentCamId = (char *)linphone_core_get_video_device([LinphoneManager getLc]);
const char **cameras = linphone_core_get_video_devices([LinphoneManager getLc]);
const char *currentCamId = (char *)linphone_core_get_video_device(LC);
const char **cameras = linphone_core_get_video_devices(LC);
const char *newCamId = NULL;
int i;
@ -49,10 +49,10 @@ INIT_WITH_COMMON_CF {
}
if (newCamId) {
LOGI(@"Switching from [%s] to [%s]", currentCamId, newCamId);
linphone_core_set_video_device([LinphoneManager getLc], newCamId);
LinphoneCall *call = linphone_core_get_current_call([LinphoneManager getLc]);
linphone_core_set_video_device(LC, newCamId);
LinphoneCall *call = linphone_core_get_current_call(LC);
if (call != NULL) {
linphone_core_update_call([LinphoneManager getLc], call, NULL);
linphone_core_update_call(LC, call, NULL);
}
}
}

View file

@ -62,7 +62,7 @@
const LinphoneContent *c = linphone_chat_message_get_file_transfer_information(amessage);
if (c) {
const char *name = linphone_content_get_name(c);
for (FileTransferDelegate *aftd in [[LinphoneManager instance] fileTransferDelegates]) {
for (FileTransferDelegate *aftd in [LinphoneManager.instance fileTransferDelegates]) {
if (linphone_chat_message_get_file_transfer_information(aftd.message) &&
(linphone_chat_message_is_outgoing(aftd.message) == linphone_chat_message_is_outgoing(amessage)) &&
strcmp(name, linphone_content_get_name(
@ -156,21 +156,13 @@
[_ftd download:self.message];
_cancelButton.hidden = NO;
_downloadButton.hidden = YES;
// we must tell the tableview to refresh the cell to reflect its internal state
ChatConversationView *view = VIEW(ChatConversationView);
[view.tableController updateChatEntry:self.message];
}
- (IBAction)onCancelClick:(id)sender {
FileTransferDelegate *tmp = _ftd;
[self disconnectFromFileDelegate];
[tmp cancel];
_fileTransferProgress.progress = 0;
[self update];
// we must tell the tableview to refresh the cell to reflect its internal state
ChatConversationView *view = VIEW(ChatConversationView);
[view.tableController updateChatEntry:self.message];
[tmp cancel];
}
- (void)onResendClick:(id)event {
@ -191,7 +183,7 @@
} else {
if (![_messageImageView isLoading]) {
ImageView *view = VIEW(ImageView);
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE];
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
CGImageRef fullScreenRef = [[_messageImageView.fullImageUrl defaultRepresentation] fullScreenImage];
UIImage *fullScreen = [UIImage imageWithCGImage:fullScreenRef];
[view setImage:fullScreen];
@ -210,19 +202,19 @@
_ftd = aftd;
_fileTransferProgress.progress = 0;
[[NSNotificationCenter defaultCenter] removeObserver:self];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(onFileTransferSendUpdate:)
name:kLinphoneFileTransferSendUpdate
object:_ftd];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(onFileTransferRecvUpdate:)
name:kLinphoneFileTransferRecvUpdate
object:_ftd];
[NSNotificationCenter.defaultCenter removeObserver:self];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(onFileTransferSendUpdate:)
name:kLinphoneFileTransferSendUpdate
object:_ftd];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(onFileTransferRecvUpdate:)
name:kLinphoneFileTransferRecvUpdate
object:_ftd];
}
- (void)disconnectFromFileDelegate {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[NSNotificationCenter.defaultCenter removeObserver:self];
_ftd = nil;
}

View file

@ -70,9 +70,16 @@
}
+ (NSString *)TextMessageForChat:(LinphoneChatMessage *)message {
const char *text = linphone_chat_message_get_text(message) ?: "";
return [NSString stringWithUTF8String:text] ?: [NSString stringWithCString:text encoding:NSASCIIStringEncoding]
?: NSLocalizedString(@"(invalid string)", nil);
const char *url = linphone_chat_message_get_external_body_url(message);
const LinphoneContent *last_content = linphone_chat_message_get_file_transfer_information(message);
// Last message was a file transfer (image) so display a picture...
if (url || last_content) {
return @"🗻";
} else {
const char *text = linphone_chat_message_get_text(message) ?: "";
return [NSString stringWithUTF8String:text] ?: [NSString stringWithCString:text encoding:NSASCIIStringEncoding]
?: NSLocalizedString(@"(invalid string)", nil);
}
}
+ (NSString *)ContactDateForChat:(LinphoneChatMessage *)message {
@ -185,8 +192,7 @@
[self onDeleteClick:nil];
[[LinphoneManager instance]
.photoLibrary assetForURL:imageUrl
[LinphoneManager.instance.photoLibrary assetForURL:imageUrl
resultBlock:^(ALAsset *asset) {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, (unsigned long)NULL),
^(void) {

View file

@ -69,22 +69,12 @@
LinphoneChatMessage *last_message = linphone_chat_room_get_user_data(chatRoom);
if (last_message) {
const char *text = linphone_chat_message_get_text(last_message);
const char *url = linphone_chat_message_get_external_body_url(last_message);
const LinphoneContent *last_content = linphone_chat_message_get_file_transfer_information(last_message);
// Last message was a file transfer (image) so display a picture...
if (url || last_content) {
_chatContentLabel.text = @"🗻";
// otherwise show beginning of the text message
} else if (text) {
NSString *message = [NSString stringWithUTF8String:text];
// shorten long messages
if ([message length] > 50)
message = [[message substringToIndex:50] stringByAppendingString:@"[...]"];
_chatContentLabel.text = message;
NSString *message = [UIChatBubbleTextCell TextMessageForChat:last_message];
// shorten long messages
if ([message length] > 50) {
message = [[message substringToIndex:50] stringByAppendingString:@"[...]"];
}
_chatContentLabel.text = message;
_chatLatestTimeLabel.text =
[LinphoneUtils timeToString:linphone_chat_message_get_time(last_message) withFormat:LinphoneDateChatList];
_chatLatestTimeLabel.hidden = NO;

View file

@ -130,6 +130,7 @@
[_selectedItems removeAllObjects];
[self selectToggleButton:!_toggleSelectionButton.selected]; // TODO: why do we need that?
LOGI(@"onSelectionToggle: select %@", _toggleSelectionButton.selected ? @"NONE" : @"ALL");
for (int i = 0; i < [self numberOfSectionsInTableView:self.tableView]; i++) {
for (int j = 0; j < [self tableView:self.tableView numberOfRowsInSection:i]; j++) {
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:j inSection:i];

View file

@ -116,7 +116,7 @@
}
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[NSNotificationCenter.defaultCenter removeObserver:self];
}
#pragma mark - ViewController Functions
@ -158,10 +158,10 @@
[self.tabBarViewController viewWillAppear:animated];
[self.statusBarViewController viewWillAppear:animated];
[self.sideMenuViewController viewWillAppear:animated];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(orientationDidChange:)
name:UIDeviceOrientationDidChangeNotification
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(orientationDidChange:)
name:UIDeviceOrientationDidChangeNotification
object:nil];
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
}
@ -184,7 +184,7 @@
[[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIDeviceOrientationDidChangeNotification object:nil];
[NSNotificationCenter.defaultCenter removeObserver:self name:UIDeviceOrientationDidChangeNotification object:nil];
}
- (void)viewDidDisappear:(BOOL)animated {

View file

@ -43,7 +43,7 @@
- (void)setAddress:(NSString *)address {
_addressLabel.text = _editTextfield.text = address;
LinphoneAddress *addr = linphone_core_interpret_url([LinphoneManager getLc], _addressLabel.text.UTF8String);
LinphoneAddress *addr = linphone_core_interpret_url(LC, _addressLabel.text.UTF8String);
_chatButton.enabled = _callButton.enabled = (addr != NULL);
_chatButton.accessibilityLabel =
@ -75,28 +75,20 @@
}
- (IBAction)onCallClick:(id)event {
LinphoneAddress *addr = linphone_core_interpret_url([LinphoneManager getLc], _addressLabel.text.UTF8String);
if (addr == NULL)
return;
char *lAddress = linphone_address_as_string_uri_only(addr);
NSString *displayName = [FastAddressBook displayNameForAddress:addr];
DialerView *view = VIEW(DialerView);
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
[view call:[NSString stringWithUTF8String:lAddress] displayName:displayName];
ms_free(lAddress);
linphone_address_destroy(addr);
LinphoneAddress *addr = linphone_core_interpret_url(LC, _addressLabel.text.UTF8String);
[LinphoneManager.instance call:addr transfer:NO];
if (addr)
linphone_address_destroy(addr);
}
- (IBAction)onChatClick:(id)event {
LinphoneAddress *addr = linphone_core_interpret_url([LinphoneManager getLc], _addressLabel.text.UTF8String);
LinphoneAddress *addr = linphone_core_interpret_url(LC, _addressLabel.text.UTF8String);
if (addr == NULL)
return;
[PhoneMainView.instance changeCurrentView:ChatsListView.compositeViewDescription];
ChatConversationView *view = VIEW(ChatConversationView);
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE];
LinphoneChatRoom *room = linphone_core_get_chat_room([LinphoneManager getLc], addr);
LinphoneChatRoom *room = linphone_core_get_chat_room(LC, addr);
[view setChatRoom:room];
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
linphone_address_destroy(addr);
}

View file

@ -64,18 +64,18 @@
#pragma mark - Actions Functions
- (void)touchDown:(id)sender {
if (addressField && (!dtmf || !linphone_core_in_call([LinphoneManager getLc]))) {
if (addressField && (!dtmf || !linphone_core_in_call(LC))) {
NSString *newAddress = [NSString stringWithFormat:@"%@%c", addressField.text, digit];
[addressField setText:newAddress];
linphone_core_play_dtmf([LinphoneManager getLc], digit, -1);
linphone_core_play_dtmf(LC, digit, -1);
} else {
linphone_call_send_dtmf(linphone_core_get_current_call([LinphoneManager getLc]), digit);
linphone_core_play_dtmf([LinphoneManager getLc], digit, 100);
linphone_call_send_dtmf(linphone_core_get_current_call(LC), digit);
linphone_core_play_dtmf(LC, digit, 100);
}
}
- (void)touchUp:(id)sender {
linphone_core_stop_dtmf([LinphoneManager getLc]);
linphone_core_stop_dtmf(LC);
}
@end

View file

@ -76,7 +76,7 @@
#pragma mark -
- (void)update {
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneCore *lc = LC;
if (linphone_core_get_calls_nb(lc) == 1 || // One call
linphone_core_get_current_call(lc) != NULL || // In call
linphone_core_is_in_conference(lc) || // In conference
@ -91,7 +91,7 @@
#pragma mark - Action Functions
- (void)touchUp:(id)sender {
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneCore *lc = LC;
LinphoneCall *currentcall = linphone_core_get_current_call(lc);
if (linphone_core_is_in_conference(lc) || // In conference
(linphone_core_get_conference_size(lc) > 0 && [UIHangUpButton callCount:lc] == 0) // Only one conf

View file

@ -60,7 +60,9 @@
// Go to History details view
HistoryDetailsView *view = VIEW(HistoryDetailsView);
[view setCallLogId:[NSString stringWithUTF8String:linphone_call_log_get_call_id(callLog)]];
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE];
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
} else {
LOGE(@"Cannot open selected call log, it is NULL or corrupted");
}
}

View file

@ -24,15 +24,15 @@
@implementation UIMicroButton
- (void)onOn {
linphone_core_enable_mic([LinphoneManager getLc], false);
linphone_core_enable_mic(LC, false);
}
- (void)onOff {
linphone_core_enable_mic([LinphoneManager getLc], true);
linphone_core_enable_mic(LC, true);
}
- (bool)onUpdate {
return !linphone_core_mic_enabled([LinphoneManager getLc]);
return !linphone_core_mic_enabled(LC);
}
@end

View file

@ -75,7 +75,7 @@
}
+ (LinphoneCall *)getCall {
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneCore *lc = LC;
LinphoneCall *currentCall = linphone_core_get_current_call(lc);
if (currentCall == nil && linphone_core_get_calls_nb(lc) == 1) {
currentCall = (LinphoneCall *)linphone_core_get_calls(lc)->data;
@ -96,23 +96,23 @@
switch (type) {
case UIPauseButtonType_Call: {
if (call != nil) {
linphone_core_pause_call([LinphoneManager getLc], call);
linphone_core_pause_call(LC, call);
} else {
LOGW(@"Cannot toggle pause buttton, because no current call");
}
break;
}
case UIPauseButtonType_Conference: {
linphone_core_leave_conference([LinphoneManager getLc]);
linphone_core_leave_conference(LC);
// Fake event
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneCallUpdate object:self];
[NSNotificationCenter.defaultCenter postNotificationName:kLinphoneCallUpdate object:self];
break;
}
case UIPauseButtonType_CurrentCall: {
LinphoneCall *currentCall = [UIPauseButton getCall];
if (currentCall != nil) {
linphone_core_pause_call([LinphoneManager getLc], currentCall);
linphone_core_pause_call(LC, currentCall);
} else {
LOGW(@"Cannot toggle pause buttton, because no current call");
}
@ -125,22 +125,22 @@
switch (type) {
case UIPauseButtonType_Call: {
if (call != nil) {
linphone_core_resume_call([LinphoneManager getLc], call);
linphone_core_resume_call(LC, call);
} else {
LOGW(@"Cannot toggle pause buttton, because no current call");
}
break;
}
case UIPauseButtonType_Conference: {
linphone_core_enter_conference([LinphoneManager getLc]);
linphone_core_enter_conference(LC);
// Fake event
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneCallUpdate object:self];
[NSNotificationCenter.defaultCenter postNotificationName:kLinphoneCallUpdate object:self];
break;
}
case UIPauseButtonType_CurrentCall: {
LinphoneCall *currentCall = [UIPauseButton getCall];
if (currentCall != nil) {
linphone_core_resume_call([LinphoneManager getLc], currentCall);
linphone_core_resume_call(LC, currentCall);
} else {
LOGW(@"Cannot toggle pause buttton, because no current call");
}
@ -151,7 +151,7 @@
- (bool)onUpdate {
bool ret = false;
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneCore *lc = LC;
LinphoneCall *c = call;
switch (type) {
case UIPauseButtonType_Conference: {

View file

@ -23,15 +23,15 @@ INIT_WITH_COMMON_CF {
[self setBordered:NO];
[self setRoundRadius];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(orientationDidChange:)
name:@"UIDeviceOrientationDidChangeNotification"
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(orientationDidChange:)
name:@"UIDeviceOrientationDidChangeNotification"
object:nil];
return self;
}
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[NSNotificationCenter.defaultCenter removeObserver:self];
}
- (void)orientationDidChange:(NSNotification *)k {
@ -51,7 +51,8 @@ INIT_WITH_COMMON_CF {
}
- (void)setBordered:(BOOL)bordered {
borderView.hidden = !bordered;
// bugged on rotation yet
borderView.hidden = TRUE; //! bordered;
}
- (CGRect)computeBox {
CGFloat min = MIN(self.frame.size.width, self.frame.size.height);

View file

@ -60,16 +60,16 @@ INIT_WITH_COMMON_CF {
#pragma mark - UIToggleButtonDelegate Functions
- (void)onOn {
[[LinphoneManager instance] setSpeakerEnabled:TRUE];
[LinphoneManager.instance setSpeakerEnabled:TRUE];
}
- (void)onOff {
[[LinphoneManager instance] setSpeakerEnabled:FALSE];
[LinphoneManager.instance setSpeakerEnabled:FALSE];
}
- (bool)onUpdate {
[self setEnabled:[[LinphoneManager instance] allowSpeaker]];
return [[LinphoneManager instance] speakerEnabled];
[self setEnabled:[LinphoneManager.instance allowSpeaker]];
return [LinphoneManager.instance speakerEnabled];
}
@end

View file

@ -58,7 +58,10 @@
#pragma mark -
- (void)touchUp:(id)sender {
[[LinphoneManager instance] call:[addressField text] displayName:nil transfer:TRUE];
LinphoneAddress *addr = linphone_core_interpret_url(LC, addressField.text.UTF8String);
[LinphoneManager.instance call:addr transfer:TRUE];
if (addr)
linphone_address_destroy(addr);
}
@end

View file

@ -33,7 +33,7 @@ INIT_WITH_COMMON_CF {
}
- (void)onOn {
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneCore *lc = LC;
if (!linphone_core_video_display_enabled(lc))
return;
@ -41,7 +41,7 @@ INIT_WITH_COMMON_CF {
[self setEnabled:FALSE];
[waitView startAnimating];
LinphoneCall *call = linphone_core_get_current_call([LinphoneManager getLc]);
LinphoneCall *call = linphone_core_get_current_call(LC);
if (call) {
LinphoneCallAppData *callAppData = (__bridge LinphoneCallAppData *)linphone_call_get_user_pointer(call);
callAppData->videoRequested =
@ -56,7 +56,7 @@ INIT_WITH_COMMON_CF {
}
- (void)onOff {
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneCore *lc = LC;
if (!linphone_core_video_display_enabled(lc))
return;
@ -64,7 +64,7 @@ INIT_WITH_COMMON_CF {
[self setEnabled:FALSE];
[waitView startAnimating];
LinphoneCall *call = linphone_core_get_current_call([LinphoneManager getLc]);
LinphoneCall *call = linphone_core_get_current_call(LC);
if (call) {
LinphoneCallParams *call_params = linphone_call_params_copy(linphone_call_get_current_params(call));
linphone_call_params_enable_video(call_params, FALSE);
@ -77,7 +77,7 @@ INIT_WITH_COMMON_CF {
- (bool)onUpdate {
bool video_enabled = false;
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneCore *lc = LC;
LinphoneCall *currentCall = linphone_core_get_current_call(lc);
if (linphone_core_video_supported(lc)) {
if (linphone_core_video_display_enabled(lc) && currentCall && !linphone_call_media_in_progress(currentCall) &&

View file

@ -36,7 +36,7 @@
} else {
cx = cy = 0.5;
}
linphone_call_zoom_video(linphone_core_get_current_call([LinphoneManager getLc]), zoomLevel, &cx, &cy);
linphone_call_zoom_video(linphone_core_get_current_call(LC), zoomLevel, &cx, &cy);
}
- (void)videoPan:(UIPanGestureRecognizer *)reco {
@ -58,7 +58,7 @@
return;
}
linphone_call_zoom_video(linphone_core_get_current_call([LinphoneManager getLc]), zoomLevel, &x, &y);
linphone_call_zoom_video(linphone_core_get_current_call(LC), zoomLevel, &x, &y);
cx = x;
cy = y;
}
@ -82,7 +82,7 @@
return;
}
linphone_call_zoom_video(linphone_core_get_current_call([LinphoneManager getLc]), s, &cx, &cy);
linphone_call_zoom_video(linphone_core_get_current_call(LC), s, &cx, &cy);
}
- (void)resetZoom {

View file

@ -19,18 +19,19 @@
#import "LinphoneManager.h"
#define LOGV(level, ...) [LinphoneLogger log:level file:__FILE__ line:__LINE__ format:__VA_ARGS__]
#define LOGD(...) LOGV(ORTP_DEBUG, __VA_ARGS__)
#define LOGI(...) LOGV(ORTP_MESSAGE, __VA_ARGS__)
#define LOGW(...) LOGV(ORTP_WARNING, __VA_ARGS__)
#define LOGE(...) LOGV(ORTP_ERROR, __VA_ARGS__)
#define LOGF(...) LOGV(ORTP_FATAL, __VA_ARGS__)
#define APP_LVL 1 << 7
#define LOGV(level, ...) [Log log:APP_LVL & level file:__FILE__ line:__LINE__ format:__VA_ARGS__]
#define LOGD(...) LOGV(APP_LVL | ORTP_DEBUG, __VA_ARGS__)
#define LOGI(...) LOGV(APP_LVL | ORTP_MESSAGE, __VA_ARGS__)
#define LOGW(...) LOGV(APP_LVL | ORTP_WARNING, __VA_ARGS__)
#define LOGE(...) LOGV(APP_LVL | ORTP_ERROR, __VA_ARGS__)
#define LOGF(...) LOGV(APP_LVL | ORTP_FATAL, __VA_ARGS__)
#define IPAD (LinphoneManager.runningOnIpad)
@interface LinphoneLogger : NSObject {
@interface Log : NSObject {
}
+ (void)log:(OrtpLogLevel)severity file:(const char *)file line:(int)line format:(NSString *)format, ...;
+ (void)enableLogs:(BOOL)enabled;
void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
@end

View file

@ -81,9 +81,7 @@
@property(weak, readonly) UICompositeViewDescription *currentView;
@property(readonly, strong) MPVolumeView *volumeView;
- (void)changeCurrentView:(UICompositeViewDescription *)currentView;
- (void)changeCurrentView:(UICompositeViewDescription *)currentView push:(BOOL)push;
- (void)changeCurrentView:(UICompositeViewDescription *)view push:(BOOL)push animated:(BOOL)animated;
- (void)changeCurrentView:(UICompositeViewDescription *)view;
- (UIViewController*)popCurrentView;
- (UIViewController *)popToView:(UICompositeViewDescription *)currentView;
- (UICompositeViewDescription *)firstView;

View file

@ -78,7 +78,7 @@ static RootViewManager *rootViewManagerInstance = nil;
currentViewController = newMainView;
LinphoneAppDelegate *delegate = (LinphoneAppDelegate *)[UIApplication sharedApplication].delegate;
if ([[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"] == true) {
if (ANIMATED) {
[UIView transitionWithView:delegate.window
duration:0.3
options:UIViewAnimationOptionTransitionFlipFromLeft | UIViewAnimationOptionAllowAnimatedContent
@ -154,7 +154,7 @@ static RootViewManager *rootViewManagerInstance = nil;
}
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[NSNotificationCenter.defaultCenter removeObserver:self];
}
#pragma mark - ViewController Functions
@ -173,39 +173,32 @@ static RootViewManager *rootViewManagerInstance = nil;
[super viewWillAppear:animated];
// Set observers
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(callUpdate:)
name:kLinphoneCallUpdate
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(registrationUpdate:)
name:kLinphoneRegistrationUpdate
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(textReceived:)
name:kLinphoneMessageReceived
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(onGlobalStateChanged:)
name:kLinphoneGlobalStateUpdate
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(callUpdate:)
name:kLinphoneCallUpdate
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(registrationUpdate:)
name:kLinphoneRegistrationUpdate
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(textReceived:)
name:kLinphoneMessageReceived
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(onGlobalStateChanged:)
name:kLinphoneGlobalStateUpdate
object:nil];
[[UIDevice currentDevice] setBatteryMonitoringEnabled:YES];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(batteryLevelChanged:)
name:UIDeviceBatteryLevelDidChangeNotification
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(batteryLevelChanged:)
name:UIDeviceBatteryLevelDidChangeNotification
object:nil];
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
// Remove observers
[[NSNotificationCenter defaultCenter] removeObserver:self name:kLinphoneCallUpdate object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:kLinphoneRegistrationUpdate object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:kLinphoneMessageReceived object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:UIDeviceBatteryLevelDidChangeNotification
object:nil];
[NSNotificationCenter.defaultCenter removeObserver:self];
[[UIDevice currentDevice] setBatteryMonitoringEnabled:NO];
}
@ -294,9 +287,9 @@ static RootViewManager *rootViewManagerInstance = nil;
- (void)onGlobalStateChanged:(NSNotification *)notif {
LinphoneGlobalState state = (LinphoneGlobalState)[[[notif userInfo] valueForKey:@"state"] integerValue];
static BOOL already_shown = FALSE;
if (state == LinphoneGlobalOn && !already_shown && [LinphoneManager instance].wasRemoteProvisioned) {
LinphoneProxyConfig *conf = linphone_core_get_default_proxy_config([LinphoneManager getLc]);
if ([[LinphoneManager instance] lpConfigBoolForKey:@"show_login_view" inSection:@"app"] && conf == NULL) {
if (state == LinphoneGlobalOn && !already_shown && LinphoneManager.instance.wasRemoteProvisioned) {
LinphoneProxyConfig *conf = linphone_core_get_default_proxy_config(LC);
if ([LinphoneManager.instance lpConfigBoolForKey:@"show_login_view" inSection:@"app"] && conf == NULL) {
already_shown = TRUE;
AssistantView *view = VIEW(AssistantView);
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
@ -329,7 +322,7 @@ static RootViewManager *rootViewManagerInstance = nil;
case LinphoneCallPausedByRemote:
case LinphoneCallConnected:
case LinphoneCallStreamsRunning: {
[self changeCurrentView:CallView.compositeViewDescription push:NO];
[self changeCurrentView:CallView.compositeViewDescription];
break;
}
case LinphoneCallUpdatedByRemote: {
@ -345,19 +338,15 @@ static RootViewManager *rootViewManagerInstance = nil;
[self displayCallError:call message:message];
}
case LinphoneCallEnd: {
const MSList *calls = linphone_core_get_calls([LinphoneManager getLc]);
const MSList *calls = linphone_core_get_calls(LC);
if (calls == NULL) {
// if ((currentView == CallView.compositeViewDescription) ||
// (currentView == CallIncomingView.compositeViewDescription) ||
// (currentView == CallOutgoingView.compositeViewDescription)) {
DialerView *view = VIEW(DialerView);
[view setAddress:@""];
[view setTransferMode:FALSE];
[self changeCurrentView:view.compositeViewDescription push:NO];
// [self popCurrentView];
// }
while ((currentView == CallView.compositeViewDescription) ||
(currentView == CallIncomingView.compositeViewDescription) ||
(currentView == CallOutgoingView.compositeViewDescription)) {
[self popCurrentView];
}
} else {
linphone_core_resume_call([LinphoneManager getLc], (LinphoneCall *)calls->data);
linphone_core_resume_call(LC, (LinphoneCall *)calls->data);
[self changeCurrentView:CallView.compositeViewDescription];
}
break;
@ -382,7 +371,7 @@ static RootViewManager *rootViewManagerInstance = nil;
#pragma mark -
- (void)orientationUpdate:(UIInterfaceOrientation)orientation {
int oldLinphoneOrientation = linphone_core_get_device_rotation([LinphoneManager getLc]);
int oldLinphoneOrientation = linphone_core_get_device_rotation(LC);
int newRotation = 0;
switch (orientation) {
case UIInterfaceOrientationPortrait:
@ -401,22 +390,22 @@ static RootViewManager *rootViewManagerInstance = nil;
newRotation = oldLinphoneOrientation;
}
if (oldLinphoneOrientation != newRotation) {
linphone_core_set_device_rotation([LinphoneManager getLc], newRotation);
LinphoneCall *call = linphone_core_get_current_call([LinphoneManager getLc]);
linphone_core_set_device_rotation(LC, newRotation);
LinphoneCall *call = linphone_core_get_current_call(LC);
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);
linphone_core_update_call(LC, call, NULL);
}
}
}
- (void)startUp {
LinphoneCore *core = nil;
@try {
core = [LinphoneManager getLc];
LinphoneManager *lm = [LinphoneManager instance];
core = LC;
LinphoneManager *lm = LinphoneManager.instance;
if (linphone_core_get_global_state(core) != LinphoneGlobalOn) {
[self changeCurrentView:DialerView.compositeViewDescription];
} else if ([[LinphoneManager instance] lpConfigBoolForKey:@"enable_first_login_view_preference"] == true) {
} else if ([LinphoneManager.instance lpConfigBoolForKey:@"enable_first_login_view_preference"] == true) {
[PhoneMainView.instance changeCurrentView:FirstLoginView.compositeViewDescription];
} else {
// always start to dialer when testing
@ -438,9 +427,9 @@ static RootViewManager *rootViewManagerInstance = nil;
- (void)updateApplicationBadgeNumber {
int count = 0;
count += linphone_core_get_missed_calls_count([LinphoneManager getLc]);
count += linphone_core_get_missed_calls_count(LC);
count += [LinphoneManager unreadMessageCount];
count += linphone_core_get_calls_nb([LinphoneManager getLc]);
count += linphone_core_get_calls_nb(LC);
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:count];
}
@ -544,44 +533,35 @@ static RootViewManager *rootViewManagerInstance = nil;
[mainViewController setFullscreen:enabled];
}
- (void)changeCurrentView:(UICompositeViewDescription *)view {
[self changeCurrentView:view push:TRUE];
}
- (void)changeCurrentView:(UICompositeViewDescription *)view push:(BOOL)push {
[self changeCurrentView:view
push:push
animated:[[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"]];
}
- (void)changeCurrentView:(UICompositeViewDescription *)view push:(BOOL)push animated:(BOOL)animated {
- (UIViewController *)popCurrentView {
NSMutableArray *viewStack = [RootViewManager instance].viewDescriptionStack;
if (push && view) {
[viewStack addObject:view];
if (viewStack.count <= 1) {
[viewStack removeAllObjects];
LOGW(@"PhoneMainView: Trying to pop view but none stacked, going to %@!",
DialerView.compositeViewDescription.name);
} else {
[viewStack removeLastObject];
LOGI(@"PhoneMainView: Popping view %@, going to %@", currentView.name,
((UICompositeViewDescription *)(viewStack.lastObject ?: DialerView.compositeViewDescription)).name);
}
[self _changeCurrentView:view transition:nil animated:animated];
[self _changeCurrentView:viewStack.lastObject ?: DialerView.compositeViewDescription
transition:[PhoneMainView getBackwardTransition]
animated:ANIMATED];
return [mainViewController getCurrentViewController];
}
- (BOOL)isUnauthorizedView:(UICompositeViewDescription *)view {
return [[LinphoneManager.instance lpConfigStringForKey:@"unauthorized_views"] containsString:view.name];
- (void)changeCurrentView:(UICompositeViewDescription *)view {
[self _changeCurrentView:view transition:nil animated:ANIMATED];
}
- (UIViewController *)_changeCurrentView:(UICompositeViewDescription *)view
transition:(CATransition *)transition
animated:(BOOL)animated {
PhoneMainView *vc = [[RootViewManager instance] setViewControllerForDescription:view];
if ([self isUnauthorizedView:view]) {
NSString *fallback = [LinphoneManager.instance lpConfigStringForKey:@"fallback_view"];
UICompositeViewDescription *fallback_view = DialerView.compositeViewDescription;
if (fallback && [NSClassFromString(fallback) respondsToSelector:@selector(compositeViewDescription)]) {
fallback_view = [NSClassFromString(fallback) performSelector:@selector(compositeViewDescription)];
}
LOGW(@"Trying to access unauthorized view %@, going back to %@", view.name, fallback_view.name);
view = fallback_view;
}
if (![view equal:vc.currentView] || vc != self) {
LOGI(@"Change current view to %@", view.name);
NSMutableArray *viewStack = [RootViewManager instance].viewDescriptionStack;
[viewStack addObject:view];
if (animated && transition == nil)
transition = [PhoneMainView getTransition:vc.currentView new:view];
[vc.mainViewController setViewTransition:(animated ? transition : nil)];
@ -593,19 +573,17 @@ static RootViewManager *rootViewManagerInstance = nil;
//[[RootViewManager instance] setViewControllerForDescription:view];
NSDictionary *mdict = [NSMutableDictionary dictionaryWithObject:vc->currentView forKey:@"view"];
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneMainViewChange object:self userInfo:mdict];
[NSNotificationCenter.defaultCenter postNotificationName:kLinphoneMainViewChange object:self userInfo:mdict];
return [vc->mainViewController getCurrentViewController];
}
- (UIViewController *)popToView:(UICompositeViewDescription *)view {
NSMutableArray *viewStack = [RootViewManager instance].viewDescriptionStack;
while ([viewStack count] > 1 && ![[viewStack lastObject] equal:view]) {
while (viewStack.count > 0 && ![[viewStack lastObject] equal:view]) {
[viewStack removeLastObject];
}
return [self _changeCurrentView:[viewStack lastObject]
transition:[PhoneMainView getBackwardTransition]
animated:[[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"]];
return [self _changeCurrentView:view transition:[PhoneMainView getBackwardTransition] animated:ANIMATED];
}
- (UICompositeViewDescription *)firstView {
@ -617,20 +595,6 @@ static RootViewManager *rootViewManagerInstance = nil;
return view;
}
- (UIViewController *)popCurrentView {
NSMutableArray *viewStack = [RootViewManager instance].viewDescriptionStack;
if ([viewStack count] > 1) {
LOGI(@"PhoneMainView: Pop view");
[viewStack removeLastObject];
[self _changeCurrentView:[viewStack lastObject]
transition:[PhoneMainView getBackwardTransition]
animated:[[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"]];
return [mainViewController getCurrentViewController];
}
LOGW(@"PhoneMainView: Trying to pop view but none stacked!");
return nil;
}
- (void)displayCallError:(LinphoneCall *)call message:(NSString *)message {
const char *lUserNameChars = linphone_address_get_username(linphone_call_get_remote_address(call));
NSString *lUserName =
@ -639,7 +603,7 @@ static RootViewManager *rootViewManagerInstance = nil;
NSString *lTitle;
// get default proxy
LinphoneProxyConfig *proxyCfg = linphone_core_get_default_proxy_config([LinphoneManager getLc]);
LinphoneProxyConfig *proxyCfg = linphone_core_get_default_proxy_config(LC);
if (proxyCfg == nil) {
lMessage = NSLocalizedString(@"Please make sure your device is connected to the internet and double check your "
@"SIP account configuration in the settings.",
@ -688,7 +652,7 @@ static RootViewManager *rootViewManagerInstance = nil;
- (void)playMessageSoundForCallID:(NSString *)callID {
if ([UIApplication sharedApplication].applicationState != UIApplicationStateBackground) {
LinphoneManager *lm = [LinphoneManager instance];
LinphoneManager *lm = LinphoneManager.instance;
// if the message was already received through a push notif, we don't need to ring
if (![lm popPushCallID:callID]) {
[lm playMessageSound];
@ -701,7 +665,7 @@ static RootViewManager *rootViewManagerInstance = nil;
NSString *callId = [NSString stringWithUTF8String:linphone_call_log_get_call_id(callLog)];
if ([UIApplication sharedApplication].applicationState != UIApplicationStateBackground) {
LinphoneManager *lm = [LinphoneManager instance];
LinphoneManager *lm = LinphoneManager.instance;
BOOL callIDFromPush = [lm popPushCallID:callId];
BOOL autoAnswer = [lm lpConfigBoolForKey:@"autoanswer_notif_preference"];
@ -711,7 +675,7 @@ static RootViewManager *rootViewManagerInstance = nil;
} else {
AudioServicesPlaySystemSound(lm.sounds.vibrate);
CallIncomingView *view = VIEW(CallIncomingView);
[self changeCurrentView:view.compositeViewDescription push:TRUE];
[self changeCurrentView:view.compositeViewDescription];
[view setCall:call];
[view setDelegate:self];
}
@ -723,7 +687,7 @@ static RootViewManager *rootViewManagerInstance = nil;
UIDeviceBatteryState state = [UIDevice currentDevice].batteryState;
LOGD(@"Battery state:%d level:%.2f", state, level);
LinphoneCall *call = linphone_core_get_current_call([LinphoneManager getLc]);
LinphoneCall *call = linphone_core_get_current_call(LC);
if (call && linphone_call_params_video_enabled(linphone_call_get_current_params(call))) {
LinphoneCallAppData *callData = (__bridge LinphoneCallAppData *)linphone_call_get_user_pointer(call);
if (callData != nil) {
@ -740,7 +704,7 @@ static RootViewManager *rootViewManagerInstance = nil;
linphone_call_params_copy(linphone_call_get_current_params(call));
// stop video
linphone_call_params_enable_video(paramsCopy, FALSE);
linphone_core_update_call([LinphoneManager getLc], call, paramsCopy);
linphone_core_update_call(LC, call, paramsCopy);
}];
[sheet showInView:self.view];
callData->batteryWarningShown = TRUE;
@ -759,11 +723,11 @@ static RootViewManager *rootViewManagerInstance = nil;
}
- (void)incomingCallAccepted:(LinphoneCall *)call evenWithVideo:(BOOL)video {
[[LinphoneManager instance] acceptCall:call evenWithVideo:video];
[LinphoneManager.instance acceptCall:call evenWithVideo:video];
}
- (void)incomingCallDeclined:(LinphoneCall *)call {
linphone_core_terminate_call([LinphoneManager getLc], call);
linphone_core_terminate_call(LC, call);
}
@end

View file

@ -161,7 +161,7 @@
}
// Start notification after animation of DCRoundSwitch
dispatch_async(dispatch_get_main_queue(), ^{
[[NSNotificationCenter defaultCenter]
[NSNotificationCenter.defaultCenter
postNotificationName:kIASKAppSettingChanged
object:[toggle key]
userInfo:[NSDictionary dictionaryWithObject:[self.settingsStore objectForKey:[toggle key]]
@ -282,6 +282,13 @@ INIT_WITH_COMMON_CF {
}
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated {
// when device is slow and you are typing an item too much, a crash may happen
// because we try to push the same view multiple times - in that case we should
// do nothing but wait for device to respond again.
if (self.navigationController.topViewController == viewController) {
return;
}
[UINavigationControllerEx removeBackground:viewController.view];
[viewController view]; // Force view
@ -361,10 +368,10 @@ static UICompositeViewDescription *compositeDescription = nil;
[super viewWillDisappear:animated];
[_settingsController dismiss:self];
// Set observer
[[NSNotificationCenter defaultCenter] removeObserver:self name:kIASKAppSettingChanged object:nil];
[NSNotificationCenter.defaultCenter removeObserver:self name:kIASKAppSettingChanged object:nil];
if (linphone_ringtoneplayer_is_started(linphone_core_get_ringtoneplayer([LinphoneManager getLc]))) {
linphone_core_stop_ringing([LinphoneManager getLc]);
if (linphone_ringtoneplayer_is_started(linphone_core_get_ringtoneplayer(LC))) {
linphone_core_stop_ringing(LC);
}
}
@ -376,10 +383,10 @@ static UICompositeViewDescription *compositeDescription = nil;
[self recomputeAccountLabelsAndSync];
// Set observer
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(appSettingChanged:)
name:kIASKAppSettingChanged
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(appSettingChanged:)
name:kIASKAppSettingChanged
object:nil];
}
#pragma mark - Event Functions
@ -407,7 +414,7 @@ static UICompositeViewDescription *compositeDescription = nil;
removeFromHiddenKeys = debugEnabled;
[keys addObject:@"send_logs_button"];
[keys addObject:@"reset_logs_button"];
[[LinphoneManager instance] setLogsEnabled:debugEnabled];
[Log enableLogs:debugEnabled];
} else if ([@"account_mandatory_advanced_preference" compare:notif.object] == NSOrderedSame) {
removeFromHiddenKeys = [[notif.userInfo objectForKey:@"account_mandatory_advanced_preference"] boolValue];
for (NSString *key in settingsStore->dict) {
@ -435,7 +442,7 @@ static UICompositeViewDescription *compositeDescription = nil;
#pragma mark -
+ (IASKSpecifier *)filterSpecifier:(IASKSpecifier *)specifier {
if (!linphone_core_sip_transport_supported([LinphoneManager getLc], LinphoneTransportTls)) {
if (!linphone_core_sip_transport_supported(LC, LinphoneTransportTls)) {
if ([[specifier key] isEqualToString:@"account_transport_preference"]) {
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:[specifier specifierDict]];
NSMutableArray *titles = [NSMutableArray arrayWithArray:[dict objectForKey:@"Titles"]];
@ -449,7 +456,7 @@ static UICompositeViewDescription *compositeDescription = nil;
} else {
if ([[specifier key] isEqualToString:@"media_encryption_preference"]) {
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:[specifier specifierDict]];
if (!linphone_core_media_encryption_supported([LinphoneManager getLc], LinphoneMediaEncryptionZRTP)) {
if (!linphone_core_media_encryption_supported(LC, LinphoneMediaEncryptionZRTP)) {
NSMutableArray *titles = [NSMutableArray arrayWithArray:[dict objectForKey:@"Titles"]];
[titles removeObject:@"ZRTP"];
[dict setObject:titles forKey:@"Titles"];
@ -457,7 +464,7 @@ static UICompositeViewDescription *compositeDescription = nil;
[values removeObject:@"ZRTP"];
[dict setObject:values forKey:@"Values"];
}
if (!linphone_core_media_encryption_supported([LinphoneManager getLc], LinphoneMediaEncryptionSRTP)) {
if (!linphone_core_media_encryption_supported(LC, LinphoneMediaEncryptionSRTP)) {
NSMutableArray *titles = [NSMutableArray arrayWithArray:[dict objectForKey:@"Titles"]];
[titles removeObject:@"SRTP"];
[dict setObject:titles forKey:@"Titles"];
@ -465,7 +472,7 @@ static UICompositeViewDescription *compositeDescription = nil;
[values removeObject:@"SRTP"];
[dict setObject:values forKey:@"Values"];
}
if (!linphone_core_media_encryption_supported([LinphoneManager getLc], LinphoneMediaEncryptionDTLS)) {
if (!linphone_core_media_encryption_supported(LC, LinphoneMediaEncryptionDTLS)) {
NSMutableArray *titles = [NSMutableArray arrayWithArray:[dict objectForKey:@"Titles"]];
[titles removeObject:@"DTLS"];
[dict setObject:titles forKey:@"Titles"];
@ -478,7 +485,7 @@ static UICompositeViewDescription *compositeDescription = nil;
}
if ([specifier.key hasPrefix:@"menu_account_"]) {
const MSList *accounts = linphone_core_get_proxy_config_list([LinphoneManager getLc]);
const MSList *accounts = linphone_core_get_proxy_config_list(LC);
int index = [specifier.key substringFromIndex:@"menu_account_".length].intValue - 1;
if (index < ms_list_size(accounts)) {
LinphoneProxyConfig *proxy = (LinphoneProxyConfig *)ms_list_nth_data(accounts, index);
@ -492,15 +499,15 @@ static UICompositeViewDescription *compositeDescription = nil;
}
- (NSSet *)findHiddenKeys {
LinphoneManager *lm = [LinphoneManager instance];
LinphoneManager *lm = LinphoneManager.instance;
NSMutableSet *hiddenKeys = [NSMutableSet set];
const MSList *accounts = linphone_core_get_proxy_config_list([LinphoneManager getLc]);
const MSList *accounts = linphone_core_get_proxy_config_list(LC);
for (int i = ms_list_size(accounts) + 1; i <= 5; i++) {
[hiddenKeys addObject:[NSString stringWithFormat:@"menu_account_%d", i]];
}
if (!linphone_core_sip_transport_supported([LinphoneManager getLc], LinphoneTransportTls)) {
if (!linphone_core_sip_transport_supported(LC, LinphoneTransportTls)) {
[hiddenKeys addObject:@"media_encryption_preference"];
}
@ -513,7 +520,7 @@ static UICompositeViewDescription *compositeDescription = nil;
[hiddenKeys addObject:@"flush_images_button"];
#endif
if (![[LinphoneManager instance] lpConfigBoolForKey:@"debugenable_preference"]) {
if (![LinphoneManager.instance lpConfigBoolForKey:@"debugenable_preference"]) {
[hiddenKeys addObject:@"send_logs_button"];
[hiddenKeys addObject:@"reset_logs_button"];
}
@ -528,10 +535,7 @@ static UICompositeViewDescription *compositeDescription = nil;
[hiddenKeys addObject:@"wifi_only_preference"];
[hiddenKeys addObject:@"quit_button"]; // Hide for the moment
[hiddenKeys addObject:@"about_button"]; // Hide for the moment
if (!linphone_core_video_supported([LinphoneManager getLc])) {
if (!linphone_core_video_supported(LC)) {
[hiddenKeys addObject:@"video_menu"];
}
@ -557,16 +561,15 @@ static UICompositeViewDescription *compositeDescription = nil;
[hiddenKeys addObject:@"enable_first_login_view_preference"];
if (!linphone_core_video_supported([LinphoneManager getLc])) {
if (!linphone_core_video_supported(LC)) {
[hiddenKeys addObject:@"enable_video_preference"];
}
if (!linphone_core_video_display_enabled([LinphoneManager getLc])) {
if (!linphone_core_video_display_enabled(LC)) {
[hiddenKeys addObject:@"video_menu"];
}
if (!linphone_core_get_video_preset([LinphoneManager getLc]) ||
strcmp(linphone_core_get_video_preset([LinphoneManager getLc]), "custom") != 0) {
if (!linphone_core_get_video_preset(LC) || strcmp(linphone_core_get_video_preset(LC), "custom") != 0) {
[hiddenKeys addObject:@"video_preferred_fps_preference"];
[hiddenKeys addObject:@"download_bandwidth_preference"];
}
@ -578,7 +581,7 @@ static UICompositeViewDescription *compositeDescription = nil;
[hiddenKeys addObject:@"port_preference"];
}
if (linphone_core_get_stun_server([LinphoneManager getLc]) == NULL) {
if (linphone_core_get_stun_server(LC) == NULL) {
[hiddenKeys addObject:@"ice_preference"];
}
@ -605,7 +608,7 @@ static UICompositeViewDescription *compositeDescription = nil;
}
}
if (![[[LinphoneManager instance] iapManager] enabled]) {
if (![[LinphoneManager.instance iapManager] enabled]) {
[hiddenKeys addObject:@"in_app_products_button"];
}
@ -654,7 +657,7 @@ static UICompositeViewDescription *compositeDescription = nil;
if ([key isEqual:@"release_button"]) {
[UIApplication sharedApplication].keyWindow.rootViewController = nil;
[[UIApplication sharedApplication].keyWindow setRootViewController:nil];
[[LinphoneManager instance] destroyLinphoneCore];
[LinphoneManager.instance destroyLinphoneCore];
[LinphoneManager instanceRelease];
} else if ([key isEqual:@"clear_cache_button"]) {
[PhoneMainView.instance.mainViewController
@ -662,10 +665,9 @@ static UICompositeViewDescription *compositeDescription = nil;
} else if ([key isEqual:@"battery_alert_button"]) {
[[UIDevice currentDevice] _setBatteryState:UIDeviceBatteryStateUnplugged];
[[UIDevice currentDevice] _setBatteryLevel:0.01f];
[[NSNotificationCenter defaultCenter] postNotificationName:UIDeviceBatteryLevelDidChangeNotification
object:self];
[NSNotificationCenter.defaultCenter postNotificationName:UIDeviceBatteryLevelDidChangeNotification object:self];
} else if ([key isEqual:@"flush_images_button"]) {
const MSList *rooms = linphone_core_get_chat_rooms([LinphoneManager getLc]);
const MSList *rooms = linphone_core_get_chat_rooms(LC);
while (rooms) {
const MSList *messages = linphone_chat_room_get_history(rooms->data, 0);
while (messages) {
@ -695,8 +697,6 @@ static UICompositeViewDescription *compositeDescription = nil;
[_settingsController.navigationController popViewControllerAnimated:NO];
}];
[alert show];
} else if ([key isEqual:@"about_button"]) {
[PhoneMainView.instance changeCurrentView:AboutView.compositeViewDescription push:TRUE];
} else if ([key isEqual:@"reset_logs_button"]) {
linphone_core_reset_log_collection();
} else if ([key isEqual:@"send_logs_button"]) {
@ -821,9 +821,7 @@ static UICompositeViewDescription *compositeDescription = nil;
- (IBAction)onDialerBackClick:(id)sender {
[_settingsController.navigationController popViewControllerAnimated:NO];
DialerView *view = VIEW(DialerView);
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
[PhoneMainView.instance popToView:DialerView.compositeViewDescription];
}
- (IBAction)onBackClick:(id)sender {

View file

@ -39,24 +39,18 @@
addObject:[[SideMenuEntry alloc] initWithTitle:NSLocalizedString(@"Assistant", nil)
tapBlock:^() {
[PhoneMainView.instance
changeCurrentView:AssistantView.compositeViewDescription
push:NO
animated:NO];
changeCurrentView:AssistantView.compositeViewDescription];
}]];
[_sideMenuEntries
addObject:[[SideMenuEntry alloc] initWithTitle:NSLocalizedString(@"Settings", nil)
tapBlock:^() {
[PhoneMainView.instance
changeCurrentView:SettingsView.compositeViewDescription
push:NO
animated:NO];
changeCurrentView:SettingsView.compositeViewDescription];
}]];
[_sideMenuEntries addObject:[[SideMenuEntry alloc] initWithTitle:NSLocalizedString(@"About", nil)
tapBlock:^() {
[PhoneMainView.instance
changeCurrentView:AboutView.compositeViewDescription
push:NO
animated:NO];
changeCurrentView:AboutView.compositeViewDescription];
}]];
}
@ -68,10 +62,9 @@
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if (section == 0) {
BOOL hasDefault = (linphone_core_get_default_proxy_config([LinphoneManager getLc]) != NULL);
BOOL hasDefault = (linphone_core_get_default_proxy_config(LC) != NULL);
// default account is shown in the header already
return MAX(0,
ms_list_size(linphone_core_get_proxy_config_list([LinphoneManager getLc])) - (hasDefault ? 1 : 0));
return MAX(0, ms_list_size(linphone_core_get_proxy_config_list(LC)) - (hasDefault ? 1 : 0));
} else {
return [_sideMenuEntries count];
}
@ -80,8 +73,7 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [[UITableViewCell alloc] init];
if (indexPath.section == 0) {
LinphoneProxyConfig *proxy =
ms_list_nth_data(linphone_core_get_proxy_config_list([LinphoneManager getLc]), (int)indexPath.row);
LinphoneProxyConfig *proxy = ms_list_nth_data(linphone_core_get_proxy_config_list(LC), (int)indexPath.row);
if (proxy) {
cell.textLabel.text = [NSString stringWithUTF8String:linphone_proxy_config_get_identity(proxy)];
cell.imageView.image = [StatusBarView imageForState:linphone_proxy_config_get_state(proxy)];

View file

@ -26,10 +26,10 @@
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(registrationUpdateEvent:)
name:kLinphoneRegistrationUpdate
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(registrationUpdateEvent:)
name:kLinphoneRegistrationUpdate
object:nil];
[self updateHeader];
[_sideMenuTableViewController.tableView reloadData];
@ -47,7 +47,7 @@
}
- (void)updateHeader {
LinphoneProxyConfig *default_proxy = linphone_core_get_default_proxy_config([LinphoneManager getLc]);
LinphoneProxyConfig *default_proxy = linphone_core_get_default_proxy_config(LC);
if (default_proxy != NULL) {
const LinphoneAddress *addr = linphone_proxy_config_get_identity_address(default_proxy);

View file

@ -76,7 +76,7 @@ static void sync_address_book(ABAddressBookRef addressBook, CFDictionaryRef info
+ (NSString *)appendCountryCodeIfPossible:(NSString *)number {
if (![number hasPrefix:@"+"] && ![number hasPrefix:@"00"]) {
NSString *lCountryCode = [[LinphoneManager instance] lpConfigStringForKey:@"countrycode_preference"];
NSString *lCountryCode = [LinphoneManager.instance lpConfigStringForKey:@"countrycode_preference"];
if (lCountryCode && [lCountryCode length] > 0) {
// append country code
return [lCountryCode stringByAppendingString:number];
@ -90,7 +90,7 @@ static void sync_address_book(ABAddressBookRef addressBook, CFDictionaryRef info
address = [[address componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]
componentsJoinedByString:@" "];
NSString *normalizedSipAddress = nil;
LinphoneAddress *linphoneAddress = linphone_core_interpret_url([LinphoneManager getLc], [address UTF8String]);
LinphoneAddress *linphoneAddress = linphone_core_interpret_url(LC, [address UTF8String]);
if (linphoneAddress != NULL) {
char *tmp = linphone_address_as_string_uri_only(linphoneAddress);
if (tmp != NULL) {
@ -211,7 +211,7 @@ static void sync_address_book(ABAddressBookRef addressBook, CFDictionaryRef info
CFDictionaryRef lDict = ABMultiValueCopyValueAtIndex(lMap, i);
BOOL add = false;
if (CFDictionaryContainsKey(lDict, kABPersonInstantMessageServiceKey)) {
if (CFStringCompare((CFStringRef)[LinphoneManager instance].contactSipField,
if (CFStringCompare((CFStringRef)LinphoneManager.instance.contactSipField,
CFDictionaryGetValue(lDict, kABPersonInstantMessageServiceKey),
kCFCompareCaseInsensitive) == 0) {
add = true;
@ -237,7 +237,7 @@ static void sync_address_book(ABAddressBookRef addressBook, CFDictionaryRef info
}
CFRelease(lContacts);
}
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneAddressBookUpdate object:self];
[NSNotificationCenter.defaultCenter postNotificationName:kLinphoneAddressBookUpdate object:self];
}
void sync_address_book(ABAddressBookRef addressBook, CFDictionaryRef info, void *context) {
@ -273,14 +273,14 @@ void sync_address_book(ABAddressBookRef addressBook, CFDictionaryRef info, void
if (CFDictionaryContainsKey(lDict, kABPersonInstantMessageServiceKey)) {
CFStringRef serviceKey = CFDictionaryGetValue(lDict, kABPersonInstantMessageServiceKey);
if (CFStringCompare((CFStringRef)[LinphoneManager instance].contactSipField, serviceKey,
if (CFStringCompare((CFStringRef)LinphoneManager.instance.contactSipField, serviceKey,
kCFCompareCaseInsensitive) == 0) {
match = true;
}
} else if (domain != nil) {
// check domain
LinphoneAddress *address = linphone_address_new(
[(NSString *)CFDictionaryGetValue(lDict, kABPersonInstantMessageUsernameKey) UTF8String]);
LinphoneAddress *address = linphone_core_interpret_url(
LC, [(NSString *)CFDictionaryGetValue(lDict, kABPersonInstantMessageUsernameKey) UTF8String]);
if (address) {
const char *dom = linphone_address_get_domain(address);

View file

@ -22,7 +22,7 @@
}
+ (FileTransferDelegate *)messageDelegate:(LinphoneChatMessage *)message {
for (FileTransferDelegate *ftd in [[LinphoneManager instance] fileTransferDelegates]) {
for (FileTransferDelegate *ftd in [LinphoneManager.instance fileTransferDelegates]) {
if (ftd.message == message) {
return ftd;
}
@ -47,14 +47,13 @@ static void linphone_iphone_file_transfer_recv(LinphoneChatMessage *message, con
UIImage *image = [UIImage imageWithData:thiz.data];
CFBridgingRetain(thiz);
[[[LinphoneManager instance] fileTransferDelegates] removeObject:thiz];
[[LinphoneManager.instance fileTransferDelegates] removeObject:thiz];
// until image is properly saved, keep a reminder on it so that the
// chat bubble is aware of the fact that image is being saved to device
[LinphoneManager setValueInMessageAppData:@"saving..." forKey:@"localimage" inMessage:message];
[[LinphoneManager instance]
.photoLibrary
[LinphoneManager.instance.photoLibrary
writeImageToSavedPhotosAlbum:image.CGImage
orientation:(ALAssetOrientation)[image imageOrientation]
completionBlock:^(NSURL *assetURL, NSError *error) {
@ -75,7 +74,7 @@ static void linphone_iphone_file_transfer_recv(LinphoneChatMessage *message, con
inMessage:message];
}
thiz.message = NULL;
[[NSNotificationCenter defaultCenter]
[NSNotificationCenter.defaultCenter
postNotificationName:kLinphoneFileTransferRecvUpdate
object:thiz
userInfo:@{
@ -93,7 +92,7 @@ static void linphone_iphone_file_transfer_recv(LinphoneChatMessage *message, con
LOGD(@"Transfer of %s (%d bytes): already %ld sent, adding %ld", linphone_content_get_name(content),
linphone_content_get_size(content), [thiz.data length], size);
[thiz.data appendBytes:linphone_buffer_get_string_content(buffer) length:size];
[[NSNotificationCenter defaultCenter]
[NSNotificationCenter.defaultCenter
postNotificationName:kLinphoneFileTransferRecvUpdate
object:thiz
userInfo:@{
@ -116,9 +115,9 @@ static LinphoneBuffer *linphone_iphone_file_transfer_send(LinphoneChatMessage *m
}];
LOGD(@"Transfer of %s (%d bytes): already sent %ld (%f%%), remaining %ld", linphone_content_get_name(content),
total, offset, offset * 100.f / total, remaining);
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneFileTransferSendUpdate
object:thiz
userInfo:dict];
[NSNotificationCenter.defaultCenter postNotificationName:kLinphoneFileTransferSendUpdate
object:thiz
userInfo:dict];
LinphoneBuffer *buffer = NULL;
@try {
@ -172,7 +171,7 @@ static LinphoneBuffer *linphone_iphone_file_transfer_send(LinphoneChatMessage *m
}
- (BOOL)download:(LinphoneChatMessage *)message {
[[[LinphoneManager instance] fileTransferDelegates] addObject:self];
[[LinphoneManager.instance fileTransferDelegates] addObject:self];
_message = message;
@ -191,7 +190,7 @@ static LinphoneBuffer *linphone_iphone_file_transfer_send(LinphoneChatMessage *m
}
- (void)stopAndDestroy {
[[[LinphoneManager instance] fileTransferDelegates] removeObject:self];
[[LinphoneManager.instance fileTransferDelegates] removeObject:self];
if (_message != NULL) {
LinphoneChatMessage *msg = _message;
_message = NULL;
@ -203,7 +202,7 @@ static LinphoneBuffer *linphone_iphone_file_transfer_send(LinphoneChatMessage *m
linphone_chat_message_cancel_file_transfer(msg);
}
_data = nil;
LOGI(@"%p Destroying", self);
LOGD(@"%p Destroying", self);
}
- (void)cancel {

View file

@ -19,7 +19,7 @@
#import "Log.h"
@implementation LinphoneLogger
@implementation Log
+ (void)log:(OrtpLogLevel)severity file:(const char *)file line:(int)line format:(NSString *)format, ... {
va_list args;
@ -28,45 +28,67 @@
const char *utf8str = [str cStringUsingEncoding:NSString.defaultCStringEncoding];
int filesize = 20;
const char *filename = strchr(file, '/') ? strrchr(file, '/') + 1 : file;
if (severity <= ORTP_DEBUG) {
char levelC = 'U'; // undefined
if ((severity & ORTP_FATAL) != 0) {
levelC = 'F';
} else if ((severity & ORTP_ERROR) != 0) {
levelC = 'E';
} else if ((severity & ORTP_WARNING) != 0) {
levelC = 'W';
} else if ((severity & ORTP_MESSAGE) != 0) {
levelC = 'I';
} else if ((severity & ORTP_DEBUG) != 0) {
levelC = 'D';
}
if ((severity & ORTP_DEBUG) != 0) {
// lol: ortp_debug(XXX) can be disabled at compile time, but ortp_log(ORTP_DEBUG, xxx) will always be valid even
// not in debug build...
ortp_debug("%*s:%3d - %s", filesize, filename + MAX((int)strlen(filename) - filesize, 0), line, utf8str);
ortp_debug("%c %*s:%3d - %s", levelC, filesize, filename + MAX((int)strlen(filename) - filesize, 0), line,
utf8str);
} else {
ortp_log(severity, "%*s:%3d - %s", filesize, filename + MAX((int)strlen(filename) - filesize, 0), line,
utf8str);
// we want application logs to be always enabled (except debug ones) so use | ORTP_ERROR extra mask
ortp_log(severity | ORTP_ERROR, "%c %*s:%3d - %s", levelC, filesize,
filename + MAX((int)strlen(filename) - filesize, 0), line, utf8str);
}
va_end(args);
}
+ (void)enableLogs:(BOOL)enabled {
[LinphoneManager.instance lpConfigSetBool:enabled forKey:@"debugenable_preference"];
linphone_core_enable_logs_with_cb((OrtpLogFunc)linphone_iphone_log_handler);
if (enabled) {
NSLog(@"Enabling debug logs");
linphone_core_set_log_level(ORTP_DEBUG);
} else {
NSLog(@"Disabling debug logs");
linphone_core_set_log_level(ORTP_ERROR);
}
linphone_core_enable_log_collection(enabled);
}
#pragma mark - Logs Functions callbacks
void linphone_iphone_log_handler(int lev, const char *fmt, va_list args) {
NSString *format = [[NSString alloc] initWithUTF8String:fmt];
NSString *formatedString = [[NSString alloc] initWithFormat:format arguments:args];
char levelC = 'I';
switch ((OrtpLogLevel)lev) {
case ORTP_FATAL:
levelC = 'F';
break;
case ORTP_ERROR:
levelC = 'E';
break;
case ORTP_WARNING:
levelC = 'W';
break;
case ORTP_MESSAGE:
levelC = 'I';
break;
case ORTP_TRACE:
case ORTP_DEBUG:
levelC = 'D';
break;
case ORTP_LOGLEV_END:
return;
NSString *lvl = @"";
if ((lev & APP_LVL) == 0) {
if ((lev & ORTP_FATAL) != 0) {
lvl = @"F ";
} else if ((lev & ORTP_ERROR) != 0) {
lvl = @"E ";
} else if ((lev & ORTP_WARNING) != 0) {
lvl = @"W ";
} else if ((lev & ORTP_MESSAGE) != 0) {
lvl = @"I ";
} else if (((lev & ORTP_TRACE) != 0) || ((lev & ORTP_DEBUG) != 0)) {
lvl = @"D ";
}
}
// since \r are interpreted like \n, avoid double new lines when logging packets
NSLog(@"%c %@", levelC, [formatedString stringByReplacingOccurrencesOfString:@"\r\n" withString:@"\n"]);
// since \r are interpreted like \n, avoid double new lines when logging network packets (belle-sip)
NSLog(@"%@%@", lvl, [formatedString stringByReplacingOccurrencesOfString:@"\r\n" withString:@"\n"]);
}
@end

View file

@ -19,6 +19,10 @@
#import "LinphoneManager.h"
#define IPAD (LinphoneManager.runningOnIpad)
#define ANIMATED ([LinphoneManager.instance lpConfigBoolForKey:@"animations_preference"])
#define LC ([LinphoneManager getLc])
@interface LinphoneUtils : NSObject
+ (BOOL)findAndResignFirstResponder:(UIView*)view;

View file

@ -17,8 +17,6 @@ display_filter_auto_rotate=0
#contact_filter_on_default_domain=1
#use_phone_number=0
send_logs_include_linphonerc_and_chathistory=0
fallback_view=DialerView
unauthorized_views=FirstView
[assistant]
username_regex=^[a-z0-9_.\-]*$

View file

@ -150,22 +150,6 @@
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>Key</key>
<string>about_button</string>
<key>Title</key>
<string>About</string>
<key>Type</key>
<string>IASKButtonSpecifier</string>
</dict>
<dict>
<key>Key</key>
<string>quit_button</string>
<key>Title</key>
<string>Quit</string>
<key>Type</key>
<string>IASKButtonSpecifier</string>
</dict>
<dict>
<key>Key</key>
<string>release_button</string>

View file

@ -14,8 +14,6 @@
"Tunnel" = "Tunnel";
"Advanced" = "Advanced";
"Development debug actions" = "Development debug actions";
"About" = "About";
"Quit" = "Quit";
"Release core" = "Release core";
"Clear cache" = "Clear cache";
"Battery alert" = "Battery alert";

View file

@ -68,9 +68,7 @@
}
- (void)uploadImageWithQuality:(NSString *)quality {
UITableView *tv = [self findTableView:@"ChatRoom list"];
long messagesCount = [tv numberOfRowsInSection:0];
static int ind = 0;
[tester tapViewWithAccessibilityLabel:@"Send picture"];
[tester tapViewWithAccessibilityLabel:@"Photo library"];
// if popup "Linphone would access your photo" pops up, click OK.
@ -80,8 +78,11 @@
}
#endif
// select random photo to avoid having the same multiple times
[tester choosePhotoInAlbum:@"Camera Roll" atRow:2 column:2 + (messagesCount % 2)];
// select random photo to avoid having the same multiple times.
// There are 9 photos by default, so lets use just 8 (2 rows, 4 columns).
LOGI(@"Selecting photo at row %d, column %d", 1 + (ind / 4) % 2, 1 + ind % 4);
[tester choosePhotoInAlbum:@"Camera Roll" atRow:1 + (ind / 4) % 2 column:1 + ind % 4];
ind++;
// wait for the quality popup to show up
UIAccessibilityElement *element = nil;
@ -104,7 +105,7 @@
// wait for the upload to terminate...
for (int i = 0; i < 45; i++) {
[tester waitForTimeInterval:1.f];
if ([[[LinphoneManager instance] fileTransferDelegates] count] == 0)
if (LinphoneManager.instance.fileTransferDelegates.count == 0)
break;
}
[tester waitForViewWithAccessibilityLabel:@"Download"];

View file

@ -48,6 +48,7 @@
- (void)beforeEach {
[[LinphoneManager instance] lpConfigSetInt:NO forKey:@"animations_preference"];
linphone_core_set_log_level(ORTP_MESSAGE);
}
- (NSString *)me {
@ -104,8 +105,8 @@
linphone_core_clear_proxy_config(lc);
linphone_core_clear_all_auth_info(lc);
LinphoneAddress *testAddr = linphone_address_new(
[[NSString stringWithFormat:@"sip:%@@%@", [self me], [self accountDomain]] UTF8String]);
LinphoneAddress *testAddr = linphone_core_interpret_url(
LC, [[NSString stringWithFormat:@"sip:%@@%@", [self me], [self accountDomain]] UTF8String]);
linphone_address_set_header(testAddr, "X-Create-Account", "yes");
linphone_address_set_transport(testAddr, LinphoneTransportTcp);
linphone_address_set_port(testAddr, 0);

View file

@ -13,3 +13,6 @@
#import "UIToggleButton.h"
#import "UISpeakerButton.h"
#import "UIBluetoothButton.h"
#import "UIMicroButton.h"
#import "UIChatBubbleTextCell.h"

View file

@ -320,8 +320,10 @@ sdk:
\t\techo "[{archs}] Mixing `basename $$archive` in $$destpath"; \\
\t\tlipo -create $$all_paths -output $$destpath; \\
\tdone; \\
\techo 'NOTE: the following libraries were STUBBED:'; \\
\tcat WORK/ios-{first_arch}/Build/dummy_libraries/dummy_libraries.txt
\tif test -s WORK/ios-{first_arch}/Build/dummy_libraries/dummy_libraries.txt; then \\
\t\techo 'NOTE: the following libraries were STUBBED:'; \\
\t\tcat WORK/ios-{first_arch}/Build/dummy_libraries/dummy_libraries.txt; \\
\tfi
build: $(addsuffix -build, $(archs))
\t$(MAKE) sdk

1
submodules/externals/opencore-amr vendored Submodule

@ -0,0 +1 @@
Subproject commit cf4409e03ec56b1cd85a2f9532f58bc1fa9db274

@ -1 +1 @@
Subproject commit 3a75956fb2584cca84a95ba1fcbc72fa2c91f98d
Subproject commit 2610ab183249aee91862d2ad065f61db89107b34