diff sip-manual-out/uas.c @ 148:b51247739897

sip-manual-out: attempt to play along with re-INVITEs
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 08 Oct 2022 23:52:08 -0800
parents 94b5831c017f
children
line wrap: on
line diff
--- a/sip-manual-out/uas.c	Sat Oct 08 23:01:32 2022 -0800
+++ b/sip-manual-out/uas.c	Sat Oct 08 23:52:08 2022 -0800
@@ -30,7 +30,7 @@
 			"sending 501 error: response length exceeded\n");
 		return;
 	}
-	rc = out_msg_add_header(&resp, "Allow", "BYE");
+	rc = out_msg_add_header(&resp, "Allow", "INVITE,ACK,BYE");
 	if (rc < 0)
 		goto too_long;
 	out_msg_finish(&resp);
@@ -52,10 +52,12 @@
 		return;
 	}
 	/* dispatch by method */
-	if (!strcmp(msg->req_method, "BYE"))
+	if (!strcmp(msg->req_method, "INVITE"))
+		handle_invite_req(msg, &ess, sin);
+	else if (!strcmp(msg->req_method, "ACK"))
+		printf("Received ACK request, swallowing it\n");
+	else if (!strcmp(msg->req_method, "BYE"))
 		handle_bye_req(msg, &ess, sin);
-	else if (!strcmp(msg->req_method, "ACK"))
-		printf("Received unexpected ACK, swallowing it\n");
 	else
 		unsupported_method(msg, &ess, sin);
 }