Ybts socket protocol

Signalling
Protocol type: Packet oriented

Packet format:

Primitives with code 0-127 are associated with a communication channel and its ID is presen after the Info field. Primitives with code 128-255 are not associated with a channel and Data (if present) follows immediately after the Info field.

Primitive

Info
 * L3Message, EstablishSAPI:
 * Bit 7: Set if message is for SACCH
 * Bits 0-2 contains the SAPI
 * Handshake:
 * Bits 0-3: Protocol version. Current: 0
 * Bit 7: MSC/SGSN identity. This bit must be the same on both ends of a connection
 * Bits 4-6: Reserved, must be 0
 * StartMedia
 * Codes the channel traffic type, 0-3 (0 = Signaling only, 1-3 = GSM voice v...)
 * StartPaging
 * Codes the requested paged channel type (0 = Voice, 1 = SMS, 2 = SS)
 * MediaError
 * L3 CC Cause code (similar to Q.850)
 * HandoverRequest, HandoverAck, HandoverReject
 * Handover reference used to match Ack to Request
 * GprsDetach
 * Detach reason flags, bit 3 (0x08) indicates power off

Data
 * StartPaging, StopPaging
 * Mobile identity: TMSIxxxxxxxxxxxxxxxx (hex digits) or IMSIdddddddddddddddddddddddddddddd (BCD digits)
 * PhysicalInfo
 * Human-readable string describing physical level information
 * NeighborsList
 * String: BAND ARFCN1:BSIC1:CELLID1 ARFCN2:BSIC2:CELLID2 ...
 * HandoverRequired
 * String: MY_LEVEL LEVEL1:CELLID1 LEVEL2:CELLID2 ...
 * HandoverAck
 * Binary RR Handover Command
 * GprsAttachReq, GprsAttachOk, GprsAuthRequest, PdpActivate, PdpModify, PdpDeactivate
 * List of space separated tag=value parameters

Media
Protocol type: Packet oriented

Packet format:

2 bytes connection id: unsigned integer in network byte order 0..n bytes media data

Logging
Protocol type: Packet oriented

Packet format:

Command
Protocol type: Packet oriented

Command: 1..n bytes single line of text, up to 1023 characters

Response: 1..n bytes text, may include \n line separators