Browse Source

-SIP: added handling to REGISTER request

Wulf Pfeiffer 10 years ago
parent
commit
708d868bd1
1 changed files with 4 additions and 1 deletions
  1. 4 1
      src/de/tudarmstadt/informatik/hostage/protocol/SIP.java

+ 4 - 1
src/de/tudarmstadt/informatik/hostage/protocol/SIP.java

@@ -7,7 +7,7 @@ import de.tudarmstadt.informatik.hostage.wrapper.Packet;
 
 /**
  * SIP protocol. Implementation of RFC document 3261 It can handle the
- * following requests: INVITE, ACK, BYE. For all other requests
+ * following requests: REGISTER, INVITE, ACK, BYE. For all other requests
  * '400 Bad Request' will be replied.
  * @author Wulf Pfeiffer
  */
@@ -20,6 +20,7 @@ public class SIP implements Protocol {
 	private STATE state = STATE.NONE;
 		
 	private static final String VERSION = "SIP/2.0";
+	private static final String REGISTER = "REGISTER";
 	private static final String INVITE = "INVITE";
 	private static final String ACK= "ACK";
 	private static final String BYE = "BYE";
@@ -58,6 +59,8 @@ public class SIP implements Protocol {
 		if(!lines[0].contains(VERSION)) {
 			responsePackets.add(getVersionNotSupportedResponse());
 			return responsePackets;
+		} else if(lines[0].contains(REGISTER)) {
+			responsePackets.add(getOkResponse());
 		} else if(lines[0].contains(INVITE)) {
 			responsePackets.add(getOkResponseWithSDP());
 		} else if(lines[0].contains(BYE)) {