# HG changeset patch # User Mychaela Falconia # Date 1663744490 28800 # Node ID f332ccc240f18d1ed5f75c660ed66ff3a0680f31 # Parent 70c3c8ebee33067b930d19cebe0931c516ef976d sip-in: preparations toward TMGW connect-through diff -r 70c3c8ebee33 -r f332ccc240f1 sip-in/mgw_ops.c --- a/sip-in/mgw_ops.c Tue Sep 20 22:47:53 2022 -0800 +++ b/sip-in/mgw_ops.c Tue Sep 20 23:14:50 2022 -0800 @@ -63,7 +63,7 @@ } void -tmgw_send_mdcx_gsm_rtp(call) +tmgw_send_mdcx_connect(call) struct call *call; { struct tmgw_ctrl_req req; @@ -72,11 +72,12 @@ req.opcode = TMGW_CTRL_OP_MDCX; req.transact_ref = get_new_tmgw_xact_id(); req.ep_id = call->mgw_ep_id; - req.setup_mask = TMGW_CTRL_MASK_GSM_CONN; + req.setup_mask = TMGW_CTRL_MASK_GSM_CONN | TMGW_CTRL_MASK_FWD_MODE; bcopy(&call->gsm_rtp_osmo, &req.gsm_addr, sizeof(struct sockaddr_storage)); req.gsm_payload_type = call->gsm_payload_type; req.gsm_payload_msg_type = call->gsm_payload_msg_type; + req.fwd_mode = TMGW_FWD_MODE_SENDRECV; send_req_to_tmgw(&req); call->mgw_state = MGW_STATE_CONNECTING; call->mgw_xact = TMGW_CTRL_OP_MDCX; diff -r 70c3c8ebee33 -r f332ccc240f1 sip-in/mncc_handle.c --- a/sip-in/mncc_handle.c Tue Sep 20 22:47:53 2022 -0800 +++ b/sip-in/mncc_handle.c Tue Sep 20 23:14:50 2022 -0800 @@ -52,6 +52,17 @@ } call->mncc_state = MNCC_STATE_ANSWERED; call->overall_state = OVERALL_STATE_ANSWERED; + /* right now we require MNCC_RTP_CREATE to have come first */ + if (!call->gsm_payload_msg_type) { + call->overall_state = OVERALL_STATE_TEARDOWN; + disconnect_mncc(call, GSM48_CAUSE_LOC_PRN_S_LU, + GSM48_CC_CAUSE_PROTO_ERR); + disconnect_tmgw(call); + strcpy(call->invite_fail, "502 Internal protocol error"); + signal_invite_error(call); + return; + } + /* TODO: send MDCX to themwi-mgw */ signal_invite_200(call); }