diff mtctest/sig_handler.c @ 39:64b9f0f90726

themwi-test-mtc: handle DTMF from MS
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 03 Sep 2022 14:44:19 -0800
parents e8e82a4bf12b
children 0967f67c6ac3
line wrap: on
line diff
--- a/mtctest/sig_handler.c	Sun Jul 10 00:36:31 2022 -0800
+++ b/mtctest/sig_handler.c	Sat Sep 03 14:44:19 2022 -0800
@@ -216,9 +216,16 @@
 	case MNCC_START_DTMF_IND:
 		printf("MNCC_START_DTMF_IND: MS sending DTMF start\n");
 		print_fields(msg);
-		msg->msg_type = MNCC_START_DTMF_REJ;
-		mncc_set_cause(msg, GSM48_CAUSE_LOC_PRN_S_LU,
-				GSM48_CC_CAUSE_SERV_OPT_UNIMPL);
+		if (msg->fields & MNCC_F_KEYPAD &&
+		    is_valid_dtmf_digit(msg->keypad)) {
+			printf("Responding with ACK\n");
+			msg->msg_type = MNCC_START_DTMF_RSP;
+		} else {
+			printf("Responding with Reject\n");
+			msg->msg_type = MNCC_START_DTMF_REJ;
+			mncc_set_cause(msg, GSM48_CAUSE_LOC_PRN_S_LU,
+					GSM48_CC_CAUSE_INVAL_MAND_INF);
+		}
 		send_mncc_to_gsm(msg, sizeof(struct gsm_mncc));
 		return;
 	case MNCC_STOP_DTMF_IND: