functions.xml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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="options.functions" xmlns:xi="http://www.w3.org/2001/XInclude">
  5. <sectioninfo>
  6. </sectioninfo>
  7. <title>Functions</title>
  8. <section id="options_reply">
  9. <title>
  10. <function>options_reply()</function>
  11. </title>
  12. <para>
  13. This function checks if the request method is OPTIONS and if the
  14. request URI does not contain an username. If both is true the
  15. request will be answered stateless with "200 OK" and
  16. the capabilities from the modules parameters.
  17. </para>
  18. <para>
  19. It sends "500 Server Internal Error" for some errors
  20. and returns false if it is called for a wrong request.
  21. </para>
  22. <para>
  23. The check for the request method and the missing username is
  24. optional because it is also done by the function itself. But you
  25. should not call this function outside the myself check because in
  26. this case the function could answer OPTIONS requests which are sent
  27. to you as outbound proxy but with an other destination then your
  28. proxy (this check is currently missing in the function).
  29. </para>
  30. <example>
  31. <title><function>options_reply</function> usage</title>
  32. <programlisting>
  33. <![CDATA[
  34. ...
  35. if (uri==myself) {
  36. if ((method==OPTIONS) && (! uri=~"sip:.*[@]+.*")) {
  37. options_reply();
  38. }
  39. }
  40. ...
  41. ]]>
  42. </programlisting>
  43. </example>
  44. </section>
  45. </section>