Example: GetAllSessionsQuery

GetAllSessionsQuery is similar to GetSessionsQuery. The main difference is that the query must return all active sessions for an IMSI instead of just single session information. Session variable names are fixed as shown below, and they must correspond to AddSessionQuery example.
This example shows the values that must be fetched from the database.
GetAllSessionsQuery SELECT id, start_time, imsi, \
      session_id, origin_host, origin_realm, \
      application_id, application_name, \
      service_selection, permanent_user_id \
      FROM sessions WHERE stop_time IS NULL AND imsi=?
GetAllSessionsQueryParam %0
GetSessionColumnDef  0, id
GetSessionColumnDef  1, start_time
GetSessionColumnDef  2, imsi
GetSessionColumnDef  3, session_id
GetSessionColumnDef  4, origin_host
GetSessionColumnDef  5, origin_realm
GetSessionColumnDef  6, application_id
GetSessionColumnDef  7, application_name
GetSessionColumnDef  8, service_selection
GetSessionColumnDef  9, permanent_user_id
The following example shows two additional columns, emergency_services and user_name, required by emergency services and IMSI encryption.
GetAllSessionsQuery SELECT id, start_time, imsi, \
      session_id, origin_host, origin_realm, \
      application_id, application_name, \
      service_selection, permanent_user_id, \
      emergency_services, user_name \
      FROM sessions WHERE stop_time IS NULL AND imsi=?
GetSessionQueryParam %0
GetSessionColumnDef  0, id
GetSessionColumnDef  1, start_time
GetSessionColumnDef  2, imsi
GetSessionColumnDef  3, session_id
GetSessionColumnDef  4, origin_host
GetSessionColumnDef  5, origin_realm
GetSessionColumnDef  6, application_id
GetSessionColumnDef  7, application_name
GetSessionColumnDef  8, service_selection
GetSessionColumnDef  9, permanent_user_id
GetSessionColumnDef 10, emergency_services
GetSessionColumnDef 11, user_name