Be able to initiate paging from the telnet interface
The actual paging by subscriber needs to be implemented
diff --git a/src/abis_rsl.c b/src/abis_rsl.c
index e8cd9ca..04c8455 100644
--- a/src/abis_rsl.c
+++ b/src/abis_rsl.c
@@ -383,6 +383,16 @@
return abis_rsl_sendmsg(msg);
}
+int rsl_paging_cmd_subscr(struct gsm_bts *bts, u_int8_t chan_need,
+ struct gsm_subscriber *subscr)
+{
+ u_int8_t mi[128];
+ unsigned int mi_len;
+ u_int8_t paging_group;
+
+ return -1;
+}
+
int imsi_str2bcd(u_int8_t *bcd_out, const char *str_in)
{
int i, len = strlen(str_in);
diff --git a/src/telnet_interface.c b/src/telnet_interface.c
index 49a34c6..7da53fd 100644
--- a/src/telnet_interface.c
+++ b/src/telnet_interface.c
@@ -30,6 +30,7 @@
#include <openbsc/chan_alloc.h>
#include <openbsc/gsm_04_08.h>
#include <openbsc/msgb.h>
+#include <openbsc/abis_rsl.h>
extern void telnet_parse(struct telnet_connection *connection, char *line);
@@ -135,10 +136,6 @@
ret = write(fd, msg, strlen(msg));
}
-void telnet_page(struct telnet_connection *connection, const char *imsi, int page) {
- printf("going to page: '%s' %d\n", imsi, page);
-}
-
static struct gsm_lchan* find_channel(struct gsm_bts *bts, const char *imsi,
const char **error, int fd) {
int ret;
@@ -159,6 +156,27 @@
return lchan;
}
+void telnet_page(struct telnet_connection *connection, const char *imsi, int type) {
+ int ret;
+ static const char* error[] = {
+ "paging: IMSI not found\n",
+ "paging: No channel allocated for IMSI -> will allocate\n" };
+ struct gsm_bts *bts = &connection->network->bts[connection->bts];
+ struct gsm_lchan *lchan = find_channel(bts, imsi, error, connection->fd.fd);
+
+ if (lchan) {
+ static const char *msg = "paging: A Channel is already allocated.\n";
+ ret = write(connection->fd.fd, msg, strlen(msg));
+ return;
+ }
+
+ struct gsm_subscriber *subscr = subscr_get_by_imsi(imsi);
+ if (!subscr)
+ return;
+
+ rsl_paging_cmd_subscr(bts, type, subscr);
+}
+
void telnet_put_channel(struct telnet_connection *connection, const char *imsi) {
static const char* error[] = {
"put_channel: IMSI not found\n",