Author Topic: Help to change NIB.JS  (Read 6401 times)

Aldo T

  • Newbie
  • *
  • Posts: 8
    • View Profile
Help to change NIB.JS
« on: July 10, 2017, 02:34:24 PM »
Hi Team,

I want to receive your help because I'm stuck in one steep of my project,

I have installed correctly Yate and YateBTS, I'm using BladeRF, the problem that I have is:

-When I try to modify nib.js in order to create other field in tmsidata.conf I receive only the object that I create in the code,

The object that I need to insert is date, month, year, hours, minutes and seconds,

When I run yate -vvvv, I connect the cellphone and I receive the IMSI, IMEI, LOCATION and [object date]---this is the field that I declare in var TOTAL= new Date();

after I declare one by one:

var fecha=TOTAL.getDate();
var mes=TOTAL.getMonth();
var año=TOTAL.getFullYear();
var horas=TOTAL.getHours();
var minutos=TOTAL.getMinutes();
var segundos=TOTAL.getSeconds();


please I need your help,

Many thanks in advance and best regards,

//Aldo T

Monica Tepelus

  • Administrator
  • Full Member
  • *****
  • Posts: 198
    • View Profile
Re: Help to change NIB.JS
« Reply #1 on: July 11, 2017, 03:09:44 AM »
What did you modify? Please post a diff of nib.js

Aldo T

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Help to change NIB.JS
« Reply #2 on: July 12, 2017, 09:20:26 AM »
Thanks to much to answer me, I will explain with details:

Below you can see my tmisdata.conf, in this part I want to receive the date,
[tmsi]
last=007b000b

[ues]
3340202101XXXXX=007b000b,3590300645XXXXX,520187458,1500733238,ybts/TMSI007b000b,[object Date]

In my NIB.js I try to insert the date in the function saveUEinConf(imsi,subcriber)

function saveUEinConf(imsi,subscriber)
{
    if (subscriber!=undefined) {
   var fim = new Date();
   var fecha = fim.toString();
   var dia = fim.getDate();
   var mes = fim.getMonth();
   var año = fim.getFullYear();
   var hora = fim.getHours();
   var minuto = fim.getMinutes();
   var segundo = fim.getSeconds();
   var fields = subscriber["tmsi"]+","+subscriber["imei"]+","+subscriber["msisdn"]+","+subscriber["expires"]+","+subscriber["location"]+","+dia+","+mes+","+año+","+hora+","+minuto+","+segundo;
   
    } else
   conf.clearKey(ues,imsi);

    if (conf.save()==false)
   Engine.alarm(4, "Could not save tmsi in tmsidata.conf");
}

I dont know if is the correct part to insert this variable or please if you recommend me if I need to create one TXT with:

IMSI, IMEI, DATE, HOUR,

I will appreciate a lot if you can help me,

Again to much thanks,

Best regards,

//Aldo T

Monica Tepelus

  • Administrator
  • Full Member
  • *****
  • Posts: 198
    • View Profile
Re: Help to change NIB.JS
« Reply #3 on: July 13, 2017, 01:57:56 AM »
This looks kind of ok. It's unclear why you would need to save this and what should happen in the various cases saveUEinConf is called.

I think you didn't reload the script after the last modifications. Your code doesn't match the resulted filte. After you make a change in the code you need to restart yate and reregister the phone or at least to type this in telnet "javascript reload nib".

The supported date functions are here:
http://docs.yate.ro/wiki/Javascript_Date

Aldo T

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Help to change NIB.JS
« Reply #4 on: July 13, 2017, 07:42:17 AM »
Thanks to take your time to analize mi code,

One more question.... How can I reload the nib.js ?

I stoped the yate and ran again, the result that I paste to you is the result that I got after stop and play again,

Is this te correct way to reload NIB.JS ?

Many thanks in advance and best regards,

//Aldo T

Aldo T

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Help to change NIB.JS
« Reply #5 on: July 13, 2017, 08:49:13 PM »
Hi,

Me again, Just to inform you... I'm using NIB interface

Regards,

//Aldo T