You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1.5 KiB

  1. #! /bin/sh
  2. # -*- encoding: utf-8 -*-
  3. #
  4. # Written by Alexis de Lattre <alexis.delattre@akretion.com>
  5. # Example of wrapper for set_name_agi.py which makes sure that the
  6. # script doesn't take too much time to execute
  7. # Limiting the execution time of set_name_agi.py is important because
  8. # the script is designed to be executed at the beginning of each
  9. # incoming or outgoing phone call... and if the script get stucks, the
  10. # phone call will also get stucks !
  11. # For Ubuntu >= Maverick and Debian >= Squeeze, the "timeout" command is shipped
  12. # in the "coreutils" package
  13. # The first argument of the "timeout" command is the maximum execution time
  14. # In this example, we chose 2 seconds. Note that geolocalisation takes about
  15. # 1 second on an small machine ; so if you enable the --geoloc option,
  16. # don't put a 1 sec timeout !
  17. # NOTE : with recent version of the phonenumbers lib, the loading time
  18. # is extremely high, about 3 seconds ! I don't know if it's a bug
  19. # or if it will stay like that.
  20. # To test this script manually (i.e. outside of Asterisk), run :
  21. # echo "agi_extension:0141401242"|set_name_outgoing_timeout.sh
  22. # where 0141401242 is a phone number that could be presented by the calling party
  23. PATH=/usr/local/sbin:/usr/local/bin:/var/lib/asterisk/agi-bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/share/asterisk/agi-bin:.
  24. timeout 2s set_name_agi.py --jsonrpc --ssl --server odoo.mycompany.com --database erp_prod --username "asterisk" --password "thepasswd" --outgoing --outgoing-agi-variable extension