comparison 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
comparison
equal deleted inserted replaced
119:056616f7e8ab 120:c62d0f28da6f
20 extern char *extract_to_tag(); 20 extern char *extract_to_tag();
21 21
22 extern struct in_addr sip_bind_ip; 22 extern struct in_addr sip_bind_ip;
23 extern unsigned sip_bind_port; 23 extern unsigned sip_bind_port;
24 extern char call_id[], from_uri[], to_uri[]; 24 extern char call_id[], from_uri[], to_uri[];
25 extern unsigned max_forwards;
25 26
26 char to_tag[MAX_TO_TAG+1]; 27 char to_tag[MAX_TO_TAG+1];
27 28
28 add_req_boilerplate(msg, cseq) 29 add_req_boilerplate(msg, cseq)
29 struct sip_msg_out *msg; 30 struct sip_msg_out *msg;
51 if (rc < 0) 52 if (rc < 0)
52 return rc; 53 return rc;
53 rc = out_msg_add_header(msg, "CSeq", cseq); 54 rc = out_msg_add_header(msg, "CSeq", cseq);
54 if (rc < 0) 55 if (rc < 0)
55 return rc; 56 return rc;
56 return out_msg_add_header(msg, "Max-Forwards", "70"); 57 sprintf(strbuf, "%u", max_forwards);
58 return out_msg_add_header(msg, "Max-Forwards", strbuf);
57 } 59 }
58 60
59 add_contact_header(msg) 61 add_contact_header(msg)
60 struct sip_msg_out *msg; 62 struct sip_msg_out *msg;
61 { 63 {