tsip_machine_header.rl 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /*
  2. * Copyright (C) 2010-2011 Mamadou Diop.
  3. *
  4. * Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
  5. *
  6. * This file is part of Open Source Doubango Framework.
  7. *
  8. * DOUBANGO is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * DOUBANGO is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with DOUBANGO.
  20. *
  21. */
  22. /**@file tsip_machine_headers.rl.
  23. * @brief Ragel file.
  24. *
  25. * @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
  26. *
  27. */
  28. /*== Header pasrsing machine. Supports both full-length and compact mode. */
  29. %%{
  30. machine tsip_machine_header;
  31. Accept = "Accept"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Accept;
  32. Accept_Contact = ("Accept-Contact"i | "a") SP* HCOLON SP*<: any* :>CRLF @parse_header_Accept_Contact;
  33. Accept_Encoding = "Accept-Encoding"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Accept_Encoding;
  34. Accept_Language = "Accept-Language"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Accept_Language;
  35. Accept_Resource_Priority = "Accept-Resource-Priority"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Accept_Resource_Priority;
  36. Alert_Info = "Alert-Info"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Alert_Info;
  37. Allow = "Allow"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Allow;
  38. Allow_Events = ("Allow-Events"i | "u") SP* HCOLON SP*<: any* :>CRLF @parse_header_Allow_Events;
  39. Authentication_Info = "Authentication-Info"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Authentication_Info;
  40. Authorization = "Authorization"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Authorization;
  41. Call_ID = ("Call-ID"i | "i") SP* HCOLON SP*<: any* :>CRLF @parse_header_Call_ID;
  42. Call_Info = "Call-Info"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Call_Info;
  43. Contact = ("Contact"i | "m") SP* HCOLON SP*<: any* :>CRLF @parse_header_Contact;
  44. Content_Disposition = "Content-Disposition"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Content_Disposition;
  45. Content_Encoding = ("Content-Encoding"i | "e") SP* HCOLON SP*<: any* :>CRLF @parse_header_Content_Encoding;
  46. Content_Language = "Content-Language"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Content_Language;
  47. Content_Length = ("Content-Length"i | "l") SP* HCOLON SP*<: any* :>CRLF @parse_header_Content_Length;
  48. Content_Type = ("Content-Type"i | "c") SP* HCOLON SP*<: any* :>CRLF @parse_header_Content_Type;
  49. CSeq = "CSeq"i SP* HCOLON SP*<: any* :>CRLF @parse_header_CSeq;
  50. Date = "Date"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Date;
  51. Error_Info = "Error-Info"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Error_Info;
  52. Event = ("Event"i | "o"i) SP* HCOLON SP*<: any* :>CRLF @parse_header_Event;
  53. Expires = "Expires"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Expires;
  54. From = ("From"i | "f") SP* HCOLON SP*<: any* :>CRLF @parse_header_From;
  55. History_Info = "History-Info"i SP* HCOLON SP*<: any* :>CRLF @parse_header_History_Info;
  56. Identity = ("Identity"i | "y") SP* HCOLON SP*<: any* :>CRLF @parse_header_Identity;
  57. Identity_Info = ("Identity-Info"i | "n") SP* HCOLON SP*<: any* :>CRLF @parse_header_Identity_Info;
  58. In_Reply_To = "In_Reply-To"i SP* HCOLON SP*<: any* :>CRLF @parse_header_In_Reply_To;
  59. Join = "Join"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Join;
  60. Max_Forwards = "Max-Forwards"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Max_Forwards;
  61. MIME_Version = "MIME-Version"i SP* HCOLON SP*<: any* :>CRLF @parse_header_MIME_Version;
  62. Min_Expires = "Min-Expires"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Min_Expires;
  63. Min_SE = "Min-SE"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Min_SE;
  64. Organization = "Organization"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Organization;
  65. Path = "Path"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Path;
  66. Priority = "Priority"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Priority;
  67. Privacy = "Privacy"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Privacy;
  68. Proxy_Authenticate = "Proxy-Authenticate"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Proxy_Authenticate;
  69. Proxy_Authorization = "Proxy-Authorization"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Proxy_Authorization;
  70. Proxy_Require = "Proxy-Require"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Proxy_Require;
  71. RAck = "RAck"i SP* HCOLON SP*<: any* :>CRLF @parse_header_RAck;
  72. Reason = "Reason"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Reason;
  73. Record_Route = "Record-Route"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Record_Route;
  74. Refer_Sub = "Refer-Sub"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Refer_Sub;
  75. Refer_To = ("Refer-To"i | "r") SP* HCOLON SP*<: any* :>CRLF @parse_header_Refer_To;
  76. Referred_By = ("Referred-By"i | "b") SP* HCOLON SP*<: any* :>CRLF @parse_header_Referred_By;
  77. Reject_Contact = ("Reject-Contact"i | "j") SP* HCOLON SP*<: any* :>CRLF @parse_header_Reject_Contact;
  78. Replaces = "Replaces"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Replaces;
  79. Reply_To = "Reply-To"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Reply_To;
  80. Request_Disposition = ("Request-Disposition"i | "d") SP* HCOLON SP*<: any* :>CRLF @parse_header_Request_Disposition;
  81. Require = "Require"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Require;
  82. Resource_Priority = "Resource-Priority"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Resource_Priority;
  83. Retry_After = "Retry-After"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Retry_After;
  84. Route = "Route"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Route;
  85. RSeq = "RSeq"i SP* HCOLON SP*<: any* :>CRLF @parse_header_RSeq;
  86. Security_Client = "Security-Client"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Security_Client;
  87. Security_Server = "Security-Server"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Security_Server;
  88. Security_Verify = "Security-Verify"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Security_Verify;
  89. Server = "Server"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Server;
  90. Service_Route = "Service-Route"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Service_Route;
  91. Session_Expires = ("Session-Expires"i | "x") SP* HCOLON SP*<: any* :>CRLF @parse_header_Session_Expires;
  92. SIP_ETag = "SIP-ETag"i SP* HCOLON SP*<: any* :>CRLF @parse_header_SIP_ETag;
  93. SIP_If_Match = "SIP-If-Match"i SP* HCOLON SP*<: any* :>CRLF @parse_header_SIP_If_Match;
  94. Subject = ("Subject"i | "s"i) SP* HCOLON SP*<: any* :>CRLF @parse_header_Subject;
  95. Subscription_State = ("Subscription-State"i) SP* HCOLON SP*<: any* :>CRLF @parse_header_Subscription_State;
  96. Supported = ("Supported"i | "k") SP* HCOLON SP*<: any* :>CRLF @parse_header_Supported;
  97. Target_Dialog = "Target-Dialog"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Target_Dialog;
  98. Timestamp = "Timestamp"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Timestamp;
  99. To = ("To"i | "t") SP* HCOLON SP*<: any* :>CRLF @parse_header_To;
  100. Unsupported = "Unsupported"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Unsupported;
  101. User_Agent = "User-Agent"i SP* HCOLON SP*<: any* :>CRLF @parse_header_User_Agent;
  102. Via = ("Via"i | "v") SP* HCOLON SP*<: any* :>CRLF @parse_header_Via;
  103. Warning = "Warning"i SP* HCOLON SP*<: any* :>CRLF @parse_header_Warning;
  104. WWW_Authenticate = "WWW-Authenticate"i SP* HCOLON SP*<: any* :>(CRLF when prev_not_comma) @parse_header_WWW_Authenticate;
  105. P_Access_Network_Info = "P-Access-Network-Info"i SP* HCOLON SP*<: any* :>CRLF @parse_header_P_Access_Network_Info;
  106. P_Answer_State = "P-Answer-State"i SP* HCOLON SP*<: any* :>CRLF @parse_header_P_Answer_State;
  107. P_Asserted_Identity = "P-Asserted-Identity"i SP* HCOLON SP*<: any* :>CRLF @parse_header_P_Asserted_Identity;
  108. P_Associated_URI = "P-Associated-URI"i SP* HCOLON SP*<: any* :>CRLF @parse_header_P_Associated_URI;
  109. P_Called_Party_ID = "P-Called-Party-ID"i SP* HCOLON SP*<: any* :>CRLF @parse_header_P_Called_Party_ID;
  110. P_Charging_Function_Addresses = "P-Charging-Function-Addresses"i SP* HCOLON SP*<: any* :>CRLF @parse_header_P_Charging_Function_Addresses;
  111. P_Charging_Vector = "P-Charging-Vector"i SP* HCOLON SP*<: any* :>CRLF @parse_header_P_Charging_Vector;
  112. P_DCS_Billing_Info = "P-DCS-Billing-Info"i SP* HCOLON SP*<: any* :>CRLF @parse_header_P_DCS_Billing_Info;
  113. P_DCS_LAES = "P-DCS-LAES"i SP* HCOLON SP*<: any* :>CRLF @parse_header_P_DCS_LAES;
  114. P_DCS_OSPS = "P-DCS-OSPS"i SP* HCOLON SP*<: any* :>CRLF @parse_header_P_DCS_OSPS;
  115. P_DCS_Redirect = "P-DCS-Redirect"i SP* HCOLON SP*<: any* :>CRLF @parse_header_P_DCS_Redirect;
  116. P_DCS_Trace_Party_ID = "P-DCS-Trace-Party-ID"i SP* HCOLON SP*<: any* :>CRLF @parse_header_P_DCS_Trace_Party_ID;
  117. P_Early_Media = "P-Early-Media"i SP* HCOLON SP*<: any* :>CRLF @parse_header_P_Early_Media;
  118. P_Media_Authorization = "P-Media-Authorization"i SP* HCOLON SP*<: any* :>CRLF @parse_header_P_Media_Authorization;
  119. P_Preferred_Identity = "P-Preferred-Identity"i SP* HCOLON SP*<: any* :>CRLF @parse_header_P_Preferred_Identity;
  120. P_Profile_Key = "P-Profile-Key"i SP* HCOLON SP*<: any* :>CRLF @parse_header_P_Profile_Key;
  121. P_User_Database = "P-User-Database"i SP* HCOLON SP*<: any* :>CRLF @parse_header_P_User_Database;
  122. P_Visited_Network_ID = "P-Visited-Network-ID"i SP* HCOLON SP*<: any* :>CRLF @parse_header_P_Visited_Network_ID;
  123. ######
  124. extension_header = (token) SP* HCOLON SP*<: any* :>CRLF @parse_header_extension_header;
  125. HEADER = ( Accept | Accept_Contact | Accept_Encoding | Accept_Language | Accept_Resource_Priority | Alert_Info | Allow | Allow_Events | Authentication_Info | Authorization | Call_ID | Call_Info | Contact | Content_Disposition | Content_Encoding | Content_Language | Content_Length | Content_Type | CSeq | Date | Error_Info | Event | Expires | From | History_Info | Identity | Identity_Info | In_Reply_To | Join | Max_Forwards | MIME_Version | Min_Expires | Min_SE | Organization | Path | Priority | Privacy | Proxy_Authenticate | Proxy_Authorization | Proxy_Require | RAck | Reason | Record_Route | Refer_Sub | Refer_To | Referred_By | Reject_Contact | Replaces | Reply_To | Request_Disposition | Require | Resource_Priority | Retry_After | Route | RSeq | Security_Client | Security_Server | Security_Verify | Server | Service_Route | Session_Expires | SIP_ETag | SIP_If_Match | Subject | Subscription_State | Supported | Target_Dialog | Timestamp | To | Unsupported | User_Agent | Via | Warning | WWW_Authenticate | P_Access_Network_Info | P_Answer_State | P_Asserted_Identity | P_Associated_URI | P_Called_Party_ID | P_Charging_Function_Addresses | P_Charging_Vector | P_DCS_Billing_Info | P_DCS_LAES | P_DCS_OSPS | P_DCS_Redirect | P_DCS_Trace_Party_ID | P_Early_Media | P_Media_Authorization | P_Preferred_Identity | P_Profile_Key | P_User_Database | P_Visited_Network_ID)@1 | (extension_header)@0;
  126. }%%