# HG changeset patch # User Mychaela Falconia # Date 1663546651 28800 # Node ID 5beb51de1baeca6bb58314f10df535baeb97c87b # Parent 7c0309df59f832f1a30cc87aa1d255d30f5bd5e9 sip-in: got as far as propagating GSM CC CONNECT to INVITE 200 diff -r 7c0309df59f8 -r 5beb51de1bae sip-in/disconnect.c --- a/sip-in/disconnect.c Sun Sep 18 15:44:22 2022 -0800 +++ b/sip-in/disconnect.c Sun Sep 18 16:17:31 2022 -0800 @@ -12,7 +12,6 @@ #include #include #include "../include/mncc.h" -#include "../include/gsm48_const.h" #include "call.h" void diff -r 7c0309df59f8 -r 5beb51de1bae sip-in/invite.c --- a/sip-in/invite.c Sun Sep 18 15:44:22 2022 -0800 +++ b/sip-in/invite.c Sun Sep 18 16:17:31 2022 -0800 @@ -12,6 +12,7 @@ #include #include #include +#include "../include/gsm48_const.h" #include "../libsip/parse.h" #include "../libsip/uas_basic.h" #include "../libsip/grok_from.h" @@ -365,6 +366,29 @@ } void +signal_invite_200(call) + struct call *call; +{ + struct sip_msg_out resp; + int rc; + + rc = fill_invite_200_resp(&resp, call); + if (rc < 0) { + syslog(LOG_ERR, "INVITE 200 response length exceeded"); + call->sip_state = SIP_STATE_MSG_SIZE_ERR; + call->overall_state = OVERALL_STATE_TEARDOWN; + disconnect_mncc(call, GSM48_CAUSE_LOC_PRN_S_LU, + GSM48_CC_CAUSE_INTERWORKING); + disconnect_tmgw(call); + /* TODO: transition from TEARDOWN to DEAD_SIP */ + return; + } + sip_tx_packet(&resp, &call->udp_sin); + call->sip_state = SIP_STATE_INVITE_200; + call->sip_tx_count = 1; +} + +void signal_invite_error(call) struct call *call; { diff -r 7c0309df59f8 -r 5beb51de1bae sip-in/mncc_handle.c --- a/sip-in/mncc_handle.c Sun Sep 18 15:44:22 2022 -0800 +++ b/sip-in/mncc_handle.c Sun Sep 18 16:17:31 2022 -0800 @@ -38,7 +38,15 @@ struct call *call; struct gsm_mncc *msg; { - /* handling to be implemented */ + if (call->mncc_state != MNCC_STATE_STARTED && + call->mncc_state != MNCC_STATE_ALERTING) { + syslog(LOG_ERR, "MNCC_SETUP_CNF in wrong MNCC state 0x%x", + call->mncc_state); + return; + } + call->mncc_state = MNCC_STATE_ANSWERED; + call->overall_state = OVERALL_STATE_ANSWERED; + signal_invite_200(call); } static void