summaryrefslogtreecommitdiffstats
path: root/src/host
diff options
context:
space:
mode:
authorAndreas.Eversberg <jolly@eversberg.eu>2010-10-12 09:40:05 +0000
committerAndreas.Eversberg <jolly@eversberg.eu>2010-10-12 09:40:05 +0000
commit651698abca3bb7ec6e405e60e308d8a73b63b4f3 (patch)
tree5beaa96077a59e3e09443952eb7cecfc92585492 /src/host
parent2a5e0f3cb7a4713e0aedb4c75878765978ebce02 (diff)
[layer23] Call control is disabled when mobile is set to SDCCH only
On SDCCH only mobiles, incomming calls must be rejected by a minimal call control implementation, even if basic calls are not supported.
Diffstat (limited to 'src/host')
-rw-r--r--src/host/layer23/src/mobile/app_mobile.c8
-rw-r--r--src/host/layer23/src/mobile/vty_interface.c12
2 files changed, 19 insertions, 1 deletions
diff --git a/src/host/layer23/src/mobile/app_mobile.c b/src/host/layer23/src/mobile/app_mobile.c
index 924b6c09..8d3ea8a9 100644
--- a/src/host/layer23/src/mobile/app_mobile.c
+++ b/src/host/layer23/src/mobile/app_mobile.c
@@ -51,6 +51,7 @@ extern int vty_reading;
int mobile_started = 0;
int mncc_recv_mobile(struct osmocom_ms *ms, int msg_type, void *arg);
+int mncc_recv_dummy(struct osmocom_ms *ms, int msg_type, void *arg);
int mobile_work(struct osmocom_ms *ms)
{
@@ -179,7 +180,6 @@ int l23_app_init(struct osmocom_ms *ms)
gsm48_rr_init(ms);
gsm48_mm_init(ms);
INIT_LLIST_HEAD(&ms->trans_list);
- ms->cclayer.mncc_recv = mncc_recv_mobile;
gsm322_init(ms);
l23_app_work = mobile_work;
@@ -202,6 +202,12 @@ int l23_app_init(struct osmocom_ms *ms)
telnet_init(l23_ctx, NULL, vty_port);
if (rc < 0)
return rc;
+
+ if (ms->settings.ch_cap == GSM_CAP_SDCCH)
+ ms->cclayer.mncc_recv = mncc_recv_dummy;
+ else
+ ms->cclayer.mncc_recv = mncc_recv_mobile;
+
printf("VTY available on port %u.\n", vty_port);
gsm_random_imei(&ms->settings);
diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c
index e3d34fe0..affbe15c 100644
--- a/src/host/layer23/src/mobile/vty_interface.c
+++ b/src/host/layer23/src/mobile/vty_interface.c
@@ -629,11 +629,19 @@ DEFUN(call, call_cmd, "call MS_NAME (NUMBER|emergency|answer|hangup|hold)",
"Hold current active call\n")
{
struct osmocom_ms *ms;
+ struct gsm_settings *set;
int i;
ms = get_ms(argv[0], vty);
if (!ms)
return CMD_WARNING;
+ set = &ms->settings;
+
+ if (set->ch_cap == GSM_CAP_SDCCH) {
+ vty_out(vty, "Basic call is not supported for SDCCH only "
+ "mobile%s", VTY_NEWLINE);
+ return CMD_WARNING;
+ }
if (!strcmp(argv[1], "emergency"))
mncc_call(ms, (char *)argv[1]);
@@ -1491,6 +1499,10 @@ DEFUN(cfg_ms_sup_ch_cap, cfg_ms_sup_ch_cap_cmd, "channel-capability "
return CMD_WARNING;
}
+ if (ch_cap != set->ch_cap
+ && (ch_cap == GSM_CAP_SDCCH || set->ch_cap == GSM_CAP_SDCCH))
+ vty_restart(vty);
+
set->ch_cap = ch_cap;
return CMD_SUCCESS;