exec.xml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
  4. <section id="exec" xmlns:xi="http://www.w3.org/2001/XInclude">
  5. <sectioninfo>
  6. <authorgroup>
  7. <author>
  8. <firstname>Jiri</firstname>
  9. <surname>Kuthan</surname>
  10. <affiliation><orgname>FhG FOKUS</orgname></affiliation>
  11. <address>
  12. <email>[email protected]</email>
  13. </address>
  14. </author>
  15. </authorgroup>
  16. <copyright>
  17. <year>2003</year>
  18. <holder>FhG FOKUS</holder>
  19. </copyright>
  20. <revhistory>
  21. <revision>
  22. <revnumber>$Revision$</revnumber>
  23. <date>$Date$</date>
  24. </revision>
  25. </revhistory>
  26. </sectioninfo>
  27. <title>Exec Module</title>
  28. <section id="exec.overview">
  29. <title>Overview</title>
  30. <para>
  31. Exec module allows to start an external command from a ser
  32. script. The commands may be any valid shell commands, the command
  33. string is passed to shell using "popen" command. ser
  34. passes additionally lot of information about request in environment
  35. variables:
  36. </para>
  37. <itemizedlist>
  38. <listitem>
  39. <para>
  40. SIP_HF_&lt;hf_name&gt; contains value of each header field
  41. in request. If a header field occurred multiple times,
  42. values are concatenated and
  43. comma-separated. &lt;hf_name&gt; is in capital letters. Ff
  44. a header-field name occurred in compact form,
  45. &lt;hf_name&gt; is canonical.
  46. </para>
  47. </listitem>
  48. <listitem>
  49. <para>
  50. SIP_TID is transaction identifier. All request
  51. retransmissions or CANCELs/ACKs associated with a previous
  52. INVITE result in the same value.
  53. </para>
  54. </listitem>
  55. <listitem>
  56. <para>
  57. SIP_DID is dialog identifier, which is the same as
  58. to-tag. Initially, it is empty.
  59. </para>
  60. </listitem>
  61. <listitem>
  62. <para>
  63. SIP_SRCIP is source IP address from which request came.
  64. </para>
  65. </listitem>
  66. <listitem>
  67. <para>
  68. SIP_ORURI is original Request-URI.
  69. </para>
  70. </listitem>
  71. <listitem>
  72. <para>
  73. SIP_RURI is <emphasis>current</emphasis> Request-URI (if unchanged, equal to original).
  74. </para>
  75. </listitem>
  76. <listitem>
  77. <para>
  78. SIP_USER is userpart of <emphasis>current</emphasis> Request-URI.
  79. </para>
  80. </listitem>
  81. <listitem>
  82. <para>
  83. SIP_OUSER is userpart of original Request-URI.
  84. </para>
  85. </listitem>
  86. </itemizedlist>
  87. </section>
  88. <xi:include href="params.xml"/>
  89. <xi:include href="functions.xml"/>
  90. <section id="known_issues">
  91. <title>Known Issues</title>
  92. <para>
  93. There is currently no guarantee that scripts ever return and stop
  94. blocking SIP server. (There is <filename>kill.c</filename> but it
  95. is not used along with the current mechanisms based on popen.
  96. Besides that <filename>kill.c</filename> is ugly).
  97. </para>
  98. </section>
  99. </section>