mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 02:58:07 +00:00
intermediary version
This commit is contained in:
parent
8b3946ce38
commit
fce7a0f297
10 changed files with 366 additions and 313 deletions
|
|
@ -21,7 +21,9 @@
|
|||
|
||||
|
||||
@interface CallHistoryTableViewController : GenericTabViewController {
|
||||
|
||||
UIButton* clear;
|
||||
}
|
||||
-(void) doAction:(id) sender;
|
||||
|
||||
@property (nonatomic, retain) IBOutlet UIButton* clear;
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
@implementation CallHistoryTableViewController
|
||||
|
||||
|
||||
@synthesize clear;
|
||||
|
||||
/*
|
||||
- (id)initWithStyle:(UITableViewStyle)style {
|
||||
|
|
@ -86,6 +86,12 @@
|
|||
}
|
||||
|
||||
|
||||
-(void) doAction:(id)sender {
|
||||
if (sender==clear) {
|
||||
linphone_core_clear_call_logs(myLinphoneCore);
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark Table view methods
|
||||
|
||||
|
|
@ -108,29 +114,40 @@
|
|||
|
||||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
|
||||
if (cell == nil) {
|
||||
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
|
||||
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
|
||||
|
||||
}
|
||||
|
||||
// Set up the cell...
|
||||
LinphoneCallLog* callLogs = ms_list_nth_data(linphone_core_get_call_logs(myLinphoneCore), indexPath.row) ;
|
||||
const char* username = linphone_address_get_username(callLogs->to)!=0?linphone_address_get_username(callLogs->to):"";
|
||||
|
||||
[cell.textLabel setText:[[NSString alloc] initWithCString:username encoding:[NSString defaultCStringEncoding]]];
|
||||
|
||||
LinphoneAddress* partyToDisplay;
|
||||
const MSList * logs = linphone_core_get_call_logs(myLinphoneCore);
|
||||
LinphoneCallLog* callLogs = ms_list_nth_data(logs, ms_list_size(logs)-indexPath.row-1) ;
|
||||
|
||||
NSString *path;
|
||||
|
||||
if (callLogs->dir == LinphoneCallIncoming) {
|
||||
path = [[NSBundle mainBundle] pathForResource:@"in_call" ofType:@"png"];
|
||||
partyToDisplay=callLogs->from;
|
||||
|
||||
} else {
|
||||
path = [[NSBundle mainBundle] pathForResource:@"out_call" ofType:@"png"];
|
||||
partyToDisplay=callLogs->to;
|
||||
|
||||
}
|
||||
UIImage *image = [UIImage imageWithContentsOfFile:path];
|
||||
cell.imageView.image = image;
|
||||
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
|
||||
|
||||
const char* username = linphone_address_get_username(partyToDisplay)!=0?linphone_address_get_username(partyToDisplay):"";
|
||||
const char* displayName = linphone_address_get_display_name(partyToDisplay);
|
||||
if (displayName) {
|
||||
[cell.textLabel setText:[[NSString alloc] initWithCString:displayName encoding:[NSString defaultCStringEncoding]]];
|
||||
[cell.detailTextLabel setText:[NSString stringWithFormat:@"%s"/* [%s]"*/,username/*,callLogs->start_date*/]];
|
||||
} else {
|
||||
[cell.textLabel setText:[[NSString alloc] initWithCString:username encoding:[NSString defaultCStringEncoding]]];
|
||||
}
|
||||
|
||||
|
||||
|
||||
return cell;
|
||||
}
|
||||
|
||||
|
|
@ -142,9 +159,22 @@
|
|||
// [anotherViewController release];
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:NO];
|
||||
|
||||
LinphoneCallLog* callLogs = ms_list_nth_data(linphone_core_get_call_logs(myLinphoneCore), indexPath.row) ;
|
||||
const char* username = linphone_address_get_username(callLogs->to)!=0?linphone_address_get_username(callLogs->to):"";
|
||||
[self.phoneControllerDelegate setPhoneNumber:[[NSString alloc] initWithCString:username encoding:[NSString defaultCStringEncoding]]];
|
||||
const MSList * logs = linphone_core_get_call_logs(myLinphoneCore);
|
||||
LinphoneCallLog* callLogs = ms_list_nth_data(logs, ms_list_size(logs)-indexPath.row-1) ;
|
||||
LinphoneAddress* partyToCall;
|
||||
if (callLogs->dir == LinphoneCallIncoming) {
|
||||
partyToCall=callLogs->from;
|
||||
|
||||
} else {
|
||||
partyToCall=callLogs->to;
|
||||
|
||||
}
|
||||
const char* username = linphone_address_get_username(partyToCall)!=0?linphone_address_get_username(partyToCall):"";
|
||||
const char* displayName = linphone_address_get_display_name(partyToCall)!=0?linphone_address_get_display_name(partyToCall):"";
|
||||
[self.phoneControllerDelegate
|
||||
setPhoneNumber:[[NSString alloc] initWithCString:username encoding:[NSString defaultCStringEncoding]]
|
||||
withDisplayName:[[NSString alloc] initWithCString:displayName encoding:[NSString defaultCStringEncoding]]];
|
||||
|
||||
[self.linphoneDelegate selectDialerTab];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -147,6 +147,23 @@
|
|||
</object>
|
||||
<int key="connectionID">11</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">clear</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="292237329"/>
|
||||
</object>
|
||||
<int key="connectionID">12</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchEventConnection" key="connection">
|
||||
<string key="label">doAction:</string>
|
||||
<reference key="source" ref="292237329"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
<int key="IBEventType">7</int>
|
||||
</object>
|
||||
<int key="connectionID">13</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<object class="NSArray" key="orderedObjects">
|
||||
|
|
@ -218,7 +235,7 @@
|
|||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>{{393, 486}, {320, 480}}</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>{{520, 620}, {320, 44}}</string>
|
||||
<string>{{625, 616}, {320, 44}}</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</object>
|
||||
|
|
@ -243,7 +260,7 @@
|
|||
</object>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">11</int>
|
||||
<int key="maxID">13</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
|
|
@ -251,6 +268,14 @@
|
|||
<object class="IBPartialClassDescription">
|
||||
<string key="className">CallHistoryTableViewController</string>
|
||||
<string key="superclassName">GenericTabViewController</string>
|
||||
<object class="NSMutableDictionary" key="actions">
|
||||
<string key="NS.key.0">doAction:</string>
|
||||
<string key="NS.object.0">id</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<string key="NS.key.0">clear</string>
|
||||
<string key="NS.object.0">UIButton</string>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">Classes/CallHistoryTableViewController.h</string>
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
//UI definition
|
||||
UITextField* address;
|
||||
UIButton* call;
|
||||
UIButton* hangup;
|
||||
|
||||
UILabel* status;
|
||||
|
||||
|
|
@ -61,6 +62,7 @@
|
|||
}
|
||||
@property (nonatomic, retain) IBOutlet UITextField* address;
|
||||
@property (nonatomic, retain) IBOutlet UIButton* call;
|
||||
@property (nonatomic, retain) IBOutlet UIButton* hangup;
|
||||
@property (nonatomic, retain) IBOutlet UILabel* status;
|
||||
|
||||
@property (nonatomic, retain) IBOutlet UIButton* one;
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
@implementation PhoneViewController
|
||||
@synthesize address ;
|
||||
@synthesize call;
|
||||
@synthesize hangup;
|
||||
@synthesize status;
|
||||
|
||||
@synthesize one;
|
||||
|
|
@ -72,8 +73,9 @@
|
|||
, &audioRouteOverride);
|
||||
|
||||
|
||||
} else if (sender == hangup) {
|
||||
linphone_core_terminate_call(mCore,NULL);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//implements keypad behavior
|
||||
|
|
@ -85,6 +87,7 @@
|
|||
[address setText:@""];
|
||||
}
|
||||
NSString* newAddress = nil;
|
||||
|
||||
if (sender == one) {
|
||||
newAddress = [address.text stringByAppendingString:@"1"];
|
||||
} else if (sender == two) {
|
||||
|
|
@ -122,6 +125,35 @@
|
|||
if (newAddress != nil) {
|
||||
[address setText:newAddress];
|
||||
}
|
||||
} else {
|
||||
//incall behavior
|
||||
if (sender == one) {
|
||||
linphone_core_send_dtmf(mCore,'1');
|
||||
} else if (sender == two) {
|
||||
linphone_core_send_dtmf(mCore,'2');
|
||||
} else if (sender == three) {
|
||||
linphone_core_send_dtmf(mCore,'3');
|
||||
} else if (sender == four) {
|
||||
linphone_core_send_dtmf(mCore,'4');
|
||||
} else if (sender == five) {
|
||||
linphone_core_send_dtmf(mCore,'5');
|
||||
} else if (sender == six) {
|
||||
linphone_core_send_dtmf(mCore,'6');
|
||||
} else if (sender == seven) {
|
||||
linphone_core_send_dtmf(mCore,'7');
|
||||
} else if (sender == eight) {
|
||||
linphone_core_send_dtmf(mCore,'8');
|
||||
} else if (sender == nine) {
|
||||
linphone_core_send_dtmf(mCore,'9');
|
||||
} else if (sender == star) {
|
||||
linphone_core_send_dtmf(mCore,'*');
|
||||
} else if (sender == zero) {
|
||||
linphone_core_send_dtmf(mCore,'0');
|
||||
} else if (sender == hash) {
|
||||
linphone_core_send_dtmf(mCore,'#');
|
||||
} else if (sender == hangup) {
|
||||
linphone_core_terminate_call(mCore,NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -242,8 +274,6 @@
|
|||
switch (state->new_state) {
|
||||
case GSTATE_CALL_IN_INVITE:
|
||||
case GSTATE_CALL_OUT_INVITE: {
|
||||
//[myIncallViewController startCall];
|
||||
[self presentModalViewController: myIncallViewController animated:true];
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -265,13 +295,10 @@
|
|||
break;
|
||||
case GSTATE_CALL_IN_CONNECTED:
|
||||
case GSTATE_CALL_OUT_CONNECTED: {
|
||||
[myIncallViewController startCall];
|
||||
break;
|
||||
}
|
||||
|
||||
case GSTATE_CALL_END: {
|
||||
//end off call, just dismiss Incall view
|
||||
[self dismissIncallView];
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
<string key="IBDocument.HIToolboxVersion">353.00</string>
|
||||
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<integer value="42"/>
|
||||
<integer value="80"/>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
|
|
@ -40,36 +40,23 @@
|
|||
<object class="IBUIView" id="116730630">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBUITextField" id="751637181">
|
||||
<reference key="NSNextResponder" ref="116730630"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{0, 20}, {227, 31}}</string>
|
||||
<reference key="NSSuperview" ref="116730630"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<string key="IBUIText"/>
|
||||
<int key="IBUIBorderStyle">3</int>
|
||||
<string key="IBUIPlaceholder">sip:</string>
|
||||
<object class="NSColor" key="IBUITextColor">
|
||||
<string key="NSFrame">{{18, -6}, {282, 49}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MAA</bytes>
|
||||
<bytes key="NSWhite">MSAwAA</bytes>
|
||||
<object class="NSColorSpace" key="NSCustomColorSpace" id="146567718">
|
||||
<int key="NSID">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<bool key="IBUIAdjustsFontSizeToFit">YES</bool>
|
||||
<float key="IBUIMinimumFontSize">1.700000e+01</float>
|
||||
<object class="IBUITextInputTraits" key="IBUITextInputTraits"/>
|
||||
<int key="IBUIClearButtonMode">3</int>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
</object>
|
||||
<object class="IBUIButton" id="534103685">
|
||||
<reference key="NSNextResponder" ref="116730630"/>
|
||||
<object class="IBUIButton" id="661303162">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{231, 20}, {51, 32}}</string>
|
||||
<reference key="NSSuperview" ref="116730630"/>
|
||||
<string key="NSFrame">{{0, 331}, {160, 60}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
<int key="IBUIContentHorizontalAlignment">0</int>
|
||||
|
|
@ -80,7 +67,6 @@
|
|||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
<int key="IBUIButtonType">1</int>
|
||||
<string type="base64-UTF8" key="IBUINormalTitle">PC0gA</string>
|
||||
<object class="NSColor" key="IBUIHighlightedTitleColor" id="923326808">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MQA</bytes>
|
||||
|
|
@ -93,34 +79,6 @@
|
|||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC41AA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrame">{{18, -6}, {282, 63}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MSAwAA</bytes>
|
||||
<reference key="NSCustomColorSpace" ref="146567718"/>
|
||||
</object>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
</object>
|
||||
<object class="IBUIButton" id="661303162">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{21, 312}, {72, 59}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
<int key="IBUIContentHorizontalAlignment">0</int>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<reference key="IBUIFont" ref="551268947"/>
|
||||
<reference key="IBUIHighlightedTitleColor" ref="923326808"/>
|
||||
<object class="NSColor" key="IBUINormalTitleColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA</bytes>
|
||||
</object>
|
||||
<reference key="IBUINormalTitleShadowColor" ref="177190558"/>
|
||||
<object class="NSCustomResource" key="IBUINormalImage">
|
||||
<string key="NSClassName">NSImage</string>
|
||||
<string key="NSResourceName">green.png</string>
|
||||
|
|
@ -129,7 +87,7 @@
|
|||
<object class="IBUILabel" id="729745965">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{0, 379}, {312, 21}}</string>
|
||||
<string key="NSFrame">{{9, 389}, {304, 21}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
|
|
@ -146,7 +104,7 @@
|
|||
<object class="IBUIButton" id="1070392235">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{217, 65}, {83, 51}}</string>
|
||||
<string key="NSFrame">{{213, 89}, {107, 60}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
|
|
@ -165,7 +123,7 @@
|
|||
<object class="IBUIButton" id="539158319">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{21, 124}, {83, 52}}</string>
|
||||
<string key="NSFrame">{{0, 149}, {107, 60}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
|
|
@ -184,7 +142,7 @@
|
|||
<object class="IBUIButton" id="539781036">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{120, 124}, {83, 52}}</string>
|
||||
<string key="NSFrame">{{107, 149}, {106, 60}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
|
|
@ -203,7 +161,7 @@
|
|||
<object class="IBUIButton" id="573280603">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{217, 124}, {83, 52}}</string>
|
||||
<string key="NSFrame">{{213, 149}, {107, 60}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
|
|
@ -222,7 +180,7 @@
|
|||
<object class="IBUIButton" id="150499342">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{21, 184}, {83, 52}}</string>
|
||||
<string key="NSFrame">{{0, 209}, {107, 60}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
|
|
@ -241,7 +199,7 @@
|
|||
<object class="IBUIButton" id="624378925">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{217, 184}, {83, 52}}</string>
|
||||
<string key="NSFrame">{{213, 209}, {107, 60}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
|
|
@ -260,7 +218,7 @@
|
|||
<object class="IBUIButton" id="607229252">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{120, 65}, {83, 51}}</string>
|
||||
<string key="NSFrame">{{107, 89}, {106, 60}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
|
|
@ -279,8 +237,12 @@
|
|||
<object class="IBUIButton" id="201618948">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{21, 65}, {83, 51}}</string>
|
||||
<string key="NSFrame">{{0, 89}, {107, 60}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MC40MDAwMDAwMSAxIDEgMAA</bytes>
|
||||
</object>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
<int key="IBUIContentHorizontalAlignment">0</int>
|
||||
|
|
@ -298,7 +260,7 @@
|
|||
<object class="IBUIButton" id="465571136">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{21, 244}, {83, 52}}</string>
|
||||
<string key="NSFrame">{{0, 269}, {107, 60}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
|
|
@ -317,7 +279,7 @@
|
|||
<object class="IBUIButton" id="602859574">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{120, 246}, {83, 52}}</string>
|
||||
<string key="NSFrame">{{107, 269}, {106, 60}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
|
|
@ -336,7 +298,7 @@
|
|||
<object class="IBUIButton" id="310945439">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{217, 244}, {83, 52}}</string>
|
||||
<string key="NSFrame">{{213, 269}, {107, 60}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
|
|
@ -352,23 +314,10 @@
|
|||
</object>
|
||||
<reference key="IBUINormalTitleShadowColor" ref="177190558"/>
|
||||
</object>
|
||||
<object class="IBUIImageView" id="1035087290">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{120, 306}, {175, 65}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<object class="NSCustomResource" key="IBUIImage">
|
||||
<string key="NSClassName">NSImage</string>
|
||||
<string key="NSResourceName">linphone.png</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUIButton" id="616388880">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{118, 186}, {83, 52}}</string>
|
||||
<string key="NSFrame">{{107, 209}, {106, 60}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
|
|
@ -384,12 +333,60 @@
|
|||
</object>
|
||||
<reference key="IBUINormalTitleShadowColor" ref="177190558"/>
|
||||
</object>
|
||||
<object class="IBUIButton" id="319430047">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{160, 333}, {160, 60}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
<int key="IBUIContentHorizontalAlignment">0</int>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<reference key="IBUIFont" ref="551268947"/>
|
||||
<int key="IBUIButtonType">1</int>
|
||||
<reference key="IBUIHighlightedTitleColor" ref="923326808"/>
|
||||
<object class="NSColor" key="IBUINormalTitleColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA</bytes>
|
||||
</object>
|
||||
<reference key="IBUINormalTitleShadowColor" ref="177190558"/>
|
||||
<object class="NSCustomResource" key="IBUINormalImage">
|
||||
<string key="NSClassName">NSImage</string>
|
||||
<string key="NSResourceName">red.png</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUITextField" id="751637181">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{20, 30}, {282, 31}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<string key="IBUIText"/>
|
||||
<int key="IBUIBorderStyle">3</int>
|
||||
<string key="IBUIPlaceholder">sip:</string>
|
||||
<object class="NSColor" key="IBUITextColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MAA</bytes>
|
||||
<reference key="NSCustomColorSpace" ref="146567718"/>
|
||||
</object>
|
||||
<object class="NSFont" key="IBUIFont">
|
||||
<string key="NSName">Helvetica</string>
|
||||
<double key="NSSize">1.800000e+01</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
<bool key="IBUIAdjustsFontSizeToFit">YES</bool>
|
||||
<float key="IBUIMinimumFontSize">1.700000e+01</float>
|
||||
<object class="IBUITextInputTraits" key="IBUITextInputTraits"/>
|
||||
<int key="IBUIClearButtonMode">3</int>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{320, 460}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MCAwLjUwMTk2MDgxIDEAA</bytes>
|
||||
<bytes key="NSRGB">MC45MDE5NjA3OSAwLjkwMTk2MDc5IDAuOTAxOTYwNzkAA</bytes>
|
||||
</object>
|
||||
<int key="IBUIContentMode">5</int>
|
||||
</object>
|
||||
|
|
@ -544,14 +541,6 @@
|
|||
</object>
|
||||
<int key="connectionID">54</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">back</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="534103685"/>
|
||||
</object>
|
||||
<int key="connectionID">83</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchEventConnection" key="connection">
|
||||
<string key="label">doKeyPad:</string>
|
||||
|
|
@ -670,13 +659,21 @@
|
|||
<int key="connectionID">98</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchEventConnection" key="connection">
|
||||
<string key="label">doKeyPad:</string>
|
||||
<reference key="source" ref="534103685"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
<int key="IBEventType">1</int>
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">hangup</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="319430047"/>
|
||||
</object>
|
||||
<int key="connectionID">106</int>
|
||||
<int key="connectionID">109</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchEventConnection" key="connection">
|
||||
<string key="label">doAction:</string>
|
||||
<reference key="source" ref="319430047"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
<int key="IBEventType">7</int>
|
||||
</object>
|
||||
<int key="connectionID">110</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
|
|
@ -715,30 +712,26 @@
|
|||
<reference key="object" ref="191373211"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="310945439"/>
|
||||
<reference ref="602859574"/>
|
||||
<reference ref="465571136"/>
|
||||
<reference ref="201618948"/>
|
||||
<reference ref="607229252"/>
|
||||
<reference ref="624378925"/>
|
||||
<reference ref="150499342"/>
|
||||
<reference ref="573280603"/>
|
||||
<reference ref="539781036"/>
|
||||
<reference ref="539158319"/>
|
||||
<reference ref="116730630"/>
|
||||
<reference ref="1070392235"/>
|
||||
<reference ref="539158319"/>
|
||||
<reference ref="539781036"/>
|
||||
<reference ref="573280603"/>
|
||||
<reference ref="150499342"/>
|
||||
<reference ref="624378925"/>
|
||||
<reference ref="607229252"/>
|
||||
<reference ref="201618948"/>
|
||||
<reference ref="602859574"/>
|
||||
<reference ref="310945439"/>
|
||||
<reference ref="616388880"/>
|
||||
<reference ref="729745965"/>
|
||||
<reference ref="661303162"/>
|
||||
<reference ref="616388880"/>
|
||||
<reference ref="116730630"/>
|
||||
<reference ref="1035087290"/>
|
||||
<reference ref="319430047"/>
|
||||
<reference ref="465571136"/>
|
||||
<reference ref="751637181"/>
|
||||
</object>
|
||||
<reference key="parent" ref="627403670"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">42</int>
|
||||
<reference key="object" ref="1035087290"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">41</int>
|
||||
<reference key="object" ref="310945439"/>
|
||||
|
|
@ -810,29 +803,26 @@
|
|||
<reference key="object" ref="116730630"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="751637181"/>
|
||||
<reference ref="534103685"/>
|
||||
</object>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
<string key="objectName">AddressView</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">4</int>
|
||||
<reference key="object" ref="751637181"/>
|
||||
<reference key="parent" ref="116730630"/>
|
||||
<string key="objectName">Address</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">81</int>
|
||||
<reference key="object" ref="534103685"/>
|
||||
<reference key="parent" ref="116730630"/>
|
||||
<string key="objectName">back</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">35</int>
|
||||
<reference key="object" ref="616388880"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">107</int>
|
||||
<reference key="object" ref="319430047"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">4</int>
|
||||
<reference key="object" ref="751637181"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
<string key="objectName">Address</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||
|
|
@ -843,7 +833,9 @@
|
|||
<string>-2.CustomClassName</string>
|
||||
<string>1.IBEditorWindowLastContentRect</string>
|
||||
<string>1.IBPluginDependency</string>
|
||||
<string>1.IBUserGuides</string>
|
||||
<string>104.IBPluginDependency</string>
|
||||
<string>107.IBPluginDependency</string>
|
||||
<string>29.IBPluginDependency</string>
|
||||
<string>30.IBPluginDependency</string>
|
||||
<string>31.IBPluginDependency</string>
|
||||
|
|
@ -857,12 +849,10 @@
|
|||
<string>4.IBPluginDependency</string>
|
||||
<string>40.IBPluginDependency</string>
|
||||
<string>41.IBPluginDependency</string>
|
||||
<string>42.IBPluginDependency</string>
|
||||
<string>5.IBPluginDependency</string>
|
||||
<string>7.IBPluginDependency</string>
|
||||
<string>80.IBEditorWindowLastContentRect</string>
|
||||
<string>80.IBPluginDependency</string>
|
||||
<string>81.IBPluginDependency</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
|
|
@ -870,6 +860,14 @@
|
|||
<string>UIResponder</string>
|
||||
<string>{{581, 299}, {320, 460}}</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<object class="NSMutableArray">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBUserGuide">
|
||||
<reference key="view" ref="191373211"/>
|
||||
<float key="location">4.100000e+02</float>
|
||||
<int key="affinity">1</int>
|
||||
</object>
|
||||
</object>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
|
|
@ -887,8 +885,7 @@
|
|||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>{{353, 469}, {320, 480}}</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>{{204, 440}, {320, 480}}</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</object>
|
||||
</object>
|
||||
|
|
@ -912,7 +909,7 @@
|
|||
</object>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">106</int>
|
||||
<int key="maxID">113</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
|
|
@ -945,6 +942,7 @@
|
|||
<string>eight</string>
|
||||
<string>five</string>
|
||||
<string>four</string>
|
||||
<string>hangup</string>
|
||||
<string>hash</string>
|
||||
<string>nine</string>
|
||||
<string>one</string>
|
||||
|
|
@ -970,6 +968,7 @@
|
|||
<string>UIButton</string>
|
||||
<string>UIButton</string>
|
||||
<string>UIButton</string>
|
||||
<string>UIButton</string>
|
||||
<string>UILabel</string>
|
||||
<string>UIButton</string>
|
||||
<string>UIButton</string>
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@
|
|||
@class IncallViewController;
|
||||
@class PhoneViewController;
|
||||
@class CallHistoryTableViewController;
|
||||
@class FavoriteTableViewController;
|
||||
|
||||
@interface linphoneAppDelegate : NSObject <UIApplicationDelegate,LinphoneTabManagerDelegate,UIActionSheetDelegate> {
|
||||
UIWindow *window;
|
||||
|
|
@ -41,11 +40,10 @@
|
|||
IBOutlet ABPeoplePickerNavigationController* myPeoplePickerController;
|
||||
IBOutlet PhoneViewController* myPhoneViewController;
|
||||
CallHistoryTableViewController* myCallHistoryTableViewController;
|
||||
FavoriteTableViewController* myFavoriteTableViewController;
|
||||
|
||||
ContactPickerDelegate* myContactPickerDelegate;
|
||||
|
||||
int traceLevel;
|
||||
bool isDebug;
|
||||
LinphoneCore* myLinphoneCore;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -89,11 +89,10 @@ LinphoneCoreVTable linphonec_vtable = {
|
|||
- (void)applicationDidFinishLaunching:(UIApplication *)application {
|
||||
|
||||
//as defined in PhoneMainView.xib
|
||||
#define DIALER_TAB_INDEX 2
|
||||
#define CONTACTS_TAB_INDEX 3
|
||||
#define HISTORY_TAB_INDEX 1
|
||||
#define FAVORITE_TAB_INDEX 0
|
||||
#define MORE_TAB_INDEX 4
|
||||
#define DIALER_TAB_INDEX 1
|
||||
#define CONTACTS_TAB_INDEX 2
|
||||
#define HISTORY_TAB_INDEX 0
|
||||
#define MORE_TAB_INDEX 3
|
||||
|
||||
|
||||
myPhoneViewController = (PhoneViewController*) [myTabBarController.viewControllers objectAtIndex: DIALER_TAB_INDEX];
|
||||
|
|
@ -102,9 +101,6 @@ LinphoneCoreVTable linphonec_vtable = {
|
|||
[myCallHistoryTableViewController setPhoneControllerDelegate:myPhoneViewController];
|
||||
[myCallHistoryTableViewController setLinphoneDelegate:self];
|
||||
|
||||
myFavoriteTableViewController = (FavoriteTableViewController*)[myTabBarController.viewControllers objectAtIndex: FAVORITE_TAB_INDEX];
|
||||
[myFavoriteTableViewController setPhoneControllerDelegate:myPhoneViewController];
|
||||
[myFavoriteTableViewController setLinphoneDelegate:self];
|
||||
|
||||
//people picker delegates
|
||||
myContactPickerDelegate = [[ContactPickerDelegate alloc] init];
|
||||
|
|
@ -130,7 +126,7 @@ LinphoneCoreVTable linphonec_vtable = {
|
|||
[self startlibLinphone];
|
||||
|
||||
[myCallHistoryTableViewController setLinphoneCore: myLinphoneCore];
|
||||
[myFavoriteTableViewController setLinphoneCore: myLinphoneCore];
|
||||
|
||||
[myPhoneViewController setLinphoneCore: myLinphoneCore];
|
||||
|
||||
|
||||
|
|
@ -160,14 +156,13 @@ LinphoneCoreVTable linphonec_vtable = {
|
|||
|
||||
//get default config from bundle
|
||||
NSBundle* myBundle = [NSBundle mainBundle];
|
||||
NSString* defaultConfigFile = [myBundle pathForResource:@"linphonerc"ofType:nil] ;
|
||||
#if TARGET_IPHONE_SIMULATOR
|
||||
NSDictionary *dictionary = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES] forKey:NSFileImmutable];
|
||||
[[NSFileManager defaultManager] setAttributes:dictionary ofItemAtPath:defaultConfigFile error:nil];
|
||||
#endif
|
||||
NSString* factoryConfig = [myBundle pathForResource:@"linphonerc"ofType:nil] ;
|
||||
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
||||
NSString *confiFileName = [[paths objectAtIndex:0] stringByAppendingString:@"/.linphonerc"];
|
||||
;
|
||||
//log management
|
||||
traceLevel = 9;
|
||||
if (traceLevel > 0) {
|
||||
isDebug = [[NSUserDefaults standardUserDefaults] boolForKey:@"debugenable_preference"];
|
||||
if (isDebug) {
|
||||
//redirect all traces to the iphone log framework
|
||||
linphone_core_enable_logs_with_cb(linphone_iphone_log_handler);
|
||||
}
|
||||
|
|
@ -182,7 +177,10 @@ LinphoneCoreVTable linphonec_vtable = {
|
|||
* Initialize linphone core
|
||||
*/
|
||||
|
||||
myLinphoneCore = linphone_core_new (&linphonec_vtable, [defaultConfigFile cStringUsingEncoding:[NSString defaultCStringEncoding]],nil,self);
|
||||
myLinphoneCore = linphone_core_new (&linphonec_vtable
|
||||
, [confiFileName cStringUsingEncoding:[NSString defaultCStringEncoding]]
|
||||
, [factoryConfig cStringUsingEncoding:[NSString defaultCStringEncoding]]
|
||||
,self);
|
||||
|
||||
// Set audio assets
|
||||
const char* lRing = [[myBundle pathForResource:@"oldphone-mono"ofType:@"wav"] cStringUsingEncoding:[NSString defaultCStringEncoding]];
|
||||
|
|
@ -192,34 +190,36 @@ LinphoneCoreVTable linphonec_vtable = {
|
|||
|
||||
|
||||
//configure sip account
|
||||
//get data from Settings bundle
|
||||
NSString* accountNameUri = [[NSUserDefaults standardUserDefaults] stringForKey:@"account_preference"];
|
||||
const char* identity = [accountNameUri cStringUsingEncoding:[NSString defaultCStringEncoding]];
|
||||
|
||||
//madatory parameters
|
||||
|
||||
NSString* username = [[NSUserDefaults standardUserDefaults] stringForKey:@"username_preference"];
|
||||
NSString* domain = [[NSUserDefaults standardUserDefaults] stringForKey:@"domain_preference"];
|
||||
NSString* accountPassword = [[NSUserDefaults standardUserDefaults] stringForKey:@"password_preference"];
|
||||
|
||||
if (username && [username length] >0 && domain && [domain length]>0) {
|
||||
|
||||
|
||||
const char* identity = [[NSString stringWithFormat:@"sip:%@@%@",username,domain] cStringUsingEncoding:[NSString defaultCStringEncoding]];
|
||||
const char* password = [accountPassword cStringUsingEncoding:[NSString defaultCStringEncoding]];
|
||||
|
||||
NSString* proxyUri = [[NSUserDefaults standardUserDefaults] stringForKey:@"proxy_preference"];
|
||||
const char* proxy = [proxyUri cStringUsingEncoding:[NSString defaultCStringEncoding]];
|
||||
NSString* proxyAddress = [[NSUserDefaults standardUserDefaults] stringForKey:@"proxy_preference"];
|
||||
if ((!proxyAddress | [proxyAddress length] <1 ) && domain) {
|
||||
proxyAddress = [NSString stringWithFormat:@"sip:%@",domain] ;
|
||||
} else {
|
||||
proxyAddress = [NSString stringWithFormat:@"sip:%@",proxyAddress] ;
|
||||
}
|
||||
|
||||
NSString* routeUri = [[NSUserDefaults standardUserDefaults] stringForKey:@"route_preference"];
|
||||
const char* route = [routeUri cStringUsingEncoding:[NSString defaultCStringEncoding]];
|
||||
const char* proxy = [proxyAddress cStringUsingEncoding:[NSString defaultCStringEncoding]];
|
||||
|
||||
if (([accountNameUri length] + [proxyUri length]) >8 ) {
|
||||
NSString* prefix = [[NSUserDefaults standardUserDefaults] stringForKey:@"prefix_preference"];
|
||||
//possible valid config detected
|
||||
LinphoneProxyConfig* proxyCfg;
|
||||
//clear auth info list
|
||||
linphone_core_clear_all_auth_info(myLinphoneCore);
|
||||
//get default proxy
|
||||
linphone_core_get_default_proxy(myLinphoneCore,&proxyCfg);
|
||||
boolean_t addProxy=false;
|
||||
if (proxyCfg == NULL) {
|
||||
//create new proxy
|
||||
//clear existing proxy config
|
||||
linphone_core_clear_proxy_config(myLinphoneCore);
|
||||
proxyCfg = linphone_proxy_config_new();
|
||||
addProxy = true;
|
||||
} else {
|
||||
linphone_proxy_config_edit(proxyCfg);
|
||||
}
|
||||
|
||||
// add username password
|
||||
osip_from_t *from;
|
||||
|
|
@ -234,20 +234,17 @@ LinphoneCoreVTable linphonec_vtable = {
|
|||
// configure proxy entries
|
||||
linphone_proxy_config_set_identity(proxyCfg,identity);
|
||||
linphone_proxy_config_set_server_addr(proxyCfg,proxy);
|
||||
if ([routeUri length] > 4) {
|
||||
linphone_proxy_config_set_route(proxyCfg,route);
|
||||
|
||||
if ([prefix length]>0) {
|
||||
linphone_proxy_config_set_dial_prefix(proxyCfg, [prefix cStringUsingEncoding:[NSString defaultCStringEncoding]]);
|
||||
}
|
||||
linphone_proxy_config_enable_register(proxyCfg,TRUE);
|
||||
if (addProxy) {
|
||||
linphone_proxy_config_set_dial_escape_plus(proxyCfg,TRUE);
|
||||
|
||||
linphone_proxy_config_enable_register(proxyCfg, TRUE);
|
||||
linphone_core_add_proxy_config(myLinphoneCore,proxyCfg);
|
||||
//set to default proxy
|
||||
linphone_core_set_default_proxy(myLinphoneCore,proxyCfg);
|
||||
} else {
|
||||
linphone_proxy_config_done(proxyCfg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Configure Codecs
|
||||
|
||||
PayloadType *pt;
|
||||
|
|
|
|||
|
|
@ -63,15 +63,6 @@
|
|||
</object>
|
||||
<object class="NSMutableArray" key="IBUIViewControllers">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBUIViewController" id="947197904">
|
||||
<object class="IBUITabBarItem" key="IBUITabBarItem" id="654208500">
|
||||
<string key="IBUITitle">Favorites</string>
|
||||
<reference key="IBUITabBar"/>
|
||||
</object>
|
||||
<reference key="IBUIParentViewController" ref="952473143"/>
|
||||
<string key="IBUINibName">FavoriteTableViewController</string>
|
||||
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
|
||||
</object>
|
||||
<object class="IBUIViewController" id="156830991">
|
||||
<string key="IBUITitle">History</string>
|
||||
<object class="IBUITabBarItem" key="IBUITabBarItem" id="1041279701">
|
||||
|
|
@ -180,7 +171,6 @@
|
|||
<reference ref="995238651"/>
|
||||
<reference ref="383050823"/>
|
||||
<reference ref="555899988"/>
|
||||
<reference ref="947197904"/>
|
||||
<reference ref="156830991"/>
|
||||
<reference ref="258574391"/>
|
||||
</object>
|
||||
|
|
@ -251,20 +241,6 @@
|
|||
<reference key="object" ref="534357631"/>
|
||||
<reference key="parent" ref="555899988"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">46</int>
|
||||
<reference key="object" ref="947197904"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="654208500"/>
|
||||
</object>
|
||||
<reference key="parent" ref="952473143"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">47</int>
|
||||
<reference key="object" ref="654208500"/>
|
||||
<reference key="parent" ref="947197904"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||
|
|
@ -287,8 +263,6 @@
|
|||
<string>41.CustomClassName</string>
|
||||
<string>41.IBPluginDependency</string>
|
||||
<string>43.IBPluginDependency</string>
|
||||
<string>46.CustomClassName</string>
|
||||
<string>46.IBPluginDependency</string>
|
||||
<string>8.IBEditorWindowLastContentRect</string>
|
||||
<string>8.IBPluginDependency</string>
|
||||
<string>9.IBPluginDependency</string>
|
||||
|
|
@ -319,8 +293,6 @@
|
|||
<string>CallHistoryTableViewController</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>FavoriteTableViewController</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>{{11, 205}, {320, 480}}</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
|
|
@ -359,31 +331,6 @@
|
|||
<string key="minorKey">Classes/CallHistoryTableViewController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">FavoriteTableViewController</string>
|
||||
<string key="superclassName">GenericTabViewController</string>
|
||||
<object class="NSMutableDictionary" key="actions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSMutableArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>doAddFavorite:</string>
|
||||
<string>doEditFavorite:</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<string key="NS.key.0">add</string>
|
||||
<string key="NS.object.0">UIButton</string>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">Classes/FavoriteTableViewController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">GenericTabViewController</string>
|
||||
<string key="superclassName">UITableViewController</string>
|
||||
|
|
@ -432,10 +379,10 @@
|
|||
<string>address</string>
|
||||
<string>back</string>
|
||||
<string>call</string>
|
||||
<string>cancel</string>
|
||||
<string>eight</string>
|
||||
<string>five</string>
|
||||
<string>four</string>
|
||||
<string>hangup</string>
|
||||
<string>hash</string>
|
||||
<string>nine</string>
|
||||
<string>one</string>
|
||||
|
|
|
|||
|
|
@ -16,11 +16,11 @@
|
|||
<key>Type</key>
|
||||
<string>PSTextFieldSpecifier</string>
|
||||
<key>Title</key>
|
||||
<string>sip identity</string>
|
||||
<string>User name</string>
|
||||
<key>Key</key>
|
||||
<string>account_preference</string>
|
||||
<string>username_preference</string>
|
||||
<key>DefaultValue</key>
|
||||
<string>sip:</string>
|
||||
<string></string>
|
||||
<key>IsSecure</key>
|
||||
<false/>
|
||||
<key>KeyboardType</key>
|
||||
|
|
@ -52,15 +52,15 @@
|
|||
<key>Type</key>
|
||||
<string>PSTextFieldSpecifier</string>
|
||||
<key>Title</key>
|
||||
<string>proxy</string>
|
||||
<string>Domain</string>
|
||||
<key>Key</key>
|
||||
<string>proxy_preference</string>
|
||||
<string>domain_preference</string>
|
||||
<key>DefaultValue</key>
|
||||
<string>sip:</string>
|
||||
<string></string>
|
||||
<key>IsSecure</key>
|
||||
<false/>
|
||||
<key>KeyboardType</key>
|
||||
<string>Alphabet</string>
|
||||
<string>URL</string>
|
||||
<key>AutocapitalizationType</key>
|
||||
<string>None</string>
|
||||
<key>AutocorrectionType</key>
|
||||
|
|
@ -70,15 +70,15 @@
|
|||
<key>Type</key>
|
||||
<string>PSTextFieldSpecifier</string>
|
||||
<key>Title</key>
|
||||
<string>route</string>
|
||||
<string>Proxy</string>
|
||||
<key>Key</key>
|
||||
<string>route_preference</string>
|
||||
<string>proxy_preference</string>
|
||||
<key>DefaultValue</key>
|
||||
<string>sip:</string>
|
||||
<string></string>
|
||||
<key>IsSecure</key>
|
||||
<false/>
|
||||
<key>KeyboardType</key>
|
||||
<string>Alphabet</string>
|
||||
<string>URL</string>
|
||||
<key>AutocapitalizationType</key>
|
||||
<string>None</string>
|
||||
<key>AutocorrectionType</key>
|
||||
|
|
@ -90,17 +90,18 @@
|
|||
<key>Title</key>
|
||||
<string>Codecs</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>TrueValue</key>
|
||||
<dict>
|
||||
<key>Type</key>
|
||||
<string>PSToggleSwitchSpecifier</string>
|
||||
<key>Title</key>
|
||||
<string>Speex 32Khz</string>
|
||||
<string>Speex 8Khz</string>
|
||||
<key>Key</key>
|
||||
<string>speex_32k_preference</string>
|
||||
<string>speex_8k_preference</string>
|
||||
<key>DefaultValue</key>
|
||||
<false/>
|
||||
<true/>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Type</key>
|
||||
<string>PSToggleSwitchSpecifier</string>
|
||||
<key>Title</key>
|
||||
|
|
@ -111,6 +112,17 @@
|
|||
<true/>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>TrueValue</key>
|
||||
<dict>
|
||||
<key>Type</key>
|
||||
<string>PSToggleSwitchSpecifier</string>
|
||||
<key>Title</key>
|
||||
<string>Speex 8Khz</string>
|
||||
<key>Key</key>
|
||||
<string>speex_8k_preference</string>
|
||||
<key>DefaultValue</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>Type</key>
|
||||
<string>PSToggleSwitchSpecifier</string>
|
||||
<key>Title</key>
|
||||
|
|
@ -124,27 +136,7 @@
|
|||
<key>Type</key>
|
||||
<string>PSToggleSwitchSpecifier</string>
|
||||
<key>Title</key>
|
||||
<string>GSM 22Khz</string>
|
||||
<key>Key</key>
|
||||
<string>gsm_22k_preference</string>
|
||||
<key>DefaultValue</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Type</key>
|
||||
<string>PSToggleSwitchSpecifier</string>
|
||||
<key>Title</key>
|
||||
<string>GSM 11Khz</string>
|
||||
<key>Key</key>
|
||||
<string>gsm_11k_preference</string>
|
||||
<key>DefaultValue</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Type</key>
|
||||
<string>PSToggleSwitchSpecifier</string>
|
||||
<key>Title</key>
|
||||
<string>GSM 8Khz</string>
|
||||
<string>GSM</string>
|
||||
<key>Key</key>
|
||||
<string>gsm_8k_preference</string>
|
||||
<key>DefaultValue</key>
|
||||
|
|
@ -158,7 +150,7 @@
|
|||
<key>Key</key>
|
||||
<string>pcmu_preference</string>
|
||||
<key>DefaultValue</key>
|
||||
<false/>
|
||||
<true/>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Type</key>
|
||||
|
|
@ -168,8 +160,42 @@
|
|||
<key>Key</key>
|
||||
<string>pcma_preference</string>
|
||||
<key>DefaultValue</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
<key>Title</key>
|
||||
<string>Advanced</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Type</key>
|
||||
<string>PSToggleSwitchSpecifier</string>
|
||||
<key>Title</key>
|
||||
<string>Debug</string>
|
||||
<key>Key</key>
|
||||
<string>debugenable_preference</string>
|
||||
<key>DefaultValue</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Type</key>
|
||||
<string>PSTextFieldSpecifier</string>
|
||||
<key>Title</key>
|
||||
<string>Prefix</string>
|
||||
<key>Key</key>
|
||||
<string>prefix_preference</string>
|
||||
<key>DefaultValue</key>
|
||||
<string></string>
|
||||
<key>IsSecure</key>
|
||||
<false/>
|
||||
<key>KeyboardType</key>
|
||||
<string>NumberPad</string>
|
||||
<key>AutocapitalizationType</key>
|
||||
<string>None</string>
|
||||
<key>AutocorrectionType</key>
|
||||
<string>No</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue