2009-10-26 19:42:55 +00:00
|
|
|
/* GSM Mobile Radio Interface Layer 3 messages on the A-bis interface
|
2009-10-16 06:32:58 +00:00
|
|
|
* 3GPP TS 04.08 version 7.21.0 Release 1998 / ETSI TS 100 940 V7.21.0 */
|
|
|
|
|
|
|
|
/* (C) 2008-2009 by Harald Welte <laforge@gnumonks.org>
|
2010-07-25 10:08:53 +00:00
|
|
|
* (C) 2008, 2009, 2010 by Holger Hans Peter Freyther <zecke@selfish.org>
|
2009-10-16 06:32:58 +00:00
|
|
|
* (C) 2009 by Mike Haben <michael.haben@btinternet.com>
|
|
|
|
*
|
|
|
|
* All Rights Reserved
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
2011-01-01 14:25:50 +00:00
|
|
|
* it under the terms of the GNU Affero General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2009-10-16 06:32:58 +00:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2011-01-01 14:25:50 +00:00
|
|
|
* GNU Affero General Public License for more details.
|
2009-10-16 06:32:58 +00:00
|
|
|
*
|
2011-01-01 14:25:50 +00:00
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2009-10-16 06:32:58 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2018-08-02 21:39:04 +00:00
|
|
|
#include <stdint.h>
|
2009-10-16 06:32:58 +00:00
|
|
|
#include <errno.h>
|
|
|
|
|
2017-09-04 13:04:35 +00:00
|
|
|
#include <osmocom/msc/gsm_04_80.h>
|
|
|
|
#include <osmocom/msc/msc_ifaces.h>
|
2009-10-16 06:32:58 +00:00
|
|
|
|
2018-08-02 21:39:04 +00:00
|
|
|
#include <osmocom/gsm/protocol/gsm_04_80.h>
|
2011-03-22 15:47:59 +00:00
|
|
|
#include <osmocom/gsm/gsm0480.h>
|
|
|
|
#include <osmocom/core/msgb.h>
|
|
|
|
#include <osmocom/gsm/tlv.h>
|
2010-09-30 10:48:28 +00:00
|
|
|
|
2018-06-12 01:03:53 +00:00
|
|
|
/*! Send a MT RELEASE COMPLETE message with Reject component
|
|
|
|
* (see section 3.6.1) and given error code (see section 3.6.7).
|
|
|
|
*
|
rename gsm_subscriber_connection to ran_conn
In preparation for inter-BSC and inter-MSC handover, we need to separate the
subscriber management logic from the actual RAN connections. What better time
to finally rename gsm_subscriber_connection.
* Name choice:
In 2G, this is a connection to the BSS, but even though 3GPP TS commonly talk
of "BSS-A" and "BSS-B" when explaining handover, it's not good to call it
"bss_conn": in 3G a BSS is called RNS, IIUC.
The overall term for 2G (GERAN) and 3G (UTRAN) is RAN: Radio Access Network.
* Rationale:
A subscriber in the MSC so far has only one RAN connection, but e.g. for
inter-BSC handover, a second one needs to be created to handover to. Most of
the items in the former gsm_subscriber_connection are actually related to the
RAN, with only a few MM and RTP related items. So, as a first step, just rename
it to ran_conn, to cosmetically prepare for moving the not strictly RAN related
items away later.
Also:
- Rename some functions from msc_subscr_conn_* to ran_conn_*
- Rename "Subscr_Conn" FSM instance name to "RAN_conn"
- Rename SUBSCR_CONN_* to RAN_CONN_*
Change-Id: Ic595f7a558d3553c067f77dc67543ab59659707a
2018-11-29 21:37:51 +00:00
|
|
|
* \param[in] conn Active RAN connection
|
2018-06-12 01:03:53 +00:00
|
|
|
* \param[in] transaction_id Transaction ID with TI flag set
|
|
|
|
* \param[in] invoke_id InvokeID of the request
|
|
|
|
* \param[in] problem_tag Problem code tag (table 3.13)
|
|
|
|
* \param[in] problem_code Problem code (tables 3.14-17)
|
|
|
|
* \return result of \ref msc_tx_dtap
|
|
|
|
*
|
|
|
|
* Note: if InvokeID is not available, e.g. when message parsing
|
|
|
|
* failed, any incorrect value can be passed (0x00 > x > 0xff), so
|
|
|
|
* the universal NULL-tag (see table 3.6) will be used instead.
|
|
|
|
*/
|
rename gsm_subscriber_connection to ran_conn
In preparation for inter-BSC and inter-MSC handover, we need to separate the
subscriber management logic from the actual RAN connections. What better time
to finally rename gsm_subscriber_connection.
* Name choice:
In 2G, this is a connection to the BSS, but even though 3GPP TS commonly talk
of "BSS-A" and "BSS-B" when explaining handover, it's not good to call it
"bss_conn": in 3G a BSS is called RNS, IIUC.
The overall term for 2G (GERAN) and 3G (UTRAN) is RAN: Radio Access Network.
* Rationale:
A subscriber in the MSC so far has only one RAN connection, but e.g. for
inter-BSC handover, a second one needs to be created to handover to. Most of
the items in the former gsm_subscriber_connection are actually related to the
RAN, with only a few MM and RTP related items. So, as a first step, just rename
it to ran_conn, to cosmetically prepare for moving the not strictly RAN related
items away later.
Also:
- Rename some functions from msc_subscr_conn_* to ran_conn_*
- Rename "Subscr_Conn" FSM instance name to "RAN_conn"
- Rename SUBSCR_CONN_* to RAN_CONN_*
Change-Id: Ic595f7a558d3553c067f77dc67543ab59659707a
2018-11-29 21:37:51 +00:00
|
|
|
int msc_send_ussd_reject(struct ran_conn *conn,
|
2018-06-12 01:03:53 +00:00
|
|
|
uint8_t transaction_id, int invoke_id,
|
|
|
|
uint8_t problem_tag, uint8_t problem_code)
|
2009-10-16 06:32:58 +00:00
|
|
|
{
|
|
|
|
struct gsm48_hdr *gh;
|
2018-08-02 21:39:04 +00:00
|
|
|
struct msgb *msg;
|
2009-10-16 06:32:58 +00:00
|
|
|
|
2018-08-02 21:39:04 +00:00
|
|
|
msg = gsm0480_gen_reject(invoke_id, problem_tag, problem_code);
|
|
|
|
if (!msg)
|
|
|
|
return -1;
|
2009-10-16 06:32:58 +00:00
|
|
|
|
|
|
|
/* Wrap the component in a Facility message */
|
2019-01-22 00:51:21 +00:00
|
|
|
msgb_push_tl(msg, GSM0480_IE_FACILITY);
|
2009-10-16 06:32:58 +00:00
|
|
|
|
|
|
|
/* And finally pre-pend the L3 header */
|
|
|
|
gh = (struct gsm48_hdr *) msgb_push(msg, sizeof(*gh));
|
2018-06-12 01:03:53 +00:00
|
|
|
gh->proto_discr = GSM48_PDISC_NC_SS;
|
|
|
|
gh->proto_discr |= transaction_id << 4;
|
2009-10-16 06:32:58 +00:00
|
|
|
gh->msg_type = GSM0480_MTYPE_RELEASE_COMPLETE;
|
|
|
|
|
2016-05-20 19:59:55 +00:00
|
|
|
return msc_tx_dtap(conn, msg);
|
2009-10-16 06:32:58 +00:00
|
|
|
}
|
2010-07-26 12:01:07 +00:00
|
|
|
|
rename gsm_subscriber_connection to ran_conn
In preparation for inter-BSC and inter-MSC handover, we need to separate the
subscriber management logic from the actual RAN connections. What better time
to finally rename gsm_subscriber_connection.
* Name choice:
In 2G, this is a connection to the BSS, but even though 3GPP TS commonly talk
of "BSS-A" and "BSS-B" when explaining handover, it's not good to call it
"bss_conn": in 3G a BSS is called RNS, IIUC.
The overall term for 2G (GERAN) and 3G (UTRAN) is RAN: Radio Access Network.
* Rationale:
A subscriber in the MSC so far has only one RAN connection, but e.g. for
inter-BSC handover, a second one needs to be created to handover to. Most of
the items in the former gsm_subscriber_connection are actually related to the
RAN, with only a few MM and RTP related items. So, as a first step, just rename
it to ran_conn, to cosmetically prepare for moving the not strictly RAN related
items away later.
Also:
- Rename some functions from msc_subscr_conn_* to ran_conn_*
- Rename "Subscr_Conn" FSM instance name to "RAN_conn"
- Rename SUBSCR_CONN_* to RAN_CONN_*
Change-Id: Ic595f7a558d3553c067f77dc67543ab59659707a
2018-11-29 21:37:51 +00:00
|
|
|
int msc_send_ussd_notify(struct ran_conn *conn, int level, const char *text)
|
2010-07-26 12:01:07 +00:00
|
|
|
{
|
2016-05-10 10:50:31 +00:00
|
|
|
struct msgb *msg = gsm0480_create_ussd_notify(level, text);
|
2010-07-26 12:01:07 +00:00
|
|
|
if (!msg)
|
|
|
|
return -1;
|
2016-05-20 19:59:55 +00:00
|
|
|
return msc_tx_dtap(conn, msg);
|
2010-07-26 12:01:07 +00:00
|
|
|
}
|
2010-07-26 19:31:50 +00:00
|
|
|
|
2018-11-28 18:20:58 +00:00
|
|
|
int msc_send_ussd_release_complete(struct ran_conn *conn,
|
|
|
|
uint8_t transaction_id)
|
2010-07-26 19:31:50 +00:00
|
|
|
{
|
2018-11-28 18:20:58 +00:00
|
|
|
struct msgb *msg = gsm0480_create_release_complete(transaction_id);
|
2010-07-26 19:31:50 +00:00
|
|
|
if (!msg)
|
|
|
|
return -1;
|
2016-05-20 19:59:55 +00:00
|
|
|
return msc_tx_dtap(conn, msg);
|
2010-07-26 19:31:50 +00:00
|
|
|
}
|
2019-02-06 10:54:21 +00:00
|
|
|
|
|
|
|
int msc_send_ussd_release_complete_cause(struct ran_conn *conn,
|
|
|
|
uint8_t transaction_id,
|
|
|
|
uint8_t cause_loc, uint8_t cause_val)
|
|
|
|
{
|
|
|
|
struct msgb *msg;
|
|
|
|
uint8_t *cause_ie;
|
|
|
|
|
|
|
|
msg = gsm0480_create_release_complete(transaction_id);
|
|
|
|
if (!msg)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
/* Encode cause IE (see GSM 04.08, section 10.5.4.11)
|
|
|
|
* with fixed length (2 bytes of TL, 2 bytes of payload).
|
|
|
|
* NOTE: we don't use gsm48_encode_cause() API because
|
|
|
|
* it wants gsm_mncc_cause struct from us. */
|
|
|
|
cause_ie = msgb_put(msg, 2 + 2);
|
|
|
|
cause_ie[0] = GSM48_IE_CAUSE;
|
|
|
|
cause_ie[1] = 2;
|
|
|
|
|
|
|
|
/* Coding standard defined for the GSM PLMNs,
|
|
|
|
* location and cause: as given by caller,
|
|
|
|
* no extension, no diagnostics. */
|
|
|
|
cause_ie[2] = (1 << 7) | (0x03 << 5) | (cause_loc & 0x0f);
|
|
|
|
cause_ie[3] = (1 << 7) | cause_val;
|
|
|
|
|
|
|
|
return msc_tx_dtap(conn, msg);
|
|
|
|
}
|