Difference between revisions of "JSON API for SatSite Configuration"

From YateBTS
Jump to: navigation, search
(get_online_subscribers)
(get_call_logs)
Line 339: Line 339:
 
Retrieves the file specified in params.
 
Retrieves the file specified in params.
  
 +
Usage:
 
  {"request":"get_call_logs","node":"satsite","params":{"yate-cdr.csv"}}
 
  {"request":"get_call_logs","node":"satsite","params":{"yate-cdr.csv"}}
 
  
 
  Returns:
 
  Returns:

Revision as of 16:31, 25 July 2016

Requests

get_node_type

Retrieve installed nodes on equipment and set sdr_mode. The available nodes are: "bts" and "enb" and depending on your installation you will have one of them or both. The "sdr_mode" represents the working mode of the equipment. There are four working modes:

  • nib
  • roaming
  • dataroam
  • enb
Usage:
{"request":"get_node_type","node":"satsite","params":[]}
Returns:
{"code":0,"node_type":[{"type":"bts","version":"unknown","sdr_mode":"roaming"},{"type":"enb","version":"unknown","sdr_mode":"roaming"}]} 

set_sdr_mode

Sets the "sdr_mode" that represents the working mode of the equipment. There are four working modes tat can be set:

  • nib
  • roaming
  • dataroam
  • enb
Usage:
{"request":"set_sdr_mode","node":"satsite","params":{"sdr_mode":"dataroam"}}
Returns:
{"code":0}

set_bts_node

Sets the parameters for a BTS node.


Usage:

{"request":"set_bts_node",
 "node":"satsite",
 "params":{
          "ybts":{
                 "gsm":{
                        "Radio.Band":"850","Radio.C0":"130","Identity.MCC":"001","Identity.MNC":"05","Identity.LAC":"1000"," 
                        "Identity.CI":"10","Identity.BSIC.BCC":"2","Identity.BSIC.NCC":"0","Identity.ShortName":"YateBTS",
                        "Radio.PowerManager.MaxAttenDB":"10","Radio.PowerManager.MinAttenDB":"0"},
                 "gprs":{"Enable":"off","RAC":"0","RA_COLOUR":"0"},
                 "gsm_advanced":{
                         "Channels.NumC1s":"7","Channels.NumC7s":"0","Channels.C1sFirst":"off","Channels.SDCCHReserve":"0",
                         "CCCH.AGCH.QMax":"5","CCCH.CCCH-CONF":"1","CellOptions.RADIO-LINK-TIMEOUT":"15","CellSelection.CELL-RESELECT-HYSTERESIS":"3",
                         "CellSelection.MS-TXPWR-MAX-CCH":"0","CellSelection.NCCsPermitted":"-1","CellSelection.NECI":"1",
                         "CellSelection.RXLEV-ACCESS-MIN":"0","Cipher.CCHBER":"0.0","Cipher.Encrypt":"off","Cipher.RandomNeighbor":"0.0",
                         "Cipher.ScrambleFiller":"off","Control.GPRSMaxIgnore":"5","Handover.InitialHoldoff":"5000","Handover.RepeatHoldoff":"3000",
                         "Handover.LocalRSSIMin":"-80","Handover.ThresholdDelta":"10","MS.Power.Damping":"50","MS.Power.Max":"33",
                         "MS.Power.Min":"5","MS.TA.Damping":"50","MS.TA.Max":"62","MaxSpeechLatency":"2","Neighbors.NumToSend":"8",
                         "Ny1":"5","RACH.AC":"0x0400","RACH.MaxRetrans":"1","RACH.TxInteger":"14","Radio.ARFCNs":"1","Radio.MaxExpectedDelaySpread":"2",
                         "Radio.NeedBSIC":"off","Radio.PowerManager.NumSamples":"10","Radio.PowerManager.Period":"6000",
                         "Radio.PowerManager.SamplePeriod":"2000","Radio.PowerManager.TargetT3122":"5000",
                         "Radio.RSSITarget":"-50","Radio.RxGain":"","ShowCountry":"off","Timer.T3103":"5000","Timer.T3105":"50","Timer.T3113":"10000",
                         "Timer.T3122Max":"255000","Timer.T3122Min":"2000","Timer.T3212":"24"},
                "gprs_advanced":{
                          "Debug":"off","MS.Power.Alpha":"10","MS.Power.Gamma":"31","MS.Power.T_AVG_T":"15","MS.Power.T_AVG_W":"15",
                          "Multislot.Max.Downlink":"3","Multislot.Max.Uplink":"2","Codecs.Downlink":"14","Codecs.Uplink":"14",
                          "Uplink.KeepAlive":"300","Uplink.Persist":"4000","TBF.Downlink.Poll1":"10","TBF.EST":"off","TBF.Expire":"30000",
                          "TBF.KeepExpiredCount":"20","TBF.Retry":"1","advanceblocks":"10","CellOptions.T3168Code":"5",
                          "CellOptions.T3192Code":"0","ChannelCodingControl.RSSI":"-40","Channels.Congestion.Threshold":"200",
                          "Channels.Congestion.Timer":"60","Channels.Min.C0":"3","Channels.Min.CN":"0","Channels.Max":"4","Counters.Assign":"10",
                          "Counters.N3101":"20","Counters.N3103":"8","Counters.N3105":"12","Counters.Reassign":"6","Counters.TbfRelease":"5",
                          "Downlink.KeepAlive":"300","Downlink.Persist":"0","LocalTLLI.Enable":"off","MS.KeepExpiredCount":"20",
                          "NC.NetworkControlOrder":"2","NMO":"2","PRIORITY-ACCESS-THR":"6","RRBP.Min":"0","Reassign.Enable":"off",
                          "SendIdleFrames":"off","SGSN.port":"1920","Timers.Channels.Idle":"6000","Timers.MS.Idle":"600",
                          "Timers.MS.NonResponsive":"6000","Timers.T3169":"5000","Timers.T3191":"5000","Timers.T3193":"0","Timers.T3195":"5000"},
               "control":{"VEA":"off","LUR.AttachDetach":"off","SACCHTimeout.BumpDown":"1"},
               "roaming":{
                          "expires":"3600","reg_sip":"192.168.1.245:5058","nodes_sip":"","nnsf_bits":"8","gstn_location":"5",
                          "text_sms":"off","my_sip":"192.168.168.208"},
               "handover":{"enable":"on","neighbors":"","reason":"GSM;text=\"Handover\""},
               "ybts":{
                       "mode":"roaming","heartbeat_ping":"3000","heartbeat_timeout":"60000","handshake_start":"60000","max_restart":"10",
                       "peer_cmd":"${modulepath}\/server\/bts\/mbts","peer_arg":"","peer_dir":"${modulepath}\/server\/bts",
                       "print_msg":"yes","print_msg_data":"verbose","imei_request":"off","tmsi_expire":"864000","t305":"30000",
                       "t308":"5000","t313":"5000","sms.timeout":"300000","ussd.session_timeout":"600000","export_xml_as":"object"},
              "security":{"t3260":"720000","auth.call":"off","auth.sms":"off","auth.ussd":"off"},
              "transceiver":{"Path":".\/transceiver","Args":"","MinimumRxRSSI":"-63","RadioFrequencyOffset":"","TxAttenOffset":"","Timeout.Clock":"10"},
              "test":{"SimulatedFER.Downlink":"0","SimulatedFER.Uplink":"0","UplinkFuzzingRate":"0"},
              "tapping":{"GSM":"off","GPRS":"off","TargetIP":"127.0.0.1"}
              }
      }
}


Returns:
{"code":0,"node":null} - on success or 
{"code":"401","message":"ybts: Field 'expires' should be numeric in section 'roaming'."} - for errors

get_bts_node

Retrieve the BTS configuration of an equipment. That means the parameters set in ybts, satsite and ybladerf.

Usage:

{"request":"get_bts_node","node":"satsite","params":[]}

Returns:

