README 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. Overview
  10. 2. Dependencies
  11. 2.1. Kamailio Modules
  12. 2.2. External Libraries or Applications
  13. 3. Parameters
  14. 3.1. script_name (string)
  15. 3.2. mod_init_function (string)
  16. 3.3. child_init_method (string)
  17. 4. Functions
  18. 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. Table of Contents
  26. 1. Overview
  27. 2. Dependencies
  28. 2.1. Kamailio Modules
  29. 2.2. External Libraries or Applications
  30. 3. Parameters
  31. 3.1. script_name (string)
  32. 3.2. mod_init_function (string)
  33. 3.3. child_init_method (string)
  34. 4. Functions
  35. 4.1. python_exec(method [, mystr])
  36. 1. Overview
  37. This module allows executing Python scripts from config file, exporting
  38. functions to access the SIP message from Python.
  39. 2. Dependencies
  40. 2.1. Kamailio Modules
  41. 2.2. External Libraries or Applications
  42. 2.1. Kamailio Modules
  43. The following modules must be loaded before this module:
  44. * none.
  45. 2.2. External Libraries or Applications
  46. The following libraries or applications must be installed before
  47. running Kamailio with this module loaded:
  48. * python-dev - Python devel library.
  49. 3. Parameters
  50. 3.1. script_name (string)
  51. 3.2. mod_init_function (string)
  52. 3.3. child_init_method (string)
  53. 3.1. script_name (string)
  54. TBD.
  55. Default value is “/usr/local/etc/sip-router/handler.py”.
  56. Example 1.1. Set script_name parameter
  57. ...
  58. modparam("app_python", "script_name", "/usr/local/etc/sip-router/myscript.py")
  59. ...
  60. 3.2. mod_init_function (string)
  61. TBD.
  62. Default value is “mod_init”.
  63. Example 1.2. Set mod_init_function parameter
  64. ...
  65. modparam("app_python", "mod_init_function", "my_mod_init")
  66. ...
  67. 3.3. child_init_method (string)
  68. TBD.
  69. Default value is “child_init”.
  70. Example 1.3. Set child_init_method parameter
  71. ...
  72. modparam("app_python", "child_init_method", "my_child_init")
  73. ...
  74. 4. Functions
  75. 4.1. python_exec(method [, mystr])
  76. 4.1. python_exec(method [, mystr])
  77. TBD.
  78. Example 1.4. python_exec usage
  79. ...
  80. python_exec("...");
  81. python_exec("...", "...");
  82. ...