Fixed descriptions of VTY interface commands.
[osmocom-bb.git] / src / host / layer23 / src / mnccms.c
1 /*
2  * (C) 2010 by Andreas Eversberg <jolly@eversberg.eu>
3  *
4  * All Rights Reserved
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  *
20  */
21
22 #include <stdint.h>
23 #include <errno.h>
24 #include <stdio.h>
25 #include <string.h>
26 #include <stdlib.h>
27
28 #include <osmocore/talloc.h>
29
30 #include <osmocom/logging.h>
31 #include <osmocom/osmocom_data.h>
32 #include <osmocom/mncc.h>
33
34 /*
35  * support functions
36  */
37
38 void mncc_set_cause(struct gsm_mncc *data, int loc, int val);
39
40 /*
41  * MNCCms dummy application
42  */
43
44 /* this is a minimal implementation as required by GSM 04.08 */
45 int mncc_recv_dummy(struct osmocom_ms *ms, int msg_type, void *arg)
46 {
47         struct gsm_mncc *data = arg;
48         int callref = data->callref;
49         struct gsm_mncc rel;
50
51         LOGP(DMNCC, LOGL_INFO, "Rejecting incomming call\n");
52
53         /* reject, as we don't support Calls */
54         memset(&rel, 0, sizeof(struct gsm_mncc));
55         rel.callref = callref;
56         mncc_set_cause(&rel, GSM48_CAUSE_LOC_USER,
57                 GSM48_CC_CAUSE_INCOMPAT_DEST);
58
59         return mncc_send(ms, MNCC_REL_REQ, &rel);
60 }
61
62