# HG changeset patch
# User Mychaela Falconia <falcon@freecalypso.org>
# Date 1663988708 28800
# Node ID fd23e2747b4511e95ff98757dc08bbc0d801ab8a
# Parent  736c2d68595f71132c0dce308ede1aaa5e3bed37
sip-in: add sip-udp-retrans configuration setting

diff -r 736c2d68595f -r fd23e2747b45 sip-in/readconf.c
--- a/sip-in/readconf.c	Fri Sep 23 18:53:35 2022 -0800
+++ b/sip-in/readconf.c	Fri Sep 23 19:05:08 2022 -0800
@@ -106,6 +106,31 @@
 }
 
 static void
+handle_retrans_conf(st, kw, arg)
+	struct parse_state *st;
+	char *kw, *arg;
+{
+	char *cp = arg;
+
+	if (!isdigit(*cp)) {
+inv:		fprintf(stderr,
+		"%s line %d: %s setting requires two numeric arguments\n",
+			config_file_pathname, st->lineno, kw);
+		exit(1);
+	}
+	cfg_retrans_timeout = strtoul(cp, &cp, 10);
+	while (isspace(*cp))
+		cp++;
+	if (!isdigit(*cp))
+		goto inv;
+	cfg_retrans_count = strtoul(cp, &cp, 10);
+	while (isspace(*cp))
+		cp++;
+	if (*cp != '\0' && *cp != '#')
+		goto inv;
+}
+
+static void
 process_line(st, line)
 	struct parse_state *st;
 	char *line;
@@ -139,6 +164,10 @@
 		handler = handle_bool;
 		var = &cfg_use_100rel;
 		set_id = 0;
+	} else if (!strcmp(kw, "sip-udp-retrans")) {
+		handler = handle_retrans_conf;
+		var = (void *) 0;
+		set_id = 0;
 	} else {
 		fprintf(stderr, "%s line %d: non-understood keyword \"%s\"\n",
 			config_file_pathname, st->lineno, kw);