FreeCalypso > hg > themwi-system-sw
comparison 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 |
comparison
equal
deleted
inserted
replaced
91:fd23e2747b45 | 92:a9137bdb6047 |
---|---|
19 extern char *get_single_header(); | 19 extern char *get_single_header(); |
20 extern struct call *find_call_by_sip_id(); | 20 extern struct call *find_call_by_sip_id(); |
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 unsigned max_forwards; | |
24 | 25 |
25 fill_bye_out_msg(msg, call) | 26 fill_bye_out_msg(msg, call) |
26 struct sip_msg_out *msg; | 27 struct sip_msg_out *msg; |
27 struct call *call; | 28 struct call *call; |
28 { | 29 { |
48 if (rc < 0) | 49 if (rc < 0) |
49 return rc; | 50 return rc; |
50 rc = out_msg_add_header(msg, "CSeq", "1 BYE"); | 51 rc = out_msg_add_header(msg, "CSeq", "1 BYE"); |
51 if (rc < 0) | 52 if (rc < 0) |
52 return rc; | 53 return rc; |
53 rc = out_msg_add_header(msg, "Max-Forwards", "70"); | 54 sprintf(strbuf, "%u", max_forwards); |
55 rc = out_msg_add_header(msg, "Max-Forwards", strbuf); | |
54 if (rc < 0) | 56 if (rc < 0) |
55 return rc; | 57 return rc; |
56 out_msg_finish(msg); | 58 out_msg_finish(msg); |
57 return 0; | 59 return 0; |
58 } | 60 } |