From 90632ba856744b28616ca840f47aafc3ee147a79 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Mon, 16 Oct 2017 17:10:50 +0200 Subject: [PATCH] migrate to new dialplan --- Classes/AssistantView.m | 14 +++++++------- Classes/CountryListView.m | 15 ++++++++------- submodules/belle-sip | 2 +- submodules/linphone | 2 +- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Classes/AssistantView.m b/Classes/AssistantView.m index 7c625dca5..3b91398ad 100644 --- a/Classes/AssistantView.m +++ b/Classes/AssistantView.m @@ -942,14 +942,14 @@ static UICompositeViewDescription *compositeDescription = nil; NSString *tmp_phone = [NSString stringWithUTF8String:linphone_account_creator_get_phone_number(account_creator)]; int ccc = -1; - LinphoneDialPlan dialplan = {0}; + const LinphoneDialPlan *dialplan = NULL; char *nationnal_significant_number = NULL; ccc = linphone_dial_plan_lookup_ccc_from_e164(tmp_phone.UTF8String); if (ccc > -1) { /*e164 like phone number*/ - dialplan = *linphone_dial_plan_by_ccc_as_int(ccc); - nationnal_significant_number = strstr(tmp_phone.UTF8String, dialplan.ccc); + dialplan = linphone_dial_plan_by_ccc_as_int(ccc); + nationnal_significant_number = strstr(tmp_phone.UTF8String, linphone_dial_plan_get_country_calling_code(dialplan)); if (nationnal_significant_number) { - nationnal_significant_number += strlen(dialplan.ccc); + nationnal_significant_number += strlen(linphone_dial_plan_get_country_calling_code(dialplan)); } } [self changeView:_linphoneLoginView back:FALSE animation:TRUE]; @@ -971,15 +971,15 @@ static UICompositeViewDescription *compositeDescription = nil; ofType:[UITextField class]]) .text = @""; linphone_account_creator_set_activation_code(account_creator, ""); - if (dialplan.iso_country_code) { + if (linphone_dial_plan_get_iso_country_code(dialplan)) { NSDictionary *country = [CountryListView - countryWithIso:[NSString stringWithUTF8String:dialplan.iso_country_code]]; + countryWithIso:[NSString stringWithUTF8String:linphone_dial_plan_get_iso_country_code(dialplan)]]; [self didSelectCountry:country]; } // Reset phone number in account_creator to be sure to let the user retry if (nationnal_significant_number) { linphone_account_creator_set_phone_number(account_creator, nationnal_significant_number, - dialplan.ccc); + linphone_dial_plan_get_country_calling_code(dialplan)); } }]; diff --git a/Classes/CountryListView.m b/Classes/CountryListView.m index 6e1b45a5b..028d25482 100755 --- a/Classes/CountryListView.m +++ b/Classes/CountryListView.m @@ -7,7 +7,6 @@ // #import "CountryListView.h" - #import "linphone/linphonecore_utils.h" @interface CountryListView () @@ -24,14 +23,16 @@ static NSMutableArray * dataRows = nil; + (NSArray*) getData { if (!dataRows) { dataRows = [[NSMutableArray alloc] init]; - - for (const LinphoneDialPlan* dial_plan=linphone_dial_plan_get_all(); dial_plan->country!=NULL; dial_plan++) { + const bctbx_list_t *dialPlans = linphone_dial_plan_get_all_list(); + while (dialPlans) { + LinphoneDialPlan* dial_plan = (LinphoneDialPlan*)dialPlans->data; [dataRows addObject:@{ - @"name":[NSString stringWithUTF8String:dial_plan->country], - @"iso":[NSString stringWithUTF8String:dial_plan->iso_country_code], - @"code":[NSString stringWithFormat:@"+%s",dial_plan->ccc], - @"phone_length":@(dial_plan->nnl) + @"name":[NSString stringWithUTF8String:linphone_dial_plan_get_country(dial_plan)], + @"iso":[NSString stringWithUTF8String:linphone_dial_plan_get_iso_country_code(dial_plan)], + @"code":[NSString stringWithFormat:@"+%s",linphone_dial_plan_get_country_calling_code(dial_plan)], + @"phone_length":@(linphone_dial_plan_get_national_number_length(dial_plan)) }]; + dialPlans = dialPlans->next; } } return dataRows; diff --git a/submodules/belle-sip b/submodules/belle-sip index 0b074bd60..e3b9709cc 160000 --- a/submodules/belle-sip +++ b/submodules/belle-sip @@ -1 +1 @@ -Subproject commit 0b074bd601fd97ee3977faf61c438eeb806b3a41 +Subproject commit e3b9709cc5c01250aa944a7cb6f8abbee885113f diff --git a/submodules/linphone b/submodules/linphone index 7b59cd6ee..894391c13 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 7b59cd6ee63109d036ffe5d6c4777950a0a3b2f5 +Subproject commit 894391c13b676093b126ccf47a4965c0fe00b720