# HG changeset patch # User Mychaela Falconia # Date 1665610720 28800 # Node ID c0a391f28e91d5b5f86ba3db4b3ffc0595a18176 # Parent 4b35a5a400f196d4aaf14ccba20084f9fbbcc411 sip-out: handle responses to UAC BYE diff -r 4b35a5a400f1 -r c0a391f28e91 sip-out/uac_resp.c --- a/sip-out/uac_resp.c Wed Oct 12 13:05:26 2022 -0800 +++ b/sip-out/uac_resp.c Wed Oct 12 13:38:40 2022 -0800 @@ -20,6 +20,29 @@ extern struct call *find_call_by_sip_id(); +extern unsigned sip_linger_bye_out_ok; +extern unsigned sip_linger_bye_out_err; + +void +handle_bye_response(call, msg, sin) + struct call *call; + struct sip_pkt_rx *msg; + struct sockaddr_in *sin; +{ + if (msg->status_code != 200) + syslog(LOG_ERR, "non-200 response to BYE: %.64s", + msg->status_str); + if (msg->status_code < 200) + return; + if (call->sip_state == SIP_STATE_BYE_SENT) { + call->sip_state = SIP_STATE_ENDED; + if (msg->status_code <= 299) + sip_mark_end_time(call, sip_linger_bye_out_ok); + else + sip_mark_end_time(call, sip_linger_bye_out_err); + } +} + void process_sip_response(msg, sin) struct sip_pkt_rx *msg;