README 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. app_python Module
  2. Maxim Sobolev
  3. Edited by
  4. Maxim Sobolev
  5. Copyright © 2010 Maxim Sobolev
  6. __________________________________________________________________
  7. Table of Contents
  8. 1. Admin Guide
  9. 1.1. Overview
  10. 1.2. Dependencies
  11. 1.2.1. Kamailio Modules
  12. 1.2.2. External Libraries or Applications
  13. 1.3. Exported Parameters
  14. 1.3.1. script_name (string)
  15. 1.3.2. mod_init_function (string)
  16. 1.3.3. child_init_method (string)
  17. 1.4. Exported Functions
  18. 1.4.1. python_exec(method [, mystr])
  19. List of Examples
  20. 1.1. Set script_name parameter
  21. 1.2. Set mod_init_function parameter
  22. 1.3. Set child_init_method parameter
  23. 1.4. python_exec usage
  24. Chapter 1. Admin Guide
  25. 1.1. Overview
  26. This module allows executing Python scripts from config file, exporting
  27. functions to access the SIP message from Python.
  28. 1.2. Dependencies
  29. 1.2.1. Kamailio Modules
  30. The following modules must be loaded before this module:
  31. * none.
  32. 1.2.2. External Libraries or Applications
  33. The following libraries or applications must be installed before
  34. running Kamailio with this module loaded:
  35. * python-dev - Python devel library.
  36. 1.3. Exported Parameters
  37. 1.3.1. script_name (string)
  38. TBD.
  39. Default value is "/usr/local/etc/sip-router/handler.py".
  40. Example 1.1. Set script_name parameter
  41. ...
  42. modparam("app_python", "script_name", "/usr/local/etc/sip-router/myscript.py")
  43. ...
  44. 1.3.2. mod_init_function (string)
  45. TBD.
  46. Default value is "mod_init".
  47. Example 1.2. Set mod_init_function parameter
  48. ...
  49. modparam("app_python", "mod_init_function", "my_mod_init")
  50. ...
  51. 1.3.3. child_init_method (string)
  52. TBD.
  53. Default value is "child_init".
  54. Example 1.3. Set child_init_method parameter
  55. ...
  56. modparam("app_python", "child_init_method", "my_child_init")
  57. ...
  58. 1.4. Exported Functions
  59. 1.4.1. python_exec(method [, mystr])
  60. TBD.
  61. Example 1.4. python_exec usage
  62. ...
  63. python_exec("...");
  64. python_exec("...", "...");
  65. ...