Browse code

phonenum: build cctel from formatted number

Daniel-Constantin Mierla authored on 21/03/2018 13:49:26
Showing 1 changed files
... ...
@@ -134,7 +134,10 @@ telnum_t* telnum_parse(char* number, char* region)
134 134
 	string descNumber = _phoneGeoCoder->GetDescriptionForNumber(parsedNumber, Locale("en"));
135 135
 	res->ndesc = strdup(descNumber.c_str());
136 136
 	res->ltype = strdup(telnum_linetype(_phoneUtil.GetNumberType(parsedNumber)));
137
-	res->cctel = _phoneUtil.GetCountryCodeForRegion(regionStr);
137
+	// res->cctel = _phoneUtil.GetCountryCodeForRegion(regionStr);
138
+	string regionCode;
139
+	_phoneUtil.GetRegionCodeForNumber(parsedNumber, &regionCode);
140
+	res->cctel = _phoneUtil.GetCountryCodeForRegion(regionCode);
138 141
 
139 142
 	return res;
140 143
 }