changeset 65:7c0309df59f8

sip-in: handling of ALERTING state
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 18 Sep 2022 15:44:22 -0800
parents 1f863c63f96b
children 5beb51de1bae
files sip-in/invite.c sip-in/mncc_handle.c
diffstat 2 files changed, 21 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/sip-in/invite.c	Sun Sep 18 15:29:30 2022 -0800
+++ b/sip-in/invite.c	Sun Sep 18 15:44:22 2022 -0800
@@ -352,6 +352,19 @@
 }
 
 void
+signal_invite_ringing(call)
+	struct call *call;
+{
+	struct sip_msg_out resp;
+
+	start_response_out_msg(&resp, "180 Ringing");
+	fill_invite_resp_from_call(&resp, call);
+	out_msg_finish(&resp);
+	sip_tx_packet(&resp, &call->udp_sin);
+	call->sip_state = SIP_STATE_RINGING;
+}
+
+void
 signal_invite_error(call)
 	struct call *call;
 {
--- a/sip-in/mncc_handle.c	Sun Sep 18 15:29:30 2022 -0800
+++ b/sip-in/mncc_handle.c	Sun Sep 18 15:44:22 2022 -0800
@@ -23,7 +23,14 @@
 	struct call *call;
 	struct gsm_mncc *msg;
 {
-	/* handling to be implemented */
+	if (call->mncc_state != MNCC_STATE_STARTED) {
+		syslog(LOG_ERR, "MNCC_ALERT_IND in wrong MNCC state 0x%x",
+			call->mncc_state);
+		return;
+	}
+	call->mncc_state = MNCC_STATE_ALERTING;
+	call->overall_state = OVERALL_STATE_ALERTING;
+	signal_invite_ringing(call);
 }
 
 static void