{"code":0,
"node":{
         "ybts":{
                "general":{"updated":"Wednesday, 20-Jul-16 12:36:40 GMT from 172.31.0.108","locked":"false"},
                "gsm":{      
                      "Radio.Band":"850","Radio.C0":"130","Identity.MCC":"001","Identity.MNC":"05",
                      "Identity.LAC":"1000","Identity.CI":"10","Identity.BSIC.BCC":"2","Identity.BSIC.NCC":"0",
                      "Identity.ShortName":"YateBTS","Radio.PowerManager.MaxAttenDB":"10",
                      "Radio.PowerManager.MinAttenDB":"0"},
                 "gprs":{"Enable":"off","RAC":"0","RA_COLOUR":"0"},
                 "ggsn":{ 
                        "Firewall.Enable":"1","IP.MaxPacketSize":"1520","IP.ReuseTimeout":"180","IP.TossDuplicatePackets":"off",
                        "Logfile.Name":"ggsn.log","MS.IP.Base":"192.168.99.1","MS.IP.MaxCount":"254","TunName":"sgsntun"},
                 "transceiver":{"Path":".\/transceiver","MinimumRxRSSI":"-23","Timeout.Clock":"10"},
                 "control":{"VEA":"off","LUR.AttachDetach":"off","SACCHTimeout.BumpDown":"1"},
                 "tapping":{"GSM":"off","GPRS":"off","TargetIP":"127.0.0.1"},
                 "gsm_advanced":{"Channels.NumC1s":"7","Channels.NumC7s":"0","Channels.C1sFirst":"off","Channels.SDCCHReserve":"0",
                                 "CCCH.AGCH.QMax":"5","CCCH.CCCH-CONF":"1","CellOptions.RADIO-LINK-TIMEOUT":"15",
                                 "CellSelection.CELL-RESELECT-HYSTERESIS":"3","CellSelection.MS-TXPWR- MAX-CCH":"0",
                                 "CellSelection.NCCsPermitted":"-1","CellSelection.NECI":"1",
                                 "CellSelection.RXLEV-ACCESS-MIN":"0","Cipher.CCHBER":"0.0","Cipher.Encrypt":"off",
                                 "Cipher.RandomNeighbor":"0.0","Cipher.ScrambleFiller":"off",
                                 "Control.GPRSMaxIgnore":"5","Handover.InitialHoldoff":"5000","Handover.RepeatHoldoff":"3000",
                                 "Handover.LocalRSSIMin":"- 80","Handover.ThresholdDelta":"10","MS.Power.Damping":"50",
                                 "MS.Power.Max":"33","MS.Power.Min":"5","MS.TA.Damping":"50","MS.TA.Max":"62",
                                 "MaxSpeechLatency":"2","Neighbors.NumToSend":"8","Ny1":"5","RACH.AC":"0x0400",
                                 "RACH.MaxRetrans":"1",RACH.TxInteger":"14","Radio.ARFCNs":"1","Radio.MaxExpectedDelaySpread":"2",
                                 "Radio.NeedBSIC":"off","Radio.PowerManager.NumSamples":"10","Radio.PowerManager.Period":"6000",
                                 "Radio.PowerManager.SamplePeriod":"2000","Radio.PowerManager.TargetT3122":"5000",
                                 "Radio.RSSITarget":"-50","ShowCountry":"off","Timer.T3103":"5000","Timer.T3105":"50",
                                 "Timer.T3113":"10000","Timer.T3122Max":"255000","Timer.T3122Min":"2000","Timer.T3212":"24"}, 
                                                                 
                 "gprs_advanced": {"Debug":"off","MS.Power.Alpha":"10","MS.Power.Gamma":"31","MS.Power.T_AVG_T":"15",
                                  "MS.Power.T_AVG_W":"15","Multislot.Max.Downlink":"3",
                                   "Multislot.Max.Uplink":"2","Codecs.Downlink":"14","Codecs.Uplink":"14",
                                  "Uplink.KeepAlive":"300","Uplink.Persist":"4000","TBF.Downlink.Poll1":"10","TBF.EST":"off",         
                                  "TBF.Expire":"30000","TBF.KeepExpiredCount":"20","TBF.Retry":"1","advanceblocks":"10",
                                  "CellOptions.T3168Code":"5","CellOptions.T3192Code":"0","ChannelCodingControl.RSSI":"-40",
                                   "Channels.Congestion.Threshold":"200","Channels.Congestion.Timer":"60","Channels.Min.C0":"3",
                                  "Channels.Min.CN":"0","Channels.Max":"4","Counters.Assign":"10","Counters.N3101":"20","Counters.N3103":"8",
                                   "Counters.N3105":"12","Counters.Reassign":"6","Counters.TbfRelease":"5","Downlink.KeepAlive":"300",
                                  "Downlink.Persist":"0","LocalTLLI.Enable":"off","MS.KeepExpiredCount":"20","NC.NetworkControlOrder":"2","NMO":"2",
                                   "PRIORITY-ACCESS-THR":"6","RRBP.Min":"0","Reassign.Enable":"off","SendIdleFrames":"off","SGSN.port":"1920",
                                   "Timers.Channels.Idle":"6000","Timers.MS.Idle":"600","Timers.MS.NonResponsive":"6000",
                                   "Timers.T3169":"5000","Timers.T3191":"5000","Timers.T3193":"0","Timers.T3195":"5000"},
                "sgsn":{"Debug":"off","Timer.ImplicitDetach":"3480","Timer.MS.Idle":"600","Timer.RAUpdate":"3240","Timer.Ready":"44"},
                "test":{"SimulatedFER.Downlink":"0","SimulatedFER.Uplink":"0","UplinkFuzzingRate":"0"},
                "ybts":{"mode":"dataroam","heartbeat_ping":"3000","heartbeat_timeout":"60000","handshake_start":"60000","max_restart":"10",
"peer_cmd":"${modulepath}\/server\/bts\/mbts","peer_dir":"${modulepath}\/server\/bts","print_msg":"yes","print_msg_data":"verbose","imei_request":"off","tmsi_expire":"864000","t305":"30000","t308":"5000",
"t313":"5000","sms.timeout":"300000","ussd.session_timeout":"600000","export_xml_as":"object"},
                "security":{"t3260":"720000","auth.call":"off","auth.sms":"off","auth.ussd":"off"}
         },
         "satsite":{
                       "general":{"updated":"","locked":"","sdr_mode":"bts"},
                       "basic":{}, 
                       "site-equipment":{},
                       "test":{}},
         "ybladerf":{
                       "general":[],
                       "libusb":[],
                       "filedump":[]
          }
    }
}

