[SR-Dev] git:master: Support for MESSAGE and OPTIONS method types are added to the parser.

Jan Janak jan at iptel.org
Fri Feb 27 23:32:59 CET 2009


Module: sip-router
Branch: master
Commit: 19af811d791bfe71fb91ae4532678c056e5ea1d8
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=19af811d791bfe71fb91ae4532678c056e5ea1d8

Author: Miklos Tirpak <miklos at iptel.org>
Committer: Miklos Tirpak <miklos at iptel.org>
Date:   Fri Feb 27 09:01:42 2009 +0000

Support for MESSAGE and OPTIONS method types are added to the parser.

---

 parser/msg_parser.h  |    3 ++-
 parser/parse_fline.c |    2 ++
 parser/parse_fline.h |    2 ++
 3 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/parser/msg_parser.h b/parser/msg_parser.h
index 43434a9..ffa3e19 100644
--- a/parser/msg_parser.h
+++ b/parser/msg_parser.h
@@ -79,7 +79,8 @@
 /* number methods as power of two to allow bitmap matching */
 enum request_method { METHOD_UNDEF=0, METHOD_INVITE=1, METHOD_CANCEL=2, METHOD_ACK=4,
 	METHOD_BYE=8, METHOD_INFO=16, METHOD_REGISTER=32, METHOD_SUBSCRIBE=64,
-        METHOD_NOTIFY=128, METHOD_OTHER=256 };
+	METHOD_NOTIFY=128, METHOD_MESSAGE=256, METHOD_OPTIONS=512,
+	METHOD_OTHER=1024 };
 
 #define FL_FORCE_RPORT 1   /* force rport */
 #define FL_FORCE_ACTIVE 2  /* force active SDP */
diff --git a/parser/parse_fline.c b/parser/parse_fline.c
index fedfd3f..e234835 100644
--- a/parser/parse_fline.c
+++ b/parser/parse_fline.c
@@ -123,6 +123,8 @@ char* parse_first_line(char* buffer, unsigned int len, struct msg_start * fl)
 	else IFISMETHOD( REGISTER, 'R')
 	else IFISMETHOD( SUBSCRIBE, 'S')
 	else IFISMETHOD( NOTIFY, 'N')
+	else IFISMETHOD( MESSAGE, 'M')
+	else IFISMETHOD( OPTIONS, 'O')
 	/* if you want to add another method XXX, include METHOD_XXX in
            H-file (this is the value which you will take later in
            processing and define XXX_LEN as length of method name;
diff --git a/parser/parse_fline.h b/parser/parse_fline.h
index 48a1eef..f8b3e06 100644
--- a/parser/parse_fline.h
+++ b/parser/parse_fline.h
@@ -58,6 +58,8 @@
 #define REGISTER_LEN 8
 #define SUBSCRIBE_LEN 9
 #define NOTIFY_LEN 6
+#define MESSAGE_LEN 7
+#define OPTIONS_LEN 7
 
 struct msg_start {
 	int type;					/* Type of the Message - Request/Response */




More information about the sr-dev mailing list