comparison sip-out/uac_resp.c @ 161:c0a391f28e91

sip-out: handle responses to UAC BYE
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 12 Oct 2022 13:38:40 -0800
parents 0bacca1f2f7b
children 83022d408071
comparison
equal deleted inserted replaced
160:4b35a5a400f1 161:c0a391f28e91
17 #include "../libsip/parse.h" 17 #include "../libsip/parse.h"
18 #include "../libsip/resp_ident.h" 18 #include "../libsip/resp_ident.h"
19 #include "call.h" 19 #include "call.h"
20 20
21 extern struct call *find_call_by_sip_id(); 21 extern struct call *find_call_by_sip_id();
22
23 extern unsigned sip_linger_bye_out_ok;
24 extern unsigned sip_linger_bye_out_err;
25
26 void
27 handle_bye_response(call, msg, sin)
28 struct call *call;
29 struct sip_pkt_rx *msg;
30 struct sockaddr_in *sin;
31 {
32 if (msg->status_code != 200)
33 syslog(LOG_ERR, "non-200 response to BYE: %.64s",
34 msg->status_str);
35 if (msg->status_code < 200)
36 return;
37 if (call->sip_state == SIP_STATE_BYE_SENT) {
38 call->sip_state = SIP_STATE_ENDED;
39 if (msg->status_code <= 299)
40 sip_mark_end_time(call, sip_linger_bye_out_ok);
41 else
42 sip_mark_end_time(call, sip_linger_bye_out_err);
43 }
44 }
22 45
23 void 46 void
24 process_sip_response(msg, sin) 47 process_sip_response(msg, sin)
25 struct sip_pkt_rx *msg; 48 struct sip_pkt_rx *msg;
26 struct sockaddr_in *sin; 49 struct sockaddr_in *sin;