|
@@ -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)) {
|