mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 14:18:25 +00:00
update exosip and linphone, and use new call log apis.
This commit is contained in:
parent
402ff3da1b
commit
5a8f48fa5b
8 changed files with 31 additions and 43 deletions
|
|
@ -166,12 +166,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
return;
|
||||
}
|
||||
|
||||
LinphoneAddress* addr = NULL;
|
||||
if (callLog->dir == LinphoneCallIncoming) {
|
||||
addr = callLog->from;
|
||||
} else {
|
||||
addr = callLog->to;
|
||||
}
|
||||
LinphoneAddress* addr =linphone_call_log_get_remote_address(callLog);
|
||||
|
||||
UIImage *image = nil;
|
||||
NSString* address = nil;
|
||||
|
|
@ -220,12 +215,12 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
// State
|
||||
NSMutableString *state = [NSMutableString string];
|
||||
if (callLog->dir == LinphoneCallIncoming) {
|
||||
if (linphone_call_log_get_dir(callLog) == LinphoneCallIncoming) {
|
||||
[state setString:NSLocalizedString(@"Incoming call", nil)];
|
||||
} else {
|
||||
[state setString:NSLocalizedString(@"Outgoing call", nil)];
|
||||
}
|
||||
switch (callLog->status) {
|
||||
switch (linphone_call_log_get_status(callLog)) {
|
||||
case LinphoneCallSuccess:
|
||||
break;
|
||||
case LinphoneCallAborted:
|
||||
|
|
@ -241,11 +236,11 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
[typeLabel setText:state];
|
||||
|
||||
// Date
|
||||
NSDate *startData = [NSDate dateWithTimeIntervalSince1970:callLog->start_date_time];
|
||||
NSDate *startData = [NSDate dateWithTimeIntervalSince1970:linphone_call_log_get_start_date(callLog)];
|
||||
[dateLabel setText:[dateFormatter stringFromDate:startData]];
|
||||
|
||||
// Duration
|
||||
int duration = callLog->duration;
|
||||
int duration = linphone_call_log_get_duration(callLog);
|
||||
[durationLabel setText:[NSString stringWithFormat:@"%02i:%02i", (duration/60), duration - 60 * (duration / 60), nil]];
|
||||
|
||||
// contact name
|
||||
|
|
@ -288,12 +283,9 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
}
|
||||
|
||||
- (IBAction)onAddContactClick:(id)event {
|
||||
LinphoneAddress* addr = NULL;
|
||||
if (callLog->dir == LinphoneCallIncoming) {
|
||||
addr = callLog->from;
|
||||
} else {
|
||||
addr = callLog->to;
|
||||
}
|
||||
LinphoneAddress* addr;
|
||||
|
||||
addr=linphone_call_log_get_remote_address(callLog);
|
||||
if (addr != NULL) {
|
||||
char* lAddress = linphone_address_as_string_uri_only(addr);
|
||||
if(lAddress != NULL) {
|
||||
|
|
@ -311,11 +303,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
- (IBAction)onCallClick:(id)event {
|
||||
LinphoneAddress* addr;
|
||||
if (callLog->dir == LinphoneCallIncoming) {
|
||||
addr = callLog->from;
|
||||
} else {
|
||||
addr = callLog->to;
|
||||
}
|
||||
addr=linphone_call_log_get_remote_address(callLog);
|
||||
|
||||
char* lAddress = linphone_address_as_string_uri_only(addr);
|
||||
if(lAddress == NULL)
|
||||
|
|
@ -347,11 +335,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
- (IBAction)onMessageClick:(id)event {
|
||||
LinphoneAddress* addr;
|
||||
if (callLog->dir == LinphoneCallIncoming) {
|
||||
addr = callLog->from;
|
||||
} else {
|
||||
addr = callLog->to;
|
||||
}
|
||||
addr=linphone_call_log_get_remote_address(callLog);
|
||||
|
||||
char* lAddress = linphone_address_as_string_uri_only(addr);
|
||||
if(lAddress == NULL)
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@
|
|||
while(logs != NULL) {
|
||||
LinphoneCallLog* log = (LinphoneCallLog *) logs->data;
|
||||
if(missedFilter) {
|
||||
if (log->status == LinphoneCallMissed) {
|
||||
if (linphone_call_log_get_status(log) == LinphoneCallMissed) {
|
||||
[callLogs addObject:[NSValue valueWithPointer: log]];
|
||||
}
|
||||
} else {
|
||||
|
|
@ -129,10 +129,10 @@
|
|||
|
||||
LinphoneCallLog *callLog = [[callLogs objectAtIndex:[indexPath row]] pointerValue];
|
||||
LinphoneAddress* addr;
|
||||
if (callLog->dir == LinphoneCallIncoming) {
|
||||
addr = callLog->from;
|
||||
if (linphone_call_log_get_dir(callLog) == LinphoneCallIncoming) {
|
||||
addr = linphone_call_log_get_from(callLog);
|
||||
} else {
|
||||
addr = callLog->to;
|
||||
addr = linphone_call_log_get_to(callLog);
|
||||
}
|
||||
|
||||
NSString* displayName = nil;
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@
|
|||
const MSList * logs = linphone_core_get_call_logs([LinphoneManager getLc]);
|
||||
while(logs != NULL) {
|
||||
LinphoneCallLog* log = (LinphoneCallLog *) logs->data;
|
||||
if([callLog isEqualToString:[NSString stringWithUTF8String:log->call_id]]) {
|
||||
if([callLog isEqualToString:[NSString stringWithUTF8String:linphone_call_log_get_call_id(log)]]) {
|
||||
theLog = log;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -420,7 +420,11 @@ static void linphone_iphone_display_status(struct _LinphoneCore * lc, const char
|
|||
|
||||
/*should we reject this call ?*/
|
||||
if ([lCTCallCenter currentCalls]!=nil) {
|
||||
[LinphoneLogger logc:LinphoneLoggerLog format:"Mobile call ongoing... rejecting call from [%s]",linphone_address_get_username(linphone_call_get_call_log(call)->from)];
|
||||
char *tmp=linphone_call_get_remote_address_as_string(call);
|
||||
if (tmp) {
|
||||
[LinphoneLogger logc:LinphoneLoggerLog format:"Mobile call ongoing... rejecting call from [%s]",tmp];
|
||||
ms_free(tmp);
|
||||
}
|
||||
linphone_core_decline_call(theLinphoneCore, call,LinphoneReasonBusy);
|
||||
[lCTCallCenter release];
|
||||
return;
|
||||
|
|
@ -431,7 +435,7 @@ static void linphone_iphone_display_status(struct _LinphoneCore * lc, const char
|
|||
&& [UIApplication sharedApplication].applicationState != UIApplicationStateActive) {
|
||||
|
||||
LinphoneCallLog* callLog=linphone_call_get_call_log(call);
|
||||
NSString* callId=[NSString stringWithUTF8String:callLog->call_id];
|
||||
NSString* callId=[NSString stringWithUTF8String:linphone_call_log_get_call_id(callLog)];
|
||||
|
||||
if (![[LinphoneManager instance] shouldAutoAcceptCallForCallId:callId]){
|
||||
// case where a remote notification is not already received
|
||||
|
|
@ -475,12 +479,12 @@ static void linphone_iphone_display_status(struct _LinphoneCore * lc, const char
|
|||
[data->notification release];
|
||||
data->notification = nil;
|
||||
|
||||
if(log == NULL || log->status == LinphoneCallMissed) {
|
||||
if(log == NULL || linphone_call_log_get_status(log) == LinphoneCallMissed) {
|
||||
UILocalNotification *notification = [[UILocalNotification alloc] init];
|
||||
notification.repeatInterval = 0;
|
||||
notification.alertBody = [NSString stringWithFormat:NSLocalizedString(@"You miss %@ call", nil), address];
|
||||
notification.alertAction = NSLocalizedString(@"Show", nil);
|
||||
notification.userInfo = [NSDictionary dictionaryWithObject:[NSString stringWithUTF8String:log->call_id] forKey:@"callLog"];
|
||||
notification.userInfo = [NSDictionary dictionaryWithObject:[NSString stringWithUTF8String:linphone_call_log_get_call_id(log)] forKey:@"callLog"];
|
||||
[[UIApplication sharedApplication] presentLocalNotificationNow:notification];
|
||||
[notification release];
|
||||
}
|
||||
|
|
@ -936,7 +940,7 @@ static LinphoneCoreVTable linphonec_vtable = {
|
|||
}
|
||||
|
||||
static int comp_call_id(const LinphoneCall* call , const char *callid) {
|
||||
return strcmp(linphone_call_get_call_log(call)->call_id, callid);
|
||||
return strcmp(linphone_call_log_get_call_id(linphone_call_get_call_log(call)), callid);
|
||||
}
|
||||
|
||||
- (void)acceptCallForCallId:(NSString*)callid {
|
||||
|
|
|
|||
|
|
@ -102,16 +102,16 @@
|
|||
// Set up the cell...
|
||||
LinphoneAddress* addr;
|
||||
UIImage *image;
|
||||
if (callLog->dir == LinphoneCallIncoming) {
|
||||
if (callLog->status != LinphoneCallMissed) {
|
||||
if (linphone_call_log_get_dir(callLog) == LinphoneCallIncoming) {
|
||||
if (linphone_call_log_get_status(callLog) != LinphoneCallMissed) {
|
||||
image = [UIImage imageNamed:@"call_status_incoming.png"];
|
||||
} else {
|
||||
image = [UIImage imageNamed:@"call_status_missed.png"];
|
||||
}
|
||||
addr = callLog->from;
|
||||
addr = linphone_call_log_get_from(callLog);
|
||||
} else {
|
||||
image = [UIImage imageNamed:@"call_status_outgoing.png"];
|
||||
addr = callLog->to;
|
||||
addr = linphone_call_log_get_to(callLog);
|
||||
}
|
||||
|
||||
NSString* address = nil;
|
||||
|
|
|
|||
|
|
@ -553,7 +553,7 @@ static PhoneMainView* phoneMainViewInstance=nil;
|
|||
|
||||
- (void)displayIncomingCall:(LinphoneCall*) call{
|
||||
LinphoneCallLog* callLog=linphone_call_get_call_log(call);
|
||||
NSString* callId=[NSString stringWithUTF8String:callLog->call_id];
|
||||
NSString* callId=[NSString stringWithUTF8String:linphone_call_log_get_call_id(callLog)];
|
||||
|
||||
if (![[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)]
|
||||
|| [UIApplication sharedApplication].applicationState == UIApplicationStateActive) {
|
||||
|
|
|
|||
2
submodules/externals/exosip
vendored
2
submodules/externals/exosip
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit c76a9d4340f436d2f61f8b031d46bc511776b136
|
||||
Subproject commit ea5d692816953ac506464a53238f2103cda8cfee
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 3b722ada225c8adfcb19a0784f05288f8abfcada
|
||||
Subproject commit 2584c08c313799871cdef3926f311e9a673674e4
|
||||
Loading…
Add table
Reference in a new issue