diff sip-manual-out/uac.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 a4450ae8fd09
children a36b731bfef9
line wrap: on
line diff
--- a/sip-manual-out/uac.c	Thu Sep 29 14:03:06 2022 -0800
+++ b/sip-manual-out/uac.c	Thu Sep 29 14:13:43 2022 -0800
@@ -22,6 +22,7 @@
 extern struct in_addr sip_bind_ip;
 extern unsigned sip_bind_port;
 extern char call_id[], from_uri[], to_uri[];
+extern unsigned max_forwards;
 
 char to_tag[MAX_TO_TAG+1];
 
@@ -53,7 +54,8 @@
 	rc = out_msg_add_header(msg, "CSeq", cseq);
 	if (rc < 0)
 		return rc;
-	return out_msg_add_header(msg, "Max-Forwards", "70");
+	sprintf(strbuf, "%u", max_forwards);
+	return out_msg_add_header(msg, "Max-Forwards", strbuf);
 }
 
 add_contact_header(msg)