Skip to content

How a USSD session runs on Asterisks

A USSD menu is a conversation of a few seconds between a phone and a server. Here is the path one reply takes, and the parts you no longer build yourself.

  1. Phone
  2. Mobile network
  3. Aggregator
  4. Asterisks
  5. Your API

One reply, start to finish

This repeats for every screen until the session ends.

  1. 1

    A customer dials your shortcode

    The mobile network opens a USSD session and hands it to the aggregator that owns the shortcode, such as Hubtel or Africa's Talking.

  2. 2

    The aggregator calls Asterisks

    It sends an HTTP request to the callback URL you set in its console, with the phone number, a session ID and what the customer typed.

  3. 3

    Asterisks finds the screen

    The engine loads your published flow, restores where this session was, and follows the reply to the next node.

  4. 4

    Your API answers, if a node asks it to

    Send Data nodes call your endpoint and store the response in variables, so the next screen can show a balance or an order status.

  5. 5

    The reply goes back in the aggregator's format

    Each aggregator has its own response shape. Africa's Talking, for example, expects CON before a screen that waits for input and END before the last one.

  6. 6

    The session closes and is recorded

    When the flow reaches End Session or the customer leaves, the session appears in your traffic log with its transcript and is charged once from your wallet.

What you build, and what you don't

You build

  • The flow, on the canvas
  • The API endpoints your Send Data nodes call
  • Your shortcode agreement with an aggregator

Asterisks runs

  • Parsing each aggregator's request
  • Session state between screens
  • Responses in each aggregator's format
  • Session logs and billing