Skip to content

Ussd server ​

Implements a USSD application over SMPP: receives USSD requests from the SMSC/USSD gateway, emits them to the flow, and sends back the response messages the flow produces. Use it to build USSD menus (e.g. *123#).

Pins ​

PinKindTypesDescription
Startstart-Opens the SMPP session. Called by the system when the flow starts if it is not connected.
RequestoutputViaducta.Plugins.Smpp.Types.UssdMessageOne message per incoming USSD request.
ResponseinputViaducta.Plugins.Smpp.Types.UssdMessageConnect the component that produces the answer; every message received here is sent to the gateway.

UssdMessage: Operation (USSD service operation, int), MessageText, Sender, Receiver.

Operation values: 0 PSSD_INDICATION, 1 PSSR_INDICATION, 2 USSR_REQUEST, 3 USSN_REQUEST, 16 PSSD_RESPONSE, 17 PSSR_RESPONSE, 18 USSR_CONFIRM, 19 USSN_CONFIRM, 34 USER_EXIT.

Configuration ​

FieldTypeDefaultDescription
Hoststring (required)localhostSMSC / USSD gateway host.
LocalEndpointIpstringAnyLocal IP to bind the socket to.
Portinteger 1-6553510000Gateway port.
AddressRangestring, max 41 charsemptyESME address range (e.g. the service code).
SystemIdstring, max 32 charsemptySMPP system_id.
PasswordpasswordemptySMPP password.
SystemTypestringESMESMPP system_type.
EnquireLinkIntervalinteger seconds, max 605Keep-alive interval.
GeneralTimeoutinteger seconds, max 3005Response timeout.
SourceAddressNpidropdown: 0 Unknown, 1 ISDN, 3 Data, 4 Telex, 6 LandMobile, 8 National, 9 Private, 10 ERMES, 14 Internet8Numbering plan of the response Sender.
SourceAddressTondropdown: 0 Unknown, 1 International, 2 National, 3 NetworkSpecific, 4 SubscriberNumber, 5 Alphanumeric, 6 Abbreviated3Type of number of the response Sender.
DestinationAddressNpidropdown, as SourceAddressNpi1Numbering plan of the response Receiver.
DestinationAddressTondropdown, as SourceAddressTon1Type of number of the response Receiver.
DataCodingTypedropdown: 0 SMSCDefault, 1 IA5_ASCII, 3 Latin1, 8 UCS2, ... (same list as Sms transmitter)0Encoding of the response text.

Behaviour ​

  • On Start the plugin binds as transceiver with SMPP 3.4 and starts reading; the flow keeps running.
  • Each incoming deliver_sm / data_sm becomes a UssdMessage (Operation from the ussd_service_op parameter, 0 if missing) with new metadata on Request.
  • Every message arriving on Response is sent as submit_sm with service type USSD and ussd_service_op = Operation. A rejected submit is logged as an error.

Notes ​

  • There is no session handling: build the response yourself. Swap the addresses (Receiver = request Sender, Sender = request Receiver) and choose the operation: typically 17 (PSSR_RESPONSE) to answer and end, 2 (USSR_REQUEST) to show a menu and wait for the next input. Keep menu state yourself (e.g. keyed by the subscriber number).
  • Messages sent to Response before the session is open fail.
  • Errors in the read loop and in downstream components are swallowed silently.
  • Ports above 32767 are not handled correctly (converted to a 16-bit signed number).
  • Use an expression setting (=Secrets.UssdPassword) for Password.

Example ​

json
{ "Host": "ussdgw.example.com", "Port": 2775, "SystemId": "ussdapp", "Password": "=Secrets.UssdPassword", "AddressRange": "\\*123#", "DataCodingType": 0 }

Ussd server (Request) → C# script (build menu, swap addresses, Operation = 2 or 17) → Ussd server (Response)

Viaducta documentation