comparison sip-in/retrans.c @ 108:0d6435808bcd

sip-in: implement 100rel for 180 Ringing response
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 28 Sep 2022 14:29:10 -0800
parents 915f0f397fb6
children 9b87894704eb
comparison
equal deleted inserted replaced
107:372209628038 108:0d6435808bcd
25 struct call *call; 25 struct call *call;
26 struct sip_msg_out msg; 26 struct sip_msg_out msg;
27 27
28 for (call = call_list; call; call = call->next) { 28 for (call = call_list; call; call = call->next) {
29 switch (call->sip_state) { 29 switch (call->sip_state) {
30 case SIP_STATE_RINGING_REL:
31 if (call->sip_tx_count < cfg_retrans_count) {
32 start_response_out_msg(&msg, "180 Ringing");
33 fill_invite_resp_from_call(&msg, call);
34 out_msg_add_header(&msg, "Require", "100rel");
35 out_msg_add_header(&msg, "RSeq", "1");
36 out_msg_finish(&msg);
37 sip_tx_packet(&msg, &call->udp_sin);
38 call->sip_tx_count++;
39 } else {
40 call->overall_state = OVERALL_STATE_TEARDOWN;
41 disconnect_mncc(call, GSM48_CAUSE_LOC_PRN_S_LU,
42 GSM48_CC_CAUSE_INTERWORKING);
43 disconnect_tmgw(call);
44 strcpy(call->invite_fail,
45 "504 100rel retransmissions exhausted");
46 signal_invite_error(call);
47 }
48 break;
30 case SIP_STATE_INVITE_200: 49 case SIP_STATE_INVITE_200:
31 if (call->sip_tx_count < cfg_retrans_count) { 50 if (call->sip_tx_count < cfg_retrans_count) {
32 fill_invite_200_resp(&msg, call); 51 fill_invite_200_resp(&msg, call);
33 sip_tx_packet(&msg, &call->udp_sin); 52 sip_tx_packet(&msg, &call->udp_sin);
34 call->sip_tx_count++; 53 call->sip_tx_count++;