blob: 44f7a74e887986037e1ad33138f29a48f49ba3e3 [file] [log] [blame]
Harald Welte4bfdfe72009-06-10 23:11:52 +08001/* GSM Mobile Radio Interface Layer 3 messages on the A-bis interface
2 * 3GPP TS 04.08 version 7.21.0 Release 1998 / ETSI TS 100 940 V7.21.0 */
3
4/* (C) 2008-2009 by Harald Welte <laforge@gnumonks.org>
5 * (C) 2008, 2009 by Holger Hans Peter Freyther <zecke@selfish.org>
6 *
7 * All Rights Reserved
8 *
9 * This program is free software; you can redistribute it and/or modify
Harald Welte9af6ddf2011-01-01 15:25:50 +010010 * it under the terms of the GNU Affero General Public License as published by
11 * the Free Software Foundation; either version 3 of the License, or
Harald Welte4bfdfe72009-06-10 23:11:52 +080012 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Harald Welte9af6ddf2011-01-01 15:25:50 +010017 * GNU Affero General Public License for more details.
Harald Welte4bfdfe72009-06-10 23:11:52 +080018 *
Harald Welte9af6ddf2011-01-01 15:25:50 +010019 * You should have received a copy of the GNU Affero General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
Harald Welte4bfdfe72009-06-10 23:11:52 +080021 *
22 */
23
24#ifndef _MNCC_H
25#define _MNCC_H
26
Harald Weltedfe6c7d2010-02-20 16:24:02 +010027#include <osmocore/linuxlist.h>
Harald Welte55c8f352010-03-07 23:40:35 +010028#include <osmocore/mncc.h>
Harald Welte4bfdfe72009-06-10 23:11:52 +080029
Sylvain Munaut98b53cb2010-12-01 22:38:51 +010030struct gsm_network;
31
32
Harald Welte4bfdfe72009-06-10 23:11:52 +080033/* One end of a call */
34struct gsm_call {
35 struct llist_head entry;
36
37 /* network handle */
38 void *net;
39
40 /* the 'local' transaction */
41 u_int32_t callref;
42 /* the 'remote' transaction */
43 u_int32_t remote_ref;
44};
45
46#define MNCC_SETUP_REQ 0x0101
47#define MNCC_SETUP_IND 0x0102
48#define MNCC_SETUP_RSP 0x0103
49#define MNCC_SETUP_CNF 0x0104
50#define MNCC_SETUP_COMPL_REQ 0x0105
51#define MNCC_SETUP_COMPL_IND 0x0106
52/* MNCC_REJ_* is perfomed via MNCC_REL_* */
53#define MNCC_CALL_CONF_IND 0x0107
54#define MNCC_CALL_PROC_REQ 0x0108
55#define MNCC_PROGRESS_REQ 0x0109
56#define MNCC_ALERT_REQ 0x010a
57#define MNCC_ALERT_IND 0x010b
58#define MNCC_NOTIFY_REQ 0x010c
59#define MNCC_NOTIFY_IND 0x010d
60#define MNCC_DISC_REQ 0x010e
61#define MNCC_DISC_IND 0x010f
62#define MNCC_REL_REQ 0x0110
63#define MNCC_REL_IND 0x0111
64#define MNCC_REL_CNF 0x0112
65#define MNCC_FACILITY_REQ 0x0113
66#define MNCC_FACILITY_IND 0x0114
67#define MNCC_START_DTMF_IND 0x0115
68#define MNCC_START_DTMF_RSP 0x0116
69#define MNCC_START_DTMF_REJ 0x0117
70#define MNCC_STOP_DTMF_IND 0x0118
71#define MNCC_STOP_DTMF_RSP 0x0119
72#define MNCC_MODIFY_REQ 0x011a
73#define MNCC_MODIFY_IND 0x011b
74#define MNCC_MODIFY_RSP 0x011c
75#define MNCC_MODIFY_CNF 0x011d
76#define MNCC_MODIFY_REJ 0x011e
77#define MNCC_HOLD_IND 0x011f
78#define MNCC_HOLD_CNF 0x0120
79#define MNCC_HOLD_REJ 0x0121
80#define MNCC_RETRIEVE_IND 0x0122
81#define MNCC_RETRIEVE_CNF 0x0123
82#define MNCC_RETRIEVE_REJ 0x0124
83#define MNCC_USERINFO_REQ 0x0125
84#define MNCC_USERINFO_IND 0x0126
85#define MNCC_REJ_REQ 0x0127
86#define MNCC_REJ_IND 0x0128
87
88#define MNCC_BRIDGE 0x0200
89#define MNCC_FRAME_RECV 0x0201
90#define MNCC_FRAME_DROP 0x0202
91#define MNCC_LCHAN_MODIFY 0x0203
92
Harald Welteda7ab742009-12-19 22:23:05 +010093#define GSM_TCHF_FRAME 0x0300
Harald Welteaca8f152009-12-19 23:06:41 +010094#define GSM_TCHF_FRAME_EFR 0x0301
Harald Welte4bfdfe72009-06-10 23:11:52 +080095
96#define GSM_MAX_FACILITY 128
97#define GSM_MAX_SSVERSION 128
98#define GSM_MAX_USERUSER 128
99
100#define MNCC_F_BEARER_CAP 0x0001
101#define MNCC_F_CALLED 0x0002
102#define MNCC_F_CALLING 0x0004
103#define MNCC_F_REDIRECTING 0x0008
104#define MNCC_F_CONNECTED 0x0010
105#define MNCC_F_CAUSE 0x0020
106#define MNCC_F_USERUSER 0x0040
107#define MNCC_F_PROGRESS 0x0080
108#define MNCC_F_EMERGENCY 0x0100
109#define MNCC_F_FACILITY 0x0200
110#define MNCC_F_SSVERSION 0x0400
111#define MNCC_F_CCCAP 0x0800
112#define MNCC_F_KEYPAD 0x1000
113#define MNCC_F_SIGNAL 0x2000
114
Harald Welte4bfdfe72009-06-10 23:11:52 +0800115struct gsm_mncc {
116 /* context based information */
117 u_int32_t msg_type;
118 u_int32_t callref;
119
120 /* which fields are present */
121 u_int32_t fields;
122
123 /* data derived informations (MNCC_F_ based) */
124 struct gsm_mncc_bearer_cap bearer_cap;
125 struct gsm_mncc_number called;
126 struct gsm_mncc_number calling;
127 struct gsm_mncc_number redirecting;
128 struct gsm_mncc_number connected;
129 struct gsm_mncc_cause cause;
130 struct gsm_mncc_progress progress;
131 struct gsm_mncc_useruser useruser;
132 struct gsm_mncc_facility facility;
133 struct gsm_mncc_cccap cccap;
134 struct gsm_mncc_ssversion ssversion;
135 struct {
136 int sup;
137 int inv;
138 } clir;
139 int signal;
140
141 /* data derived information, not MNCC_F based */
142 int keypad;
143 int more;
144 int notify; /* 0..127 */
145 int emergency;
Andreas Eversbergc079be42009-06-15 23:22:09 +0200146 char imsi[16];
Harald Welte4bfdfe72009-06-10 23:11:52 +0800147
148 unsigned char lchan_mode;
149};
150
Harald Welteda7ab742009-12-19 22:23:05 +0100151struct gsm_data_frame {
Harald Welte4bfdfe72009-06-10 23:11:52 +0800152 u_int32_t msg_type;
153 u_int32_t callref;
154 unsigned char data[0];
155};
156
157char *get_mncc_name(int value);
158int mncc_recv(struct gsm_network *net, int msg_type, void *arg);
159void mncc_set_cause(struct gsm_mncc *data, int loc, int val);
160
161#endif