comparison sip-in/retrans.c @ 81:915f0f397fb6

sip-in: beginning of outgoing BYE support
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 20 Sep 2022 20:11:44 -0800
parents 72b7d85d6354
children 0d6435808bcd
comparison
equal deleted inserted replaced
80:a9944b66dcc5 81:915f0f397fb6
31 if (call->sip_tx_count < cfg_retrans_count) { 31 if (call->sip_tx_count < cfg_retrans_count) {
32 fill_invite_200_resp(&msg, call); 32 fill_invite_200_resp(&msg, call);
33 sip_tx_packet(&msg, &call->udp_sin); 33 sip_tx_packet(&msg, &call->udp_sin);
34 call->sip_tx_count++; 34 call->sip_tx_count++;
35 } else { 35 } else {
36 /* TODO: send BYE */
37 call->sip_state = SIP_STATE_ENDED;
38 call->overall_state = OVERALL_STATE_TEARDOWN; 36 call->overall_state = OVERALL_STATE_TEARDOWN;
39 disconnect_mncc(call, GSM48_CAUSE_LOC_PRN_S_LU, 37 disconnect_mncc(call, GSM48_CAUSE_LOC_PRN_S_LU,
40 GSM48_CC_CAUSE_INTERWORKING); 38 GSM48_CC_CAUSE_INTERWORKING);
41 disconnect_tmgw(call); 39 disconnect_tmgw(call);
40 initiate_bye(call);
42 } 41 }
43 break; 42 break;
44 case SIP_STATE_INVITE_ERR: 43 case SIP_STATE_INVITE_ERR:
45 if (call->sip_tx_count < cfg_retrans_count) { 44 if (call->sip_tx_count < cfg_retrans_count) {
46 start_response_out_msg(&msg, call->invite_fail); 45 start_response_out_msg(&msg, call->invite_fail);
49 sip_tx_packet(&msg, &call->udp_sin); 48 sip_tx_packet(&msg, &call->udp_sin);
50 call->sip_tx_count++; 49 call->sip_tx_count++;
51 } else 50 } else
52 call->sip_state = SIP_STATE_ENDED; 51 call->sip_state = SIP_STATE_ENDED;
53 break; 52 break;
53 case SIP_STATE_BYE_SENT:
54 if (call->sip_tx_count < cfg_retrans_count) {
55 fill_bye_out_msg(&msg, call);
56 sip_tx_packet(&msg, &call->udp_sin);
57 call->sip_tx_count++;
58 } else
59 call->sip_state = SIP_STATE_ENDED;
60 break;
54 } 61 }
55 } 62 }
56 } 63 }