Skip to content

Commit

Permalink
Merge pull request #489 from Accontech/VATRP-3707
Browse files Browse the repository at this point in the history
Vatrp 3707
  • Loading branch information
zackm0571 committed Apr 25, 2016
2 parents 8a83972 + 977a873 commit 4a389d8
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 39 deletions.
41 changes: 26 additions & 15 deletions Classes/Base.lproj/WizardViews.xib
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9532" systemVersion="14F27" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<customFonts key="customFonts">
<mutableArray key="Roboto-Bold.ttf">
Expand Down Expand Up @@ -37,7 +37,8 @@
<outlet property="scrollView" destination="rVh-9a-RgQ" id="Jzv-hQ-Qia"/>
<outlet property="selectProviderButton" destination="VMd-n8-XXH" id="wpd-B2-Cyn"/>
<outlet property="serviceSelectionView" destination="qd1-rV-ItA" id="4Yx-oF-cMm"/>
<outlet property="textFieldDomain" destination="iei-N7-fE8" id="4Sa-Zl-pUd"/>
<outlet property="textFieldDomain" destination="BvG-86-YI3" id="CBn-wk-EBB"/>
<outlet property="textFieldOutboundProxy" destination="iei-N7-fE8" id="WYp-zu-3jn"/>
<outlet property="textFieldPassword" destination="Rox-fw-ehE" id="9Ly-ZA-SjZ"/>
<outlet property="textFieldPort" destination="nkF-hH-kSy" id="FRK-u1-GXu"/>
<outlet property="textFieldUserId" destination="KcL-Pt-hqc" id="pvS-qw-O9X"/>
Expand Down Expand Up @@ -154,11 +155,11 @@
<point key="canvasLocation" x="550" y="1520"/>
</view>
<view contentMode="scaleToFill" id="pP8-hG-5oW" userLabel="welcomeView">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="602"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" id="rVh-9a-RgQ">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="602"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" flexibleMaxY="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="VMd-n8-XXH">
Expand Down Expand Up @@ -234,7 +235,7 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="AKH-yi-GFc">
<rect key="frame" x="35" y="476" width="250" height="35"/>
<rect key="frame" x="35" y="510" width="250" height="35"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<accessibility key="accessibilityConfiguration" label="Login Button"/>
Expand All @@ -248,7 +249,7 @@
</connections>
</button>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="qbP-aZ-7Sc">
<rect key="frame" x="160" y="517" width="90" height="30"/>
<rect key="frame" x="160" y="551" width="90" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
<fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="15"/>
<state key="normal" title="Register">
Expand All @@ -257,10 +258,10 @@
</state>
</button>
<view hidden="YES" contentMode="scaleToFill" id="rYQ-EI-hvy">
<rect key="frame" x="35" y="309" width="250" height="165"/>
<rect key="frame" x="35" y="309" width="250" height="200"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="line" placeholder="Domain" minimumFontSize="17" id="iei-N7-fE8">
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="line" placeholder="Domain" minimumFontSize="17" id="BvG-86-YI3">
<rect key="frame" x="0.0" y="0.0" width="250" height="34"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="0.25" colorSpace="calibratedRGB"/>
Expand All @@ -270,7 +271,7 @@
<textInputTraits key="textInputTraits"/>
</textField>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="line" placeholder="UserId" minimumFontSize="17" id="KcL-Pt-hqc">
<rect key="frame" x="0.0" y="123" width="250" height="34"/>
<rect key="frame" x="0.0" y="155" width="250" height="34"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="0.25" colorSpace="calibratedRGB"/>
<accessibility key="accessibilityConfiguration" label="User Id Field"/>
Expand All @@ -279,7 +280,7 @@
<textInputTraits key="textInputTraits"/>
</textField>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="line" placeholder="Domain" minimumFontSize="17" id="7G0-ul-TAs">
<rect key="frame" x="0.0" y="42" width="250" height="34"/>
<rect key="frame" x="0.0" y="77" width="250" height="34"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="0.25" colorSpace="calibratedRGB"/>
<accessibility key="accessibilityConfiguration" label="Protocol Dropdown"/>
Expand All @@ -288,31 +289,40 @@
<textInputTraits key="textInputTraits"/>
</textField>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="LJq-bF-XCT">
<rect key="frame" x="0.0" y="43" width="250" height="33"/>
<rect key="frame" x="0.0" y="78" width="250" height="33"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<connections>
<action selector="transportSelectionButtonTapped:" destination="-1" eventType="touchUpInside" id="nbH-bG-zWd"/>
</connections>
</button>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="line" placeholder="Port" minimumFontSize="17" id="nkF-hH-kSy">
<rect key="frame" x="0.0" y="84" width="250" height="34"/>
<rect key="frame" x="0.0" y="116" width="250" height="34"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="0.25" colorSpace="calibratedRGB"/>
<accessibility key="accessibilityConfiguration" label="Port Field"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="line" placeholder="Proxy" minimumFontSize="17" id="iei-N7-fE8">
<rect key="frame" x="0.0" y="38" width="250" height="34"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="0.25" colorSpace="calibratedRGB"/>
<accessibility key="accessibilityConfiguration" label="Domain Field"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
<view hidden="YES" contentMode="scaleToFill" id="j4W-1Z-naW">
<rect key="frame" x="160" y="519" width="1" height="25"/>
<rect key="frame" x="160" y="553" width="1" height="25"/>
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="xS4-al-Bgi">
<rect key="frame" x="71" y="517" width="90" height="30"/>
<rect key="frame" x="71" y="551" width="90" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="15"/>
<state key="normal" title="Forgot">
Expand Down Expand Up @@ -364,6 +374,7 @@
</scrollView>
</subviews>
<color key="backgroundColor" red="0.20000000300000001" green="0.20000000300000001" blue="0.20000000300000001" alpha="1" colorSpace="calibratedRGB"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="927" y="1520"/>
</view>
<view tag="171" contentMode="scaleToFill" id="33" userLabel="choiceView">
Expand Down
30 changes: 18 additions & 12 deletions Classes/LinphoneCoreSettingsStore.m
Original file line number Diff line number Diff line change
Expand Up @@ -195,19 +195,25 @@ - (void)transformLinphoneCoreToKeys {
if (addr) {
const char *proxy = linphone_proxy_config_get_addr(cfg);
LinphoneAddress *proxy_addr = linphone_address_new(proxy);
int port = linphone_address_get_port(proxy_addr);

// int port = linphone_address_get_port(proxy_addr);
[self setCString:linphone_address_get_username(addr) forKey:@"username_preference"];
[self setCString:linphone_address_get_domain(addr) forKey:@"domain_preference"];
if (strcmp(linphone_address_get_domain(addr), linphone_address_get_domain(proxy_addr)) != 0 ||
port > 0) {
char tmp[256] = {0};
if (port > 0) {
snprintf(tmp, sizeof(tmp) - 1, "%s:%i", linphone_address_get_domain(proxy_addr), port);
} else
snprintf(tmp, sizeof(tmp) - 1, "%s", linphone_address_get_domain(proxy_addr));
[self setCString:tmp forKey:@"proxy_preference"];
}

const char *rout = linphone_proxy_config_get_route(cfg);
NSString *routString = [NSString stringWithFormat:@"%s", rout];
NSString *trimmedSipRout = [routString substringFromIndex:@"sip:".length];
routString = [trimmedSipRout substringToIndex:[trimmedSipRout rangeOfString:@";"].location];
[self setCString:[routString UTF8String] forKey:@"proxy_preference"];
// if (strcmp(linphone_address_get_domain(addr), linphone_address_get_domain(proxy_addr)) != 0 ||
// port > 0) {
// char tmp[256] = {0};
// if (port > 0) {
// snprintf(tmp, sizeof(tmp) - 1, "%s:%i", linphone_address_get_domain(proxy_addr), port);
// } else
// snprintf(tmp, sizeof(tmp) - 1, "%s", linphone_address_get_domain(proxy_addr));
// [self setCString:tmp forKey:@"proxy_preference"];
// }
const char *tname = "tcp";
switch (linphone_address_get_transport(proxy_addr)) {
case LinphoneTransportTls:
Expand Down Expand Up @@ -245,7 +251,7 @@ - (void)transformLinphoneCoreToKeys {
[self setObject:@"" forKey:@"username_preference"];
[self setObject:@"" forKey:@"password_preference"];
[self setObject:@"" forKey:@"domain_preference"];
[self setObject:@"" forKey:@"proxy_preference"];
[self setObject:@"" forKey:@"proxy_preference"];
[self setCString:"tcp" forKey:@"transport_preference"];
[self setBool:FALSE forKey:@"outbound_proxy_preference"];
[self setBool:FALSE forKey:@"avpf_preference"];
Expand Down
1 change: 1 addition & 0 deletions Classes/WizardViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
@property (weak, nonatomic) IBOutlet UITextField *textFieldUsername;
@property (weak, nonatomic) IBOutlet UITextField *textFieldPassword;
@property (weak, nonatomic) IBOutlet UITextField *textFieldDomain;
@property (weak, nonatomic) IBOutlet UITextField *textFieldOutboundProxy;
@property (weak, nonatomic) IBOutlet UITextField *textFieldPort;
@property (weak, nonatomic) IBOutlet UITextField *textFieldUserId;

Expand Down
Loading

0 comments on commit 4a389d8

Please sign in to comment.