Browse Source

FIX to make the script work with the latest version of the phonenumbers lib

pull/7/head
Alexis de Lattre 11 years ago
parent
commit
4a0c55c400
  1. 2
      asterisk_click2dial/scripts/get_cid_name.py

2
asterisk_click2dial/scripts/get_cid_name.py

@ -103,7 +103,7 @@ def geolocate_phone_number(number, my_country_code, lang):
import phonenumbers.geocoder import phonenumbers.geocoder
res = '' res = ''
phonenum = phonenumbers.parse(number, my_country_code.upper()) phonenum = phonenumbers.parse(number, my_country_code.upper())
city = phonenumbers.area_description_for_number(phonenum, lang.lower())
city = phonenumbers.geocoder._area_description_for_number(phonenum, lang.lower())
#country = phonenumbers.country_name_for_number(phonenum, lang.lower()) #country = phonenumbers.country_name_for_number(phonenum, lang.lower())
country_code = phonenumbers.region_code_for_number(phonenum) country_code = phonenumbers.region_code_for_number(phonenum)
if country_code == my_country_code.upper(): if country_code == my_country_code.upper():

Loading…
Cancel
Save