aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-08-13 16:05:44 +0200
committerHarald Welte <laforge@gnumonks.org>2011-08-13 16:05:44 +0200
commitcda48bc32655546554062284e6c1fdd418a7ccbe (patch)
tree4c54ed8616fab64c7182092ee0a9f3c09ba38bae
parent4aadd1d7f09d3b8d7d26b2c06798e73921d3f20f (diff)
Wire up RRLP for silent call and add VTY commands
-rw-r--r--openbsc/include/openbsc/gsm_data.h2
-rw-r--r--openbsc/include/openbsc/osmo_msc.h2
-rw-r--r--openbsc/src/libbsc/bsc_vty.c26
-rw-r--r--openbsc/src/libmsc/rrlp.c12
-rw-r--r--openbsc/src/libmsc/silent_call.c3
5 files changed, 40 insertions, 5 deletions
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index 715ff1bdd..717d6f11a 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -271,6 +271,8 @@ struct gsm_network {
/* Radio Resource Location Protocol (TS 04.31) */
struct {
enum rrlp_mode mode;
+ int on_attach;
+ int on_paging;
} rrlp;
/* enable the DTXu and DTXd for this network */
diff --git a/openbsc/include/openbsc/osmo_msc.h b/openbsc/include/openbsc/osmo_msc.h
index beb3f5e4c..27ba45208 100644
--- a/openbsc/include/openbsc/osmo_msc.h
+++ b/openbsc/include/openbsc/osmo_msc.h
@@ -7,5 +7,7 @@
struct bsc_api *msc_bsc_api();
void msc_release_connection(struct gsm_subscriber_connection *conn);
+int send_rrlp_req(struct gsm_subscriber_connection *conn);
+
#endif
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index 8a5c7fdf2..51fab489f 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -575,6 +575,8 @@ static int config_write_net(struct vty *vty)
vty_out(vty, " paging any use tch %d%s", gsmnet->pag_any_tch, VTY_NEWLINE);
vty_out(vty, " rrlp mode %s%s", rrlp_mode_name(gsmnet->rrlp.mode),
VTY_NEWLINE);
+ vty_out(vty, " rrlp on attach %d%s", gsmnet->rrlp.on_attach, VTY_NEWLINE);
+ vty_out(vty, " rrlp on paging %d%s", gsmnet->rrlp.on_paging, VTY_NEWLINE);
vty_out(vty, " mm info %u%s", gsmnet->send_mm_info, VTY_NEWLINE);
vty_out(vty, " handover %u%s", gsmnet->handover.active, VTY_NEWLINE);
vty_out(vty, " handover window rxlev averaging %u%s",
@@ -1151,6 +1153,28 @@ DEFUN(cfg_net_rrlp_mode, cfg_net_rrlp_mode_cmd,
return CMD_SUCCESS;
}
+DEFUN(cfg_net_rrlp_on_attach, cfg_net_rrlp_on_attach_cmd,
+ "rrlp on attach (0|1)",
+ "Whether to perform a RRLP position request on SUBSCRIBER ATTACH")
+{
+ struct gsm_network *gsmnet = gsmnet_from_vty(vty);
+
+ gsmnet->rrlp.on_attach = atoi(argv[0]);
+
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_net_rrlp_on_paging, cfg_net_rrlp_on_paging_cmd,
+ "rrlp on paging (0|1)",
+ "Whether to perform a RRLP position request on PAGING SUCCESS")
+{
+ struct gsm_network *gsmnet = gsmnet_from_vty(vty);
+
+ gsmnet->rrlp.on_paging = atoi(argv[0]);
+
+ return CMD_SUCCESS;
+}
+
DEFUN(cfg_net_mm_info, cfg_net_mm_info_cmd,
"mm info (0|1)",
"Whether to send MM INFO after LOC UPD ACCEPT")
@@ -2584,6 +2608,8 @@ int bsc_vty_init(const struct log_info *cat)
install_element(GSMNET_NODE, &cfg_net_encryption_cmd);
install_element(GSMNET_NODE, &cfg_net_neci_cmd);
install_element(GSMNET_NODE, &cfg_net_rrlp_mode_cmd);
+ install_element(GSMNET_NODE, &cfg_net_rrlp_on_attach_cmd);
+ install_element(GSMNET_NODE, &cfg_net_rrlp_on_paging_cmd);
install_element(GSMNET_NODE, &cfg_net_mm_info_cmd);
install_element(GSMNET_NODE, &cfg_net_handover_cmd);
install_element(GSMNET_NODE, &cfg_net_ho_win_rxlev_avg_cmd);
diff --git a/openbsc/src/libmsc/rrlp.c b/openbsc/src/libmsc/rrlp.c
index 396161173..138d865b8 100644
--- a/openbsc/src/libmsc/rrlp.c
+++ b/openbsc/src/libmsc/rrlp.c
@@ -40,7 +40,7 @@
#include <arpa/inet.h>
#define RRLP_SERV_PORT 7890
-#define RRLP_SERV_IP "192.168.200.22" /* TODO: from config file */
+#define RRLP_SERV_IP "127.0.0.2" /* TODO: from config file */
#define MAX_RRLP_DATA 256
@@ -216,7 +216,7 @@ static int rrlp_serv_cmd(struct gsm_subscriber_connection *conn,
/* ----------------------------------------------- */
-static int send_rrlp_req(struct gsm_subscriber_connection *conn);
+int send_rrlp_req(struct gsm_subscriber_connection *conn);
/* TODO: adjust error messages, use logging */
@@ -314,7 +314,7 @@ static const uint8_t ms_pref_pos_req[] = { 0x40, 0x02, 0x79, 0x50 };
Accuracy=60, Method=gpsOrEOTD, ResponseTime=5, multipleSets */
static const uint8_t ass_pref_pos_req[] = { 0x40, 0x03, 0x79, 0x50 };
-static int send_rrlp_req(struct gsm_subscriber_connection *conn)
+int send_rrlp_req(struct gsm_subscriber_connection *conn)
{
struct gsm_network *net = conn->bts->network;
const uint8_t *req;
@@ -351,7 +351,8 @@ static int subscr_sig_cb(unsigned int subsys, unsigned int signal,
conn = connection_for_subscr(subscr);
if (!conn)
break;
- send_rrlp_req(conn);
+ if (conn->bts->network->rrlp.on_attach)
+ send_rrlp_req(conn);
break;
}
return 0;
@@ -365,7 +366,8 @@ static int paging_sig_cb(unsigned int subsys, unsigned int signal,
switch (signal) {
case S_PAGING_SUCCEEDED:
/* A subscriber has attached. */
- send_rrlp_req(psig_data->conn);
+ if (psig_data->conn->bts->network->rrlp.on_paging)
+ send_rrlp_req(psig_data->conn);
break;
case S_PAGING_EXPIRED:
break;
diff --git a/openbsc/src/libmsc/silent_call.c b/openbsc/src/libmsc/silent_call.c
index 6a188c892..f02a3e804 100644
--- a/openbsc/src/libmsc/silent_call.c
+++ b/openbsc/src/libmsc/silent_call.c
@@ -57,6 +57,8 @@ static int paging_cb_silent(unsigned int hooknum, unsigned int event,
conn->silent_call = 1;
/* increment lchan reference count */
osmo_signal_dispatch(SS_SCALL, S_SCALL_SUCCESS, &sigdata);
+ if (conn->bts->network->rrlp.on_paging)
+ send_rrlp_req(conn);
break;
case GSM_PAGING_EXPIRED:
case GSM_PAGING_BUSY:
@@ -88,6 +90,7 @@ struct msg_match {
static const struct msg_match silent_call_accept[] = {
{ GSM48_PDISC_MM, GSM48_MT_MM_LOC_UPD_REQUEST },
{ GSM48_PDISC_MM, GSM48_MT_MM_CM_SERV_REQ },
+ { GSM48_PDISC_RR, GSM48_MT_RR_APP_INFO}, // for RRLP
};
/* decide if we need to reroute a message as part of a silent call */