diff sip-manual-out/main.c @ 120:c62d0f28da6f

sip-manual-out: make Max-Forwards configurable
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 29 Sep 2022 14:13:43 -0800
parents 056616f7e8ab
children 5dc0190a624e
line wrap: on
line diff
--- a/sip-manual-out/main.c	Thu Sep 29 14:03:06 2022 -0800
+++ b/sip-manual-out/main.c	Thu Sep 29 14:13:43 2022 -0800
@@ -25,6 +25,7 @@
 struct sockaddr_in sip_dest_sin;
 char from_uri[128], to_uri[128], call_id[128];
 struct timeval cur_event_time;
+unsigned max_forwards = 70;
 
 send_invite_req()
 {
@@ -68,11 +69,14 @@
 	int opt, rc;
 
 	logfile = 0;
-	while ((opt = getopt(argc, argv, "l:")) != EOF) {
+	while ((opt = getopt(argc, argv, "l:m:")) != EOF) {
 		switch (opt) {
 		case 'l':
 			logfile = optarg;
 			continue;
+		case 'm':
+			max_forwards = atoi(optarg);
+			continue;
 		default:
 		usage:
 			fprintf(stderr,