diff sip-in/bye_out.c @ 92:a9137bdb6047

sip-in: make BYE Max-Forwards configurable
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 23 Sep 2022 19:18:07 -0800
parents ff4b76a107a1
children 2c22b40408fb
line wrap: on
line diff
--- a/sip-in/bye_out.c	Fri Sep 23 19:05:08 2022 -0800
+++ b/sip-in/bye_out.c	Fri Sep 23 19:18:07 2022 -0800
@@ -21,6 +21,7 @@
 
 extern struct in_addr sip_bind_ip;
 extern unsigned sip_bind_port;
+extern unsigned max_forwards;
 
 fill_bye_out_msg(msg, call)
 	struct sip_msg_out *msg;
@@ -50,7 +51,8 @@
 	rc = out_msg_add_header(msg, "CSeq", "1 BYE");
 	if (rc < 0)
 		return rc;
-	rc = out_msg_add_header(msg, "Max-Forwards", "70");
+	sprintf(strbuf, "%u", max_forwards);
+	rc = out_msg_add_header(msg, "Max-Forwards", strbuf);
 	if (rc < 0)
 		return rc;
 	out_msg_finish(msg);