changeset 121:5dc0190a624e

sip-manual-out: add -r option for testing 100rel
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 29 Sep 2022 14:21:10 -0800
parents c62d0f28da6f
children 07e4cc5f824c
files sip-manual-out/main.c
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/sip-manual-out/main.c	Thu Sep 29 14:13:43 2022 -0800
+++ b/sip-manual-out/main.c	Thu Sep 29 14:21:10 2022 -0800
@@ -26,6 +26,7 @@
 char from_uri[128], to_uri[128], call_id[128];
 struct timeval cur_event_time;
 unsigned max_forwards = 70;
+int declare_100rel_supp;
 
 send_invite_req()
 {
@@ -44,6 +45,11 @@
 	rc = add_contact_header(&msg);
 	if (rc < 0)
 		goto msg_size_err;
+	if (declare_100rel_supp) {
+		rc = out_msg_add_header(&msg, "Supported", "100rel");
+		if (rc < 0)
+			goto msg_size_err;
+	}
 	rc = out_msg_add_header(&msg, "Content-Type", "application/sdp");
 	if (rc < 0)
 		goto msg_size_err;
@@ -69,7 +75,7 @@
 	int opt, rc;
 
 	logfile = 0;
-	while ((opt = getopt(argc, argv, "l:m:")) != EOF) {
+	while ((opt = getopt(argc, argv, "l:m:r")) != EOF) {
 		switch (opt) {
 		case 'l':
 			logfile = optarg;
@@ -77,6 +83,9 @@
 		case 'm':
 			max_forwards = atoi(optarg);
 			continue;
+		case 'r':
+			declare_100rel_supp = 1;
+			continue;
 		default:
 		usage:
 			fprintf(stderr,