add deliver_imdn to rc-factory

This commit is contained in:
Benjamin Reis 2017-04-18 15:42:09 +02:00
parent e6dd123ba5
commit e3660e8b45
3 changed files with 17 additions and 9 deletions

View file

@ -469,15 +469,7 @@
}
}
if (callId) {
int index = -1;
NSDictionary *dict = LinphoneManager.instance.pushDict;
if ([[dict allKeys] containsObject:callId]) {
index = [(NSNumber *)[LinphoneManager.instance.pushDict objectForKey:callId] intValue] + 1;
} else {
index = 1;
}
[LinphoneManager.instance.pushDict setValue:[NSNumber numberWithInt:index] forKey:callId];
if (callId && [self addLongTaskIDforCallID:callId]) {
if ([UIApplication sharedApplication].applicationState == UIApplicationStateBackground && loc_key &&
index > 0) {
if ([loc_key isEqualToString:@"IC_MSG"]) {
@ -492,6 +484,17 @@
LOGI(@"Notification %@ processed", userInfo.description);
}
- (BOOL)addLongTaskIDforCallID:(NSString *)callId {
NSDictionary *dict = LinphoneManager.instance.pushDict;
if ([[dict allKeys] indexOfObject:callId] != NSNotFound) {
return FALSE;
}
LOGI(@"Adding long running task for call id : %@ with index : 1", callId);
[dict setValue:[NSNumber numberWithInt:1] forKey:callId];
return TRUE;
}
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
LOGI(@"%@ : %@", NSStringFromSelector(_cmd), userInfo);

View file

@ -668,6 +668,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)];
int index = [(NSNumber *)[_pushDict objectForKey:callId] intValue] - 1;
LOGI(@"Decrementing index of long running task for call id : %@ with index : %d", callId, index);
[_pushDict setValue:[NSNumber numberWithInt:index] forKey:callId];
BOOL need_bg_task = FALSE;
for (NSString *key in [_pushDict allKeys]) {
@ -1190,6 +1191,7 @@ static void linphone_iphone_popup_password_request(LinphoneCore *lc, const char
NSString *remote_uri = [NSString stringWithUTF8String:c_address];
ms_free(c_address);
int index = [(NSNumber *)[_pushDict objectForKey:callID] intValue] - 1;
LOGI(@"Decrementing index of long running task for call id : %@ with index : %d", callID, index);
[_pushDict setValue:[NSNumber numberWithInt:index] forKey:callID];
BOOL need_bg_task = FALSE;
for (NSString *key in [_pushDict allKeys]) {
@ -1352,7 +1354,9 @@ static void linphone_iphone_message_received_unable_decrypt(LinphoneCore *lc, Li
LinphoneChatMessage *message) {
NSString *msgId = [NSString stringWithUTF8String:linphone_chat_message_get_custom_header(message, "Call-ID")];
int index = [(NSNumber *)[LinphoneManager.instance.pushDict objectForKey:msgId] intValue] - 1;
LOGI(@"Decrementing index of long running task for call id : %@ with index : %d", msgId, index);
[LinphoneManager.instance.pushDict setValue:[NSNumber numberWithInt:index] forKey:msgId];
BOOL need_bg_task = FALSE;
for (NSString *key in [LinphoneManager.instance.pushDict allKeys]) {

View file

@ -25,6 +25,7 @@ username_length=-1
sip_random_port=0
#whether SIP passwords must be encrypted in configuration storage file
store_ha1_passwd=0
deliver_imdn=1
[misc]
#by default it is set to 30 by liblinphone