Browse Source

Update my script to make it work with the latest versions of the phonenumbers lib.

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

2
asterisk_click2dial/scripts/get_cid_name.py

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

4
asterisk_click2dial/scripts/get_cid_name_timeout.sh

@ -21,8 +21,8 @@
# don't put a 1 sec timeout !
# To test this script manually (i.e. outside of Asterisk), run :
# echo "agi_callerid:0141981242"|get_cid_name_timeout.sh
# where 0141981242 is a phone number that could be presented by the calling party
# echo "agi_callerid:0141401242"|get_cid_name_timeout.sh
# where 0141401242 is a phone number that could be presented by the calling party
PATH=/usr/local/sbin:/usr/local/bin:/var/lib/asterisk/agi-bin:/sbin:/bin:/usr/sbin:/usr/bin

Loading…
Cancel
Save