Help & Support

Recipe: Tropo Callback

This recipe describes having SIPSorcery forward a call to Tropo, use a Tropo dial plan to request the user to enter a number, transfer the call back from Tropo to SIPSorcery and finally have SIPSorcery place a new call using the number the user entered in Tropo and connect it to the original call. This sort of call is called a few different things such as Direct Inward System Access (DISA) or call through. For SIPSorcery users it's useful to allow callers to specify an arbitrary call destination and then have the call placed using the existing SIPSorcery dial plan rules.

The mechanism used to get the call back from Tropo to SIPSorcery relies on using an HTTP (web request) to get SIPSorcery to take the call back from Tropo and terminate the Tropo leg. This roundabout mechanism is required because Tropo does not support blind SIP transfers. Tropo does support attended SIP transfers but while that is appropriate in some circumstances where the outbound call processing should stay with Tropo in other cases it's less desirable.

The steps to set up the Tropo callback are listed below.

  1. Create a new Tropo application (you'll need to sign up for an account if you don't already have one). Set the Tropo dialplan as shown in the code snippet below. You need to put in your own SIPSorcery username where indicated and also set the PIN number to control access to your callbacks.

    The SIPSorcery blind transfer web service method takes three parameters:

    • user must be your sipsorcery username,
    • callid is used to identify the call leg that’s being transferred out of the call,
    • destination this is the value that will end up in the SIPSorcery transfer dialplan as req.URI.User.
  2. Create a new dialplan on your SIPSorcery account called transfer, this is the dial plan the callback will be processed in when the HTTP request arrives from Tropo. There is nothing special required in the transfer dial plan although it is a good idea to restrict the set of destinations that can be called if feasible in order to avoid the risk of an unauthorised call. An example of a transfer dial plan is show below. The else line that is commented out should only be enabled if you are confident you understand the implications.
  3. The last step is to forward calls from your main dial plan, either incoming or outgoing, to the SIP URI of the Tropo application created in step 1. There is nothing special required for this step. An example of a dial command is show below.