comparison sip-out/invite.c @ 163:bfa9f0c0f0ac

sip-out: handle incoming BYE as UAS
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 12 Oct 2022 14:45:31 -0800
parents 51cf5ea7f320
children
comparison
equal deleted inserted replaced
162:83022d408071 163:bfa9f0c0f0ac
150 msg->status_code); 150 msg->status_code);
151 call->overall_state = OVERALL_STATE_TEARDOWN; 151 call->overall_state = OVERALL_STATE_TEARDOWN;
152 disconnect_mncc(call, GSM48_CAUSE_LOC_PRN_S_LU, 152 disconnect_mncc(call, GSM48_CAUSE_LOC_PRN_S_LU,
153 GSM48_CC_CAUSE_DEST_OOO); 153 GSM48_CC_CAUSE_DEST_OOO);
154 disconnect_tmgw(call); 154 disconnect_tmgw(call);
155 call->sip_state = SIP_STATE_ENDED; 155 call->sip_state = SIP_STATE_MSG_SIZE_ERR;
156 sip_mark_end_time(call, sip_linger_response_err); 156 sip_mark_end_time(call, sip_linger_response_err);
157 return; 157 return;
158 } 158 }
159 if (tag) 159 if (tag)
160 strcpy(call->to_tag, tag); 160 strcpy(call->to_tag, tag);
210 rc = send_ack(call, tag, sin); 210 rc = send_ack(call, tag, sin);
211 if (rc < 0) { 211 if (rc < 0) {
212 syslog(LOG_CRIT, 212 syslog(LOG_CRIT,
213 "ACK to %03u response exceeds msg size!", 213 "ACK to %03u response exceeds msg size!",
214 msg->status_code); 214 msg->status_code);
215 call->sip_state = SIP_STATE_ENDED; 215 call->sip_state = SIP_STATE_MSG_SIZE_ERR;
216 sip_mark_end_time(call, sip_linger_response_err); 216 sip_mark_end_time(call, sip_linger_response_err);
217 return; 217 return;
218 } 218 }
219 if (tag) 219 if (tag)
220 strcpy(call->to_tag, tag); 220 strcpy(call->to_tag, tag);
221 initiate_bye(call); 221 initiate_bye(call);
222 return; 222 return;
223 case SIP_STATE_ENDED: 223 case SIP_STATE_ENDED:
224 case SIP_STATE_MSG_SIZE_ERR:
224 return; 225 return;
225 default: 226 default:
226 syslog(LOG_CRIT, 227 syslog(LOG_CRIT,
227 "FATAL: invalid SIP state 0x%x on INVITE %03u response", 228 "FATAL: invalid SIP state 0x%x on INVITE %03u response",
228 call->sip_state, msg->status_code); 229 call->sip_state, msg->status_code);
313 char *tag; 314 char *tag;
314 struct sockaddr_in *sin; 315 struct sockaddr_in *sin;
315 { 316 {
316 int rc; 317 int rc;
317 318
319 if (call->sip_state == SIP_STATE_MSG_SIZE_ERR)
320 return;
318 rc = send_ack(call, tag, sin); 321 rc = send_ack(call, tag, sin);
319 if (rc < 0) 322 if (rc < 0)
320 syslog(LOG_CRIT, "ACK to %03u response exceeds msg size!", 323 syslog(LOG_CRIT, "ACK to %03u response exceeds msg size!",
321 msg->status_code); 324 msg->status_code);
322 switch (call->sip_state) { 325 switch (call->sip_state) {