blob: be463ac34d3aefed8575b671f52f610eaad31881 [file] [log] [blame]
Harald Welteb41394a2018-08-06 22:18:33 +02001[[ussd]]
2== Unstructured Supplementary Services Data (USSD)
3
4The _Unstructured Supplementary Services Data (USSD)_ is one service within
52G/3G networks next to other services such as circuit-switched voice, packet-switched
6data and SMS (Short Message Service).
7
8It is on an abstract level quite similar to SMS in that USSD can be used to send
9textual messages. However, there are the following differences:
10
11* USSD is between the MS (phone) and an USSD application on the network, while
12 SMS is primarily between two subscribers identified by their MSISDN
13* USSD is faster, as it doesn't suffer from the complicated three-layer CP/RP/TP
14 protocol stack of SMS with it's acknowledgement of the acknowledged acknowledgement.
15* USSD is session-oriented, i.e. a dialogue/session between subscriber and application
16 can persist for the transfer of more than one message. The dedicated radio channel
17 on the RAN remains established throughout that dialogue.
18
19=== USSD in Osmocom
20
21Until August 2018, OsmoMSC contained some minimalistic internal USSD
22handling with no
23ability to attach/extend it with external USSD applications.
24
25From August 2018 onwards, OsmoMSC doesn't contain any internal USSD
26handlers/applications anymore. Instead, all USSD is transported to/from
27OsmoHLR via the GSUP protocol.
28
29OsmoHLR contains some intenal USSD handlers and can route USSD messages
30to any number of external USSD entities (EUSEs). The EUSE also use GSUP
31to communicate USSD from/to OsmoHLR.
32
33Each EUSE is identified by its name. The name consists of a single-word
34string preceding a currently fixed ("-00-00-00-00-00-00") suffix.
35There is no authentication between EUSE and OsmoHLR: Any client program
36able to connect to the GSUP port of OsmoHLR can register as any EUSE
37(name).
38
39NOTE:: We plan to remove the requirement for this suffix as soon as we
40are done resolving all more important issues.
41
42=== USSD Configuration
43
44USSD configuration in OsmoHLR happens within the `hlr` VTY node.
45
46`euse foobar-00-00-00-00-00-00` defines an EUSE with the given name `foobar`
47
48`ussd route prefix *123 external foobar-00-00-00-00-00-00` installs a
49prefix route to the named EUSE. All USSD short codes starting with *123 will be
50routed to the named EUSE.
51
52`ussd route prefix *#100# internal own-msisdn` installs a prefix route
53to the named internal USSD handler. There above command will restore
54the old behavior, in which *#100# will return a text message containing
55the subscribers own phone number. There is one other handler called
56`own-imsi` which will return the IMSI instead of the MSISDN.
57
58`ussd default-route external foobar-00-00-00-00-00-00` installs a
59default route to the named EUSE. This means that all USSD codes for
60which no more specific route exists will be routed to the named EUSE.
61
62=== Example EUSE program
63
64We have provided an example EUSE developed in C language using existing
65Osmocom libraries for GSUP protocol handling and USSD encoding/decoding.
66It will register as `foobar` EUSE to OsmoHLR on localhost. You can run
67it on a different machine by specifying e.g. `osmo-euse-demo 1.2.3.4 5678`
68to make it connect to OsmoHLR on IP address 1.2.3.4 and GSUP/TCP port
695678.
70
71The idea is that you can use this as a template to develop your own USSD
72applications, or any gateways to other protocols or interfaces.
73
74You can find it in `osmo-hlr/src/osmo-euse-demo.c` or online by
75following the link to http://git.osmocom.org/osmo-hlr/tree/src/osmo-euse-demo.c
76
77This demonstration program will echo back any USSD message sent/routed
78to it, quoted like _You sent "..."_.