set_enb_node

Sets the ENB configurations. That means that the parameters set in openenb object will be written in openenb.conf, and the parameters from 'gtp' object will be written in file gtp.conf. Before writting all parameters will be validated.

Usage:
{"request":"set_enb_node",
 "node":"satsite",
 "params":{
     "gtp":{
         "sgw":{"addr6":"","addr4":"::1:222"}
      },
     "openenb":{
         "basic":{"enodebId":"10","MCC":"001","MNC":"55","TAC":"10","CellIdentity":"0000001","Name":"EnbMonica","Band":"3","Bandwidth":"25","EARFCN":"1575","NID1":"4","NID2":"2","Prach.RootSequence":"0","Prach.FreqOffset":"9","Pusch.RefSigGroup":"2","OutputLevel":"40","CrestFactor":"13","DistributedVrbs":"on","SiWindowLength":"20","SiPeriodicity":"8","SiRedundancy":"2","DefaultPagingCycle":"32","RxLevelMinimum":"-22","Pdsch.RefPower":"-20","Pusch.Qam64":"off","Pusch.CyclicShift":"3","Pucch.Delta":"1","Pucch.RbCqi":"3","Pucch.CsAn":"3","Pucch.An":"45","Prach.Preambles":"4","Prach.PowerStep":"4","Prach.InitialTarget":"-90","Prach.TransMax":"200","Prach.ResponseWindow":"10","Prach.ContentionTimer":"64","Prach.ConfigIndex":"14","Prach.ZeroCorr":"1","CFI":"2","Ng":"one","PdcchFormat":"2"},
         "bearers":{"Srb1.mode":"unacknowledged","Srb2.mode":"acknowledged"},
         "advanced":{"GridLength":"8","LeadModulation":"14","LeadScheduling":"2","RadioPriority":"high","ModulatorPriority":"high","SchedulerPriority":"normal"},
         "scheduler":{"SibModulationRate":"2","SibDci":"dci1a","PcchMcs":"2","PcchDci":"dci1a","RarMcs":"2","RarDci":"dci1a","downlinkDci":"dci1a","uplinkDci":"dci0","UplinkRbs":"1","UplinkRbStartIndex":"5","DistributedVrbs":"on","PrachResponseDelay":"5"},
         "radiohardware":{"MaximumOutput":"43","ReceiverReference":"-20"},
         "measurements":{"reportingPeriod":"15","reportingPath":""}, 
         "mme1": {"address":"192.167.1.1", "local":"10.1.1.1"}, 
         "mme2": {"address":"192.1.1.1", "local":"10.1.1.1"}
     }
  }
}

