Users will want to make calls to the public telephone network (PSTN), and receive calls from it. 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, and deliver calls to you from 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 countries.

A peer is any machine that Enswitch can send calls to to reach the PSTN. Typically, there will be one peer for each carrier used for outbound calls. Any method for connecting to carriers that Asterisk supports can be used. The most common are PRI E1s or T1s, SIP, and IAX2.

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. Each Enswitch peer has an Asterisk extensions.conf context that is used to make the outbound call. This gives Asterisk's flexible call routing with Enswitch's ease of changing the peer for a route within the web interface.

To add a new peer

  1. On each Asterisk machine, add a 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.
  2. On each Asterisk machine, add a entry to /etc/asterisk/extensions.conf similar to:
    [to-carrier]
    exten => _X., 1, Dial(SIP/${EXTEN}@carrier,,${ENSWITCH-CUTOFF})
    exten => h, 1, DeadAGI(agi://127.0.0.1/end)
    If unsure how to do this, please contact your Enswitch vendor.
  3. Log in to the Enswitch web interface.
  4. Go to System » Peers.
  5. Click the "Add a new peer" button.
  6. Fill in the peer's details as desired. The context must be the same as in extensions.conf ("to-carrier" in the example above).
  7. Click the "Save" button.
  8. Go back into the peer's settings, and click the "Outbound costs" link.
  9. For each outbound group this peer can route calls to, click the "Add a new cost" link.
  10. Fill in the following:
    • Choose the outbound group.
    • 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.
  11. Click the "Save" button.
  12. 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.