Browse Source

Now use a PATH variable in get_cid_name_timeout.sh

get_cid_name.py : don't update the CallerID name if there is already one present.
pull/26/head
Alexis de Lattre 12 years ago
parent
commit
b08fbfe04b
  1. 8
      asterisk_click2dial/scripts/get_cid_name.py
  2. 4
      asterisk_click2dial/scripts/get_cid_name_timeout.sh

8
asterisk_click2dial/scripts/get_cid_name.py

@ -165,6 +165,14 @@ def main(options, arguments):
for variable in stdinput.keys(): for variable in stdinput.keys():
stderr_write("%s = %s\n" % (variable, stdinput.get(variable))) stderr_write("%s = %s\n" % (variable, stdinput.get(variable)))
# If we already have a "True" caller ID name
# i.e. not just digits, but a real name, then we don't try to
# connect to OpenERP or geoloc, we just keep it
if stdinput.get('agi_calleridname') and not stdinput.get('agi_calleridname').isdigit():
stdout_write('VERBOSE "Incoming CallerID name is %s"\n' % stdinput.get('agi_calleridname'))
stdout_write('VERBOSE "As it is a real name, we do not change it"\n')
return True
input_cid_number = stdinput.get('agi_callerid') input_cid_number = stdinput.get('agi_callerid')
stderr_write('stdout encoding = %s\n' % sys.stdout.encoding or 'utf-8') stderr_write('stdout encoding = %s\n' % sys.stdout.encoding or 'utf-8')

4
asterisk_click2dial/scripts/get_cid_name_timeout.sh

@ -22,4 +22,6 @@
# echo "agi_callerid:0141981242"|get_cid_name_timeout.sh # echo "agi_callerid:0141981242"|get_cid_name_timeout.sh
# where 0141981242 is a phone number that could be presented by the calling party # where 0141981242 is a phone number that could be presented by the calling party
timeout 2s /usr/local/bin/get_cid_name.py --server openerp.mycompany.com --database erp_prod --user-id 12 --password "thepasswd" --geoloc --geoloc-country "FR" --geoloc-lang "fr"
PATH=/usr/local/sbin:/usr/local/bin:/var/lib/asterisk/agi-bin:/sbin:/bin:/usr/sbin:/usr/bin
timeout 2s get_cid_name.py --server openerp.mycompany.com --database erp_prod --user-id 12 --password "thepasswd" --geoloc --geoloc-country "FR" --geoloc-lang "fr"
Loading…
Cancel
Save