comparison sip-in/call_list.c @ 112:6aa63cf4620a

sip-in call clearing: select timeout implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 28 Sep 2022 18:59:55 -0800
parents 9b87894704eb
children
comparison
equal deleted inserted replaced
111:7a4d4b8d5f04 112:6aa63cf4620a
53 } 53 }
54 } 54 }
55 } 55 }
56 56
57 void 57 void
58 scan_call_list_for_timeouts(retrans) 58 scan_call_list_for_timeouts(retrans, dead_sip_flag, dead_sip_time)
59 int *retrans; 59 int *retrans, *dead_sip_flag;
60 time_t *dead_sip_time;
60 { 61 {
61 struct call *call; 62 struct call *call;
63 int got_dead_sip = 0;
62 64
63 for (call = call_list; call; call = call->next) { 65 for (call = call_list; call; call = call->next) {
64 switch (call->sip_state) { 66 switch (call->sip_state) {
65 case SIP_STATE_RINGING_REL: 67 case SIP_STATE_RINGING_REL:
66 case SIP_STATE_INVITE_200: 68 case SIP_STATE_INVITE_200:
67 case SIP_STATE_INVITE_ERR: 69 case SIP_STATE_INVITE_ERR:
68 case SIP_STATE_BYE_SENT: 70 case SIP_STATE_BYE_SENT:
69 *retrans = 1; 71 *retrans = 1;
70 break; 72 break;
73 case SIP_STATE_ENDED:
74 case SIP_STATE_MSG_SIZE_ERR:
75 if (call->overall_state != OVERALL_STATE_DEAD_SIP)
76 continue;
77 if (got_dead_sip) {
78 if (call->sip_clear_time < *dead_sip_time)
79 *dead_sip_time = call->sip_clear_time;
80 } else {
81 got_dead_sip = 1;
82 *dead_sip_flag = 1;
83 *dead_sip_time = call->sip_clear_time;
84 }
71 } 85 }
72 } 86 }
73 } 87 }