UssdPush

A UssdPush resource represents a message sent from Restcomm-Connetc to a USSD Gateway.

UssdPush Resource URI

/2012-04-24/Accounts/{AccountSid}/UssdPush

Supported Operations

HTTP POST sends a USSD message to the configured USSD Gateway

Example of UssdPush

The USSD Gateway to which Restcomm must send the USSD message must be configured in the restcomm.xml file. IP address and port must be configured (i.e. they are mandatory). Username/password for the USSD are optional.

    <!-- TelScale USSD Gateway -->
    <ussd-gateway>
        <ussd-gateway-uri>IP_USSD_GW:PORT_NUMBER</ussd-gateway-uri>
        <ussd-gateway-user></ussd-gateway-user>
        <ussd-gateway-password></ussd-gateway-password>
    </ussd-gateway>

See below a general curl example for the USSD Push to the destination number 13019007654 (the MSISDN that will receive the USSD push session or notification according to YOUR_USSD_APP logic).

curl -X POST -H "application/json" https://ACae6e420f425248d6a26948c17a9e2acf:YOUR_PWD@RESTCOMM_IP_ADDRESS/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/UssdPush -d "From=Restcomm" -d "To=13019007654" -d "Url=https://RESTCOMM_IP_ADDRESS/restcomm-rvd/services/apps/YOUR_USSD_APP/controller"

For example, let’s assume Restcomm-Connect runs over IP address 10.20.42.161 and HTTPS is disabled. So, assuming Restcomm-Connect HTTP default port is left to 8080, the following shows a curl example for a USSD Push session or notification sent to MSISDN 99077937, where YOUR_USSD_APP is an RVD project identified by AP8945ca7c0a534b1c8ec9c82b4e999a8c and YOUR_PWD equals the authorization token f8bc1274677b173d1a1cf3b9924eaa7e:

curl -X POST -H "application/json" http://ACae6e420f425248d6a26948c17a9e2acf:f8bc1274677b173d1a1cf3b9924eaa7e@10.20.42.161:8080/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/UssdPush.json -d "From=myRestcommPushUssdApp" -d "To=99077937" -d "Url=http://10.20.42.161:8080/restcomm-rvd/services/apps/AP8945ca7c0a534b1c8ec9c82b4e999a8c/controller"

Note that the previous example differs from the general one not only by the fact that HTTP is used instead of HTTPS (then port is provided), but also by using json format. Then, a json answer like the following should be displayed (otherwise, an analogous XML answer would be displayed):

{
  "sid": "ID6f9befbbcbb4467d9e165353da159e70-CAe2d63be956d04c1ea86f8419a0212f14",
  "InstanceId": "ID6f9befbbcbb4467d9e165353da159e70",
  "date_created": "Mon, 25 Sep 2017 00:21:43 -0300",
  "date_updated": "Mon, 25 Sep 2017 00:21:43 -0300",
  "account_sid": "ACae6e420f425248d6a26948c17a9e2acf",
  "to": "99077937",
  "from": "USSD REST API",
  "status": "QUEUED",
  "price_unit": "USD",
  "direction": "outbound-api",
  "api_version": "2012-04-24",
  "uri": "/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Calls/ID6f9befbbcbb4467d9e165353da159e70-CAe2d63be956d04c1ea86f8419a0212f14.json",
  "subresource_uris": {
    "notifications": "/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Calls/ID6f9befbbcbb4467d9e165353da159e70-CAe2d63be956d04c1ea86f8419a0212f14/Notifications.json",
    "recordings": "/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Calls/ID6f9befbbcbb4467d9e165353da159e70-CAe2d63be956d04c1ea86f8419a0212f14/Recordings.json"
  }
}

Once the USSD Push session or notification is ended (by either the user or the application, status will transition from queued to completed.