changeset 78:72b7d85d6354

sip-in: retransmission error handling
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 20 Sep 2022 18:00:56 -0800
parents fe39404092d9
children b0df2b200d77
files sip-in/retrans.c
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/sip-in/retrans.c	Tue Sep 20 16:49:24 2022 -0800
+++ b/sip-in/retrans.c	Tue Sep 20 18:00:56 2022 -0800
@@ -12,6 +12,7 @@
 #include <string.h>
 #include <strings.h>
 #include <syslog.h>
+#include "../include/gsm48_const.h"
 #include "../libsip/out_msg.h"
 #include "call.h"
 
@@ -31,8 +32,14 @@
 				fill_invite_200_resp(&msg, call);
 				sip_tx_packet(&msg, &call->udp_sin);
 				call->sip_tx_count++;
-			} else
-				/* error handling to be implemented */;
+			} else {
+				/* TODO: send BYE */
+				call->sip_state = SIP_STATE_ENDED;
+				call->overall_state = OVERALL_STATE_TEARDOWN;
+				disconnect_mncc(call, GSM48_CAUSE_LOC_PRN_S_LU,
+						GSM48_CC_CAUSE_INTERWORKING);
+				disconnect_tmgw(call);
+			}
 			break;
 		case SIP_STATE_INVITE_ERR:
 			if (call->sip_tx_count < cfg_retrans_count) {
@@ -42,7 +49,7 @@
 				sip_tx_packet(&msg, &call->udp_sin);
 				call->sip_tx_count++;
 			} else
-				/* error handling to be implemented */;
+				call->sip_state = SIP_STATE_ENDED;
 			break;
 		}
 	}