Recipe: Callcentric Voicemail

This recipe describes setting up a Callcentric voicemail account to work with SIPSorcery. SIPSorcery doesn't provide media services of any kind, so voicemail needs an external service. This recipe uses a Callcentric voicemail account, but a voicemail service from another provider should work the same way.

Callcentric's pages have changed since this recipe was first written, so the names of the menus below may differ slightly.

  1. If you don't already have a Callcentric voicemail account, create one on the Callcentric site.
  2. Set up your voicemail options in Callcentric's voicemail preferences. Among other things you can have an email sent when a voicemail is received, an essential feature of a modern voicemail system.
  3. Set up how calls to your Callcentric number are handled. This recipe assumes you only use the Callcentric account for voicemail, so every call to its number should go straight to voicemail. In Callcentric's call treatments, add a treatment with a single rule that always sends calls to voicemail.
  4. Finally, set up your SIPSorcery incoming dial plan to use the Callcentric voicemail account. The simplest incoming dial plan, which doesn't look at the number called, is something like the one below. Replace YOUR_SIPSORCERY_SIPACCOUNT with the username of one of your own SIP accounts, and 177722xxxxx with your Callcentric number.
    sys.Log("incoming call...")
    sys.Dial("YOUR_SIPSORCERY_SIPACCOUNT@local", 20) # Try ringing your SIP account for 20 seconds.
    sys.Dial("177722xxxxx@in.callcentric.com") # Then forward the call to your Callcentric voicemail.

    A slightly more sophisticated dial plan that only sends calls that came in through one particular provider to voicemail is shown below. It assumes that provider sends its incoming calls to a SIP account named fred-important, by that account being the provider's Contact URI; see Incoming call processing.

    if req.URI.User == "fred-important"
      sys.Log("Incoming call on IMPORTANT line.")
      sys.Dial("YOUR_SIPSORCERY_SIPACCOUNT@local", 20)
      sys.Dial("177722xxxxx@in.callcentric.com")
    else
      sys.Log("Incoming call.")
      sys.Dial("YOUR_SIPSORCERY_SIPACCOUNT@local")
    end