Users will want to make calls to the public telephone network (PSTN). You may have facilities for this, but if not you will need to buy service from one or more carriers. These are companies who will take your calls and forward them to the PSTN. You can use as many carriers as you wish, using different carriers for inbound and outbound, and for different outbound destinations. It's common to use one carrier for most outbound calls, and other carriers who can offer cheaper rates for calls to specific destinations.

A peer is any machine that Enswitch can send calls to reach the PSTN. Typically, there will be one peer for each carrier used for outbound calls. SIP, IAX, and Zaptel (E1 or T1) peers can configured through the Enswitch web interface. Any other method for connecting to carriers that Asterisk supports can be configured by sending calls to a context in Asterisk's extensions.conf. Advanced number mangling can also be done in this way.

The peer that is used for any given number is set per route. This allows the choice of peer to be set down to an individual external number. For instance, if a customer is complaining that calls to their home are poor quality, the peer can be changed for just this number.

If you are familiar with Asterisk's concept of peers, please note that Asterisk and Enswitch peers have a similar meaning, but the two are separate; a peer configured in Enswitch is not available to Asterisk, and vice versa.

Peers are only used for outbound calls. Inbound calls are not matched against peers, and peers have no effect at all on inbound calls.

To add a new peer

  1. Log in to the Enswitch web interface.
  2. Go to System » Peers.
  3. Click the "New" button.
  4. If Enswitch has a pre-defined peer for the carrier you wish to use, click "Pre-defined". Otherwise, click "Manually configured".
  5. If you chose pre-defined, select the carrier. If you chose manually configured, skip this step.
  6. Fill in the peer's details as desired. Depending upon the protocol you choose, different options will appear. For SIP and IAX, leaving the username and password blank will prevent any from being sent. For context, the context specified must be the same as in extensions.conf ("to-carrier" in the example below).
  7. Click the "Save" button.
  8. If using the context protocol, on each Asterisk machine add an entry to /etc/asterisk/zapata.conf, /etc/asterisk/sip.conf, /etc/asterisk/iax.conf, or similar with the appropriate settings. If unsure how to do this, please contact your Enswitch vendor.
  9. If using the context protocol, on each Asterisk machine add an entry to /etc/asterisk/extensions.conf similar to:
    [to-carrier]
    exten => _X., 1, Dial(SIP/${EXTEN}@carrier,,)
    If unsure how to do this, please contact your Enswitch vendor.
  10. Go back into the peer's settings, and click the "Outbound costs" link.
  11. For each outbound group this peer can route calls to, click the "New" link.
  12. Fill in the following:
    • Choose the outbound group.
    • The starting time for this cost. It will not be used before then.
    • The ending time for this cost. It will not be used after then.
    • The priority of this cost. If multiple costs are currently active, the highest priority one will be used.
    • The connect fee that is charged as soon as the call is answered.
    • The number of seconds included free with the connect fee.
    • The cost per minute after that.
    • The increment for the cost per minute.
    • The minimum cost for the call.
  13. Click the "Save" button.
  14. Repeat for any other outbound groups this peer can route calls to.

Once the peer has been created, routes can be set to use it.