Be able to initiate paging from the telnet interface
The actual paging by subscriber needs to be implemented
This commit is contained in:
parent
4c8f114976
commit
7448a53ddb
|
@ -347,7 +347,8 @@ int rsl_chan_activate_tch_f(struct gsm_bts_trx_ts *ts);
|
|||
int rsl_chan_activate_sdcch(struct gsm_bts_trx_ts *ts);
|
||||
int rsl_paging_cmd(struct gsm_bts *bts, u_int8_t paging_group, u_int8_t len,
|
||||
u_int8_t *ms_ident, u_int8_t chan_needed);
|
||||
int rsl_paging_cmd_imsi(struct gsm_bts *bts, u_int8_t chan_needed, const char *imsi_str);
|
||||
int rsl_paging_cmd_subscr(struct gsm_bts *bts, u_int8_t chan_needed,
|
||||
struct gsm_subscriber *subscr);
|
||||
int rsl_imm_assign_cmd(struct gsm_bts *bts, u_int8_t len, u_int8_t *val);
|
||||
|
||||
int rsl_data_request(struct msgb *msg, u_int8_t link_id);
|
||||
|
|
|
@ -383,6 +383,16 @@ int rsl_paging_cmd(struct gsm_bts *bts, u_int8_t paging_group, u_int8_t len,
|
|||
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);
|
||||
|
|
|
@ -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 @@ void telnet_error_client(int fd) {
|
|||
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 @@ static struct gsm_lchan* find_channel(struct gsm_bts *bts, const char *imsi,
|
|||
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",
|
||||
|
|
Loading…
Reference in New Issue