JSON API for YateHSS/HLR Control

From YateBTS
Jump to: navigation, search

Request: query_stats

Retrieve node statistics for the equipment.
It is mandatory to provide the desired node type.

Request

{ "request":"query_stats", "node":"hss" }

Example response

{"code":0,
 "stats":{
   "engine":{
     "version":"5.5.1","revision":1830,"nodename":"blanked-as-ordered","plugins":13,"inuse":1,"handlers":176,"hooks":4,
     "messages":0,"maxqueue":57,"messagerate":99,"maxmsgrate":548,"enqueued":10968685,"dequeued":10968685,"dispatched":49531395,
     "supervised":true,"runattempt":2,"lastsignal":0,"threads":28,"workers":5,"mutexes":274,"semaphores":1,"acceptcalls":"accept","congestion":0
   },
   "uptime":{
     "wall":842166,
     "user":56681,
     "kernel":33059
   },
   "clustering":{
     "status":"",
     "outbound":0,
     "inbound":0
   },
   "hss_cli":{
     "subscribers":5039,
     "cs_total":5038,
     "cs_active":3916,
     "ps_total":5037,
     "ps_active":2714,
     "ims_total":0,
     "ims_active":0,
     "operational":"(standalone)"
   },
   "hss_cluster":{
     "nodename":"blanked-as-ordered",
     "remote":0,
     "state":"standalone"
   },
   "hss_repair":{
     "clean":true,
     "cycles":98,
     "checks":838171,
     "errors":0,
     "fixed":0
   },
   "auc_map":{
     "auth2g":0,
     "auth3g":2494660,
     "auth4g":0,
     "resyncs":0,
     "unknowns":109,
     "illegals":0,
     "inactives":0,
     "reports":0
   },
   "hss_map":{
     "lu_ps":670959,
     "lu_cs":259382,
     "barrings":37110,
     "unknowns":1738,
     "purge_ps":6090,
     "restore":2,
     "purge_cs":2435
   },
   "hss_gtt":{
     "local":0,
     "imsi":1506179,
     "msisdn":4562269,
     "stp":631576,
     "back":0,
     "fail":7,
     "stp_101":"up",
     "stp_102":"up"
   },
   "auc_diam":{
     "auth2g":0,
     "auth3g":0,
     "auth4g":335726,
     "resyncs":0,
     "unknowns":16,
     "illegals":0,
     "inactives":0
   },
   "hss_diam":{
     "lu_ps":563349,
     "purge_ps":223668,
     "unknowns":31,
     "barrings":1919
   },
   "sig_routers":{
     "count":1,
     "operational":1
   },
   "sig_links":{
     "count":2,
     "operational":1
   },
   "sig_sccp":{
     "sent":1712,
     "received":1789,
     "translations":2037,
     "errors":9
   }
 }
}

Request: query_cs_reg

Retrieve current Circuit Switched registration status for a subscriber.
The subscriber can be identified by "subscriber_id", "msisdn" or "imsi" (primary or alternative).
Optionally the VLR can be queried (via ProvideSubscriberInfo) for more details.

Example request

{"request":"query_cs_reg",
 "params": {
   "msisdn":"88270017",
   "query":true
 }
}

Example response

{"code":0,
 "cs_reg":{
   "subscriber_id":174,
   "msisdn":"88270017",
   "registration":{
     "imsi":"001010000000007",
     "imeisv":"3594670766703801",
     "visited_net":"8820016",
     "area":"0016803e8",
     "protocol":"MAP",
     "roaming":true,
     "vlr":"8820016",
     "msc":"8820016"
   }
 }
}

Request: query_ps_reg

Retrieve current Packet Switched registration status for a subscriber.
The subscriber can be identified by "subscriber_id", "msisdn" or "imsi" (primary or alternative).
Optionally the SGSN/MME can be queried (via ProvideSubscriberInfo) for more details.

Example request

{"request":"query_ps_reg",
 "params": {
   "msisdn":"88270017",
   "query":true
 }
}

Example response (MAP)

{"code":0,
 "ps_reg":{
   "subscriber_id":174,
   "msisdn":"88270017",
   "registration":{
     "imsi":"001010000000007",
     "imeisv":"3594670766703801",
     "rat_type":"e-utran",
     "visited_net":"8820016",
     "protocol":"MAP",
     "roaming":true,
     "sgsn_num":"8820016",
     "sgsn_addr":"192.168.0.2"
   }
 }
}

A different example response when registration used DIAMETER

{"code":0,
 "ps_reg":{
   "subscriber_id":174,
   "msisdn":"88270017",
   "registration":{
     "imsi":"001010000000007",
     "imeisv":"3594670766703801",
     "rat_type":"e-utran",
     "visited_net":"yatebts.com",
     "protocol":"DIAMETER",
     "roaming":true,
     "diam_host":"ucn.yatebts.com",
     "diam_realm":"yatebts.com"
   }
 }
}

Request: query_ims_reg

Retrieve current IP Multimedia Subsystem registration status for a subscriber.
The subscriber can be identified by "subscriber_id", "msisdn", "imsi" (primary or alternative) or "private_ident" (IMPI).

Request examples:

{ "request":"query_ims_reg", "params": { "subscriber_id":"7" } }
{ "request":"query_ims_reg", "params": { "msisdn":"88270022" } }
{ "request":"query_ims_reg", "params": { "imsi":"001019902000019" } }
{ "request":"query_ims_reg", "params": { "private_ident":"001019902000019@ims-test.lan" } }

Response example: user registered

{ "code":0,
  "ims_reg":{
    "subscriber_id":7,
    "msisdn":"88270022",
    "registration":{
      "private_ident":"001019902000019@ims-test.lan",
      "public_ident":"sip:+88279019@ims-test.lan",
      "public_ident_alt":"tel:+88270022",
      "status":"registered",
      "reason":"register",
      "time_reg":1497262940,
      "protocol":"DIAMETER",
      "roaming":false,
      "server_name":"sip:ucn.example.com",
      "diam_realm":"example.com",
      "diam_host":"ucn.example.com"
    }
  }
}

Response example: user not registered, S-CSCF name stored (assigned)

{ "code":0,
  "ims_reg":{
    "subscriber_id":7,
    "msisdn":"88270022",
    "registration":{
      "private_ident":"001019902000019@ims-test.lan",
      "public_ident":"sip:+88279019@ims-test.lan",
      "public_ident_alt":"tel:+88270022",
      "status":"unregistered",
      "reason":"timeout-unregister-store-server",
      "time_purge":1497266121,
      "protocol":"DIAMETER",
      "roaming":false,
      "server_name":"sip:ucn.example.com",
      "diam_realm":"example.com",
      "diam_host":"ucn.example.com"
    }
  }
}

Response example: user not registered, no S-CSCF stored

{ "code":0,
  "ims_reg":{
    "subscriber_id":7,
    "msisdn":"88270022",
    "registration":{
      "private_ident":"001019902000019@ims-test.lan",
      "public_ident":"sip:+88279019@ims-test.lan",
      "public_ident_alt":"tel:+88270022",
      "reason":"unregistered",
      "time_purge":1497266193
    }
  }
}