changeset 140:01fe81914bd6

sip-in: move MNCC_RTP_CONNECT sending to answer time
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 08 Oct 2022 11:48:26 -0800
parents c731ec342ba0
children e499e8db8b82
files sip-in/mncc_handle.c
diffstat 1 files changed, 14 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/sip-in/mncc_handle.c	Fri Oct 07 23:25:38 2022 -0800
+++ b/sip-in/mncc_handle.c	Sat Oct 08 11:48:26 2022 -0800
@@ -80,6 +80,19 @@
 }
 
 static void
+send_rtp_connect(call)
+	struct call *call;
+{
+	struct gsm_mncc_rtp rtp;
+
+	bzero(&rtp, sizeof(struct gsm_mncc_rtp));
+	rtp.msg_type = MNCC_RTP_CONNECT;
+	rtp.callref = call->mncc_callref;
+	bcopy(&call->gsm_rtp_tmgw, &rtp.addr, sizeof(struct sockaddr_storage));
+	send_mncc_to_gsm(&rtp, sizeof(struct gsm_mncc_rtp));
+}
+
+static void
 handle_alerting(call, msg)
 	struct call *call;
 	struct gsm_mncc *msg;
@@ -117,6 +130,7 @@
 		signal_invite_error(call);
 		return;
 	}
+	send_rtp_connect(call);
 	tmgw_send_mdcx_connect(call);
 }
 
@@ -284,10 +298,6 @@
 	bcopy(&msg->addr, &call->gsm_rtp_osmo, sizeof(struct sockaddr_storage));
 	call->gsm_payload_type = msg->payload_type;
 	call->gsm_payload_msg_type = msg->payload_msg_type;
-	/* respond with MNCC_RTP_CONNECT */
-	msg->msg_type = MNCC_RTP_CONNECT;
-	bcopy(&call->gsm_rtp_tmgw, &msg->addr, sizeof(struct sockaddr_storage));
-	send_mncc_to_gsm(msg, sizeof(struct gsm_mncc_rtp));
 }
 
 void