intro.xml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. <chapter id="Select_Intro">
  5. <title>Introduction and Notations</title>
  6. <section id="Intro">
  7. <title>Introduction</title>
  8. <para>Selects are read-only functions that can be used in the script and
  9. that always return a string value. In the script a select always starts
  10. with a &apos;<emphasis>@</emphasis>&apos;. In an expression context a
  11. select always evaluates to either a string or undef.
  12. </para>
  13. <para>For more informations see
  14. <ulink url=' http://sip-router.org/wiki/cookbooks/selects/devel'>
  15. http://sip-router.org/wiki/cookbooks/selects/devel</ulink>.
  16. </para>
  17. <para>This document lists all the selects implemented by each module.
  18. </para>
  19. </section>
  20. <section id="Notations">
  21. <title>Notations</title>
  22. <para>The following notations are used:
  23. <orderedlist>
  24. <listitem><para>@ - all selects always start with '@'.</para></listitem>
  25. <listitem><para>&quot;string&quot; - string type.</para></listitem>
  26. <listitem><para>integer - integer type.</para></listitem>
  27. <listitem><para>[] - Parameter markers. Can be either [integer] or
  28. [&quot;string&quot;].
  29. Note that instead of [&quot;string&quot;] one could write .string,
  30. e.g.:
  31. @foo.bar[&quot;string&quot;] is equivalent to @foo.bar.string.
  32. </para></listitem>
  33. <listitem><para>{} - denotes an optional parameter.
  34. E.g.: @ruri.params{[&quot;string&quot;]} means you could use
  35. @ruri.params by itself or you could specify an extra parameter:
  36. @ruri.params[&quot;trasnport&quot;] or @ruri.params.transport.
  37. </para></listitem>
  38. <listitem><para>&lt;string&gt; - means the next member is not fixed and can
  39. take any string value (it is a string parameter).
  40. It is equivalent with [&quot;string&quot;], e.g.:
  41. @msg.header.&lt;string&gt; is the same as
  42. @msg.header[&quot;string&quot;].
  43. It is used only to expose an internal implementation detail
  44. (SEL_PARAM_* vs. CONSUME_NEXT_*), but from the script writer point
  45. of view it is the same thing.
  46. </para></listitem>
  47. <listitem><para>.* - means the select can be followed by a variable number
  48. of string parameters.
  49. E.g.: @cfg_get.* means that @cfg_get.core.version is a valid usage.
  50. </para></listitem>
  51. <listitem><para>* (without a &apos;.&apos; in front) - it means the
  52. last member might be a class that might expand further (but the
  53. &quot;expansion&quot; is not defined in the same module).
  54. E.g. @foo.nameaddr* means that nameaddr is most likely
  55. a class that expands further
  56. (for example into @foo.nameaddr.uri a.s.o).
  57. </para></listitem>
  58. </orderedlist>
  59. </para>
  60. </section>
  61. </chapter>