Asterisk Configuration - New

Below we provide example configurations for using Vonage's SIP service with Asterisk.

Downloading the Asterisk Configuration

  1. First, you must complete the SIP Trunking wizard, or choose instead to build from manual config.
  2. Once complete you will see a button to download an Asterisk config (PJSIP).
  3. The Asterisk config is returned with relevant parameters pulled from the SIP trunk config you setup in step 1.
[transport-udp]
  type=transport
  protocol=udp
  bind=0.0.0.0

[vonage]  
 type = endpoint
  aors = vonage
  outbound_auth = vonage-auth
  context = inbound
  transport=transport-udp
  allow=alaw
  allow=ulaw
  allow=g729
  allow=iLBC
  allow=g722
  allow=speex16

  from_user= <Vonage LVN(447469186226>  (If customer only has 1 number then allocate this here)

[vonage]
  type = aor
  contact = sip:asterisk.sip-eu.vonage.com    -  SIP Domain as created in trunk dashboard
  qualify_frequency = 120

[vonage-auth]
  type = auth
  auth_type = userpass
  username = robcornes - UserKey from trunk config 
  password = SecretSecret24 - Secret from trunk config

[vonage-reg]
  type = registration
  outbound_auth = vonage-auth
  server_uri = sip:asterisk.sip-eu.vonage.com  -  SIP Domain as created in trunk dashboard
  client_uri = sip:asterisk.sip-eu.vonage.com  -  SIP Domain as created in trunk dashboard

[vonage-identify]
  type = identify
  endpoint = vonage
match=5.10.112.122
match=5.10.112.121
match=119.81.44.6
match=119.81.44.7
match=169.60.141.29
match=169.60.141.30
match=169.48.36.56
match=169.55.62.70
match=81.157.184.166
match=216.147.0.0/18

Installing the Asterisk Configuration

Once the config has been downloaded:

  1. Insert config into pjsip.conf, or a custom config file.
  2. Reload your Asterisk config - from the Asterisk command line the command is pjsip reload.
  3. Create a dialplan to route calls to the Vonage endpoint.
  4. Reload the dialplan.
  5. Make a test call.