get_enb_node

Retrieve the ENB configuration of an equipment.

Usage:
{"request":"get_enb_node","node":"satsite","params":[]}
Response:

{"code":0,"node":{
               "gtp":{"general":{"updated":"Monday, 18-Jul-16 13:15:49 GMT from 172.31.0.108","locked":"false"},
               "sgw":{"addr4":"192.168.168.208","type":"gtp-access"}},
               "openenb":{"general":{"updated":"Monday, 18-Jul-16 11:56:51 GMT from 172.31.0.108","locked":"false"},
                          "basic":{
                                   "enodebId":"10","MCC":"001","MNC":"55","TAC":"10","CellIdentity":"0000001","Name":"Enb",
                                   "Band":"3","Bandwidth":"25","EARFCN":"1575","NID1":"4","NID2":"2","Prach.RootSequence":"0",
                                   "Prach.FreqOffset":"9","Pusch.RefSigGroup":"2","OutputLevel":"40","CrestFactor":"13",
                                   "DistributedVrbs":"on","SiWindowLength":"20","SiPeriodicity":"8","SiRedundancy":"2",
                                   "DefaultPagingCycle":"32","RxLevelMinimum":"-22","Pdsch.RefPower":"-20","Pusch.Qam64":"off",
                                   "Pusch.CyclicShift":"3","Pucch.Delta":"1","Pucch.RbCqi":"3","Pucch.CsAn":"3","Pucch.An":"45",
                                   "Prach.Preambles":"4","Prach.PowerStep":"4","Prach.InitialTarget":"-90",
                                   "Prach.TransMax":"200","Prach.ResponseWindow":"10","Prach.ContentionTimer":"64","Prach.ConfigIndex":"14",
                                   "Prach.ZeroCorr":"1","CFI":"2","Ng":"one","PdcchFormat":"2"},
                          "scheduler":{
                                   "SibModulationRate":"2","SibDci":"dci1a","PcchMcs":"2","PcchDci":"dci1a","RarMcs":"2","RarDci":"dci1a",
                                   "downlinkDci":"dci1a","uplinkDci":"dci0","UplinkRbs":"1","UplinkRbStartIndex":"5",
                                   "DistributedVrbs":"on","PrachResponseDelay":"5"}                               
                          "bearers":{"Srb1.mode":"unacknowledged","Srb2.mode":"acknowledged"},
                          "radiohardware":{"MaximumOutput":"43","ReceiverReference":"-20"},
                          "advanced":{
                                    "GridLength":"8","LeadModulation":"14","LeadScheduling":"2","RadioPriority":"high",
                                    "ModulatorPriority":"high","SchedulerPriority":"normal"},
                          "mme1":{"address":"192.167.1.1","local":"fe80::96de:80ff:fe7b:36fa"}
              },
              "satsite":{"general":{"updated":"","locked":"","sdr_mode":"bts"},"basic":{},
              "site-equipment":{}},
              "ybladerf":{"general":[],"libusb":[],"filedump":[]}
     }
}

set_subscribers

Request that writes the received parameters in subscribers.conf file.

Note! Subscribers are accepted based on two criteria: regular expression that matches the IMSI or they are inserted individually.
If in request 'subscribers' and 'regexp' is filled, then an error is returned.
Usage:
{"request":"set_subscribers","node":"satsite",
"params":{
   "subscribers":{
           "001010000000001":{"IMSI":"001010000000001","Msisdn":"88250001", "Short number":"001", "active":"on","Ki":"*", "OP":"",
                              "IMSI type":"2G","ICCID":"","SMSC":"2222","OPC":""},
           "001010000000002":{"IMSI":"001010000000002","Msisdn":"88250002", "Short number":"002", "active":"on", "Ki":"*","OP":"", 
                              "IMSI type":"2G","ICCID":"","SMSC":"2222","OPC":""}
   },
   "regexp":{},
   "gw_sos":"112",
   "smsc":"2222",
   "country_code":"001"

}

Response:
{"code":0} - on success
{"code":402, "message": "Error message"} - on failure

get_subscribers

Retrieve all the configuration from subscribers.conf if 'params' is empty. The parameters that can be requested are:

  • subscribers with {"limit": , "offset": } -- retrieve subscribers in parameter 'subscribers'
  • subscribers with no parameters {} -- retrieve subscriber count in parameter 'count'
  • subscribers with { "imsi": ,/ "msisdn": } -- retrieve specific subscriber based of various criteria in parameter 'subscribers'
  • regexp
  • smsc
  • country_code
  • gw_sos


Usage:
{"request":"get_subscribers","node":"satsite","params":[]}
Returns:
{"code":0,"node":{
   "subscribers":{
           "001010000000001":{"IMSI":"001010000000001","Msisdn":"88250001", "Short number":"001", "active":"on","Ki":"*", "OP":"",
                              "IMSI type":"2G","ICCID":"","SMSC":"2222","OPC":""},
           "001010000000002":{"IMSI":"001010000000002","Msisdn":"88250002", "Short number":"002", "active":"on", "Ki":"*","OP":"", 
                              "IMSI type":"2G","ICCID":"","SMSC":"2222","OPC":""}
   },
   "gw_sos":"112",
   "smsc":"2222",
   "country_code":"001"
  }
}  

Another example:

Usage:
{"request":"get_subscribers","node":"satsite","params":["subscribers":{"limit":20,"offset":0}]}
Returns:
{"code":0,"node":{
   "subscribers":{
           "001010000000001":{"IMSI":"001010000000001","Msisdn":"88250001", "Short number":"001", "active":"on","Ki":"*", "OP":"",
                              "IMSI type":"2G","ICCID":"","SMSC":"2222","OPC":""},
           "001010000000002":{"IMSI":"001010000000002","Msisdn":"88250002", "Short number":"002", "active":"on", "Ki":"*","OP":"", 
                              "IMSI type":"2G","ICCID":"","SMSC":"2222","OPC":""}
   }
 }

delete_subscriber

Deletes a specified subscriber.

Usage:
{"request":"get_online_subscribers","node":"satsite","params":{"imsi":"001012531201012"}}
Returns:
{"code":0}


get_online_subscribers

Retrieve the subscribers that are online in the request is done.

Usage:
{"request":"get_online_subscribers","node":"satsite","params":{"limit":20, "offset":0}}
Returns:
{"code":0, node:{"online_subscribers": {"imsi":"001011601284670", "msisdn":""}, {"imsi":"001990010001014", "msisdn":"882005"}}}

get_rejected_imsis

Retrieve rejected IMSIs.

Usage:
{"request":"get_rejected_imsis","node":"satsite","params":{"limit":20, "offset":0}}
Returns:
{"code":0, rejected_imsi:{"imsi":"00130040050033"},{"imsi":"00130040050034"},{"imsi":"00130040050035"} }

get_call_logs

Retrieves the file specified in params.

Usage:
{"request":"get_call_logs","node":"satsite","params":{"yate-cdr.csv"}}
Returns:
{"code":0} -- on success
{"code":!0, "message":""} -- on failure

set_outbound

Usage:
{"request":"set_outbound",
 "node":"satsite",
 "params":{
       "protocol":"sip","username":"my_user", "password":"secret","server":"",
       "enabled":"","description":"", "ip_transport":"", "authname":"", 
       "outbound":"","interval":"",  "formats":"","caller":"", 
       "ip_transport_remoteip":"", "ip_transport_localip":"", 
       "ip_transport_localport":"", "keepalive":"", "match_port":"", "match_user":""
  }
}

get_outbound

{"request":"get_outbound","node":"satsite","params":[]}