msg_start.xml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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="msg_start" xmlns:xi="http://www.w3.org/2001/XInclude">
  5. <sectioninfo>
  6. <revhistory>
  7. <revision>
  8. <revnumber>$Revision$</revnumber>
  9. <date>$Date$</date>
  10. </revision>
  11. </revhistory>
  12. </sectioninfo>
  13. <title>Structure <structname>msg_start</structname></title>
  14. <para>
  15. The structure represents the first line of a <acronym>SIP</acronym>
  16. request or response.
  17. </para>
  18. <para>
  19. The structure is defined in file <filename>parse_fline.h</filename>
  20. under <filename>parser</filename> subdirectory.
  21. </para>
  22. <para>
  23. <emphasis>Structure Declaration</emphasis>
  24. <programlisting>
  25. struct msg_start {
  26. int type; /* Type of the Message - Request/Response */
  27. union {
  28. struct {
  29. str method; /* Method string */
  30. str uri; /* Request URI */
  31. str version; /* SIP version */
  32. int method_value; /* Parsed method */
  33. } request;
  34. struct {
  35. str version; /* SIP version */
  36. str status; /* Reply status */
  37. str reason; /* Reply reason phrase */
  38. unsigned int statuscode; /* Status code */
  39. } reply;
  40. }u;
  41. };
  42. </programlisting>
  43. </para>
  44. <para>
  45. <emphasis>Description of Request Related Fields:</emphasis>
  46. <itemizedlist>
  47. <listitem>
  48. <para>
  49. <structfield>type</structfield> - Type of the message -
  50. REQUEST or RESPONSE.
  51. </para>
  52. </listitem>
  53. <listitem>
  54. <para>
  55. <structfield>method</structfield> - Name of method (same as
  56. in the message).
  57. </para>
  58. </listitem>
  59. <listitem>
  60. <para>
  61. <structfield>uri</structfield> - Request <acronym>URI</acronym>.
  62. </para>
  63. </listitem>
  64. <listitem>
  65. <para>
  66. <structfield>version</structfield> - Version string.
  67. </para>
  68. </listitem>
  69. <listitem>
  70. <para>
  71. <structfield>method_value</structfield> - Parsed
  72. method. Field method which is of type <type>str</type> will
  73. be converted to integer and stored here. This is good for
  74. comparison, integer comparison is much faster then string
  75. comparison.
  76. </para>
  77. </listitem>
  78. </itemizedlist>
  79. </para>
  80. <para>
  81. <emphasis>Description of Response Related Fields:</emphasis>
  82. <itemizedlist>
  83. <listitem>
  84. <para>
  85. <structfield>version</structfield> - Version string.
  86. </para>
  87. </listitem>
  88. <listitem>
  89. <para>
  90. <structfield>status</structfield> - Response status code as
  91. string.
  92. </para>
  93. </listitem>
  94. <listitem>
  95. <para>
  96. <structfield>reason</structfield> - Response reason string
  97. as in the message.
  98. </para>
  99. </listitem>
  100. <listitem>
  101. <para>
  102. <structfield>statuscode</structfield> - Response status
  103. code converted to integer.
  104. </para>
  105. </listitem>
  106. </itemizedlist>
  107. </para>
  108. </section>