Jelajahi Sumber

- added maxforwards support to sip_msg & parse_headers.

Andrei Pelinescu-Onciul 24 tahun lalu
induk
melakukan
10febf05cc
2 mengubah file dengan 7 tambahan dan 2 penghapusan
  1. 5 1
      msg_parser.c
  2. 2 1
      msg_parser.h

+ 5 - 1
msg_parser.c

@@ -591,7 +591,11 @@ int parse_headers(struct sip_msg* msg, int flags)
 				if (msg->contact==0) msg->contact=hf;
 				msg->parsed_flag|=HDR_CONTACT;
 				break;
-		        case HDR_ROUTE:
+			case HDR_MAXFORWARDS:
+				if(msg->maxforwards==0) msg->maxforwards=hf;
+				msg->parsed_flag|=HDR_MAXFORWARDS;
+				break;
+			case HDR_ROUTE:
 				if (msg->route==0) msg->route=hf;
 				msg->parsed_flag|=HDR_ROUTE;
 				break;

+ 2 - 1
msg_parser.h

@@ -157,7 +157,8 @@ struct sip_msg{
 	struct hdr_field* cseq;
 	struct hdr_field* from;
 	struct hdr_field* contact;
-	struct hdr_field* route;    /* janakj, was missing here */
+	struct hdr_field* maxforwards;
+	struct hdr_field* route;
 	char* eoh; /* pointer to the end of header (if found) or null */
 
 	char* unparsed; /* here we stopped parsing*/