Răsfoiți Sursa

core: parse - added IS_SIP_MSG() macro to check if message type is SIP

- defined also IS_SIP_REQUEST() same as IS_SIP() but with more explicit
  name for detecting SIP requests
Daniel-Constantin Mierla 3 ani în urmă
părinte
comite
02b960d84d
1 a modificat fișierele cu 9 adăugiri și 0 ștergeri
  1. 9 0
      src/core/parser/msg_parser.h

+ 9 - 0
src/core/parser/msg_parser.h

@@ -147,11 +147,20 @@ if (  (*tmp==(firstchar) || *tmp==((firstchar) | 32)) &&                  \
 	(((req)->first_line.type == SIP_REQUEST) &&           \
 	((req)->first_line.flags & FLINE_FLAG_PROTO_SIP))
 
+/* sip request */
+#define IS_SIP_REQUEST(req)                             \
+	(((req)->first_line.type == SIP_REQUEST) &&           \
+	((req)->first_line.flags & FLINE_FLAG_PROTO_SIP))
+
 /* sip reply */
 #define IS_SIP_REPLY(rpl)                               \
 	(((rpl)->first_line.type == SIP_REPLY) &&             \
 	((rpl)->first_line.flags & FLINE_FLAG_PROTO_SIP))
 
+/* sip message */
+#define IS_SIP_MSG(req)                                  \
+	((req)->first_line.flags & FLINE_FLAG_PROTO_SIP)
+
 /* http request */
 #define IS_HTTP(req)                                    \
 	(((req)->first_line.type == SIP_REQUEST) &&           \