Browse code

parser: added macros to check if it is a SIP or HTTP reply

Daniel-Constantin Mierla authored on 23/09/2013 16:40:48
Showing 1 changed files
... ...
@@ -156,6 +156,16 @@ if (  (*tmp==(firstchar) || *tmp==((firstchar) | 32)) &&                  \
156 156
     !strncasecmp((req)->first_line.u.request.version.s,             \
157 157
 		SIP_VERSION, SIP_VERSION_LEN))
158 158
 
159
+#define IS_HTTP_REPLY(rpl)                                                \
160
+    ((rpl)->first_line.u.reply.version.len >= HTTP_VERSION_LEN && \
161
+    !strncasecmp((rpl)->first_line.u.reply.version.s,             \
162
+		HTTP_VERSION, HTTP_VERSION_LEN))
163
+
164
+#define IS_SIP_REPLY(rpl)                                                \
165
+    ((rpl)->first_line.u.reply.version.len >= SIP_VERSION_LEN && \
166
+    !strncasecmp((rpl)->first_line.u.reply.version.s,             \
167
+		SIP_VERSION, SIP_VERSION_LEN))
168
+
159 169
 /*! \brief
160 170
  * Return a URI to which the message should be really sent (not what should
161 171
  * be in the Request URI. The following fields are tried in this order: