Cisco CME How To Configure SIP Trunk VOIP

This is how we configure outside PSTN access or dialing through another SIP trunk.  Beware that this a simplistic example that neglects most security including SRTP

First you'll need to be in config mode:

Step - 1 Enter Voice Service VOIP security options

There are more options but for now we'll just focus on security/allowing connections to and from our phones and the trunk.

Router(config)#voice service voip
 

Then enter the trusted IP list:

Router(conf-voi-serv)#ip address trusted list

Set Trusted IPs:

In practice you would set the static IPs/ranges of your SIP trunk(s)

o be easy/insecure for testing just set any IP as being trusted (for trusted/LAN/testing only!)

Router(cfg-iptrust-list)#ipv4 0.0.0.0 0.0.0.0

To set a specify IP

This could be one of your SIP trunk IPs

Router(cfg-iptrust-list)#ipv4 192.168.5.20 255.255.255.0

To set a range (/24):

This may be a range of phones on your internal network that you want to trust.

Router(cfg-iptrust-list)#ipv4 10.0.0.0 255.255.255.0

You can add more entries as needed.

Step 2 - Setup Trunk

We'll set our preferred codec list

Router(config)#voice class codec 1


Router(config-class)#codec preference 1 g711ulaw
Router(config-class)#codec preference 2 g729r8

 

Go back to config mode:

Here is how we setup our trunk, depending on your service provider it may have different requirements (most providers will provide example configs).

Basically we are just authenticating using our username and password from our SIP provider and the last part "realm" is the IP or domain of the server.

authentication command will use the default username/password when authenticating. 

credentials command is really the same but you can have multiple of these (eg. if you have accounts with multiple SIP trunks/providers).

Router(config)#sip-ua

Router(config-sip-ua)#credentials username YOUR-USERNAME password 0 YOUR-PASSWORD realm IP-or-domain-of-Trunk.com

There is another option for credentials which can specify a specific phone number tied to the account (some providers do this and some may not).


Router(config-sip-ua)#credentials number 1234 username YOUR-USERNAME password 0 YOUR-PASSWORD realm IP-or-domain-of-Trunk.com

 

Router(config-sip-ua)#authentication username YOUR-USERNAME password 0 YOUR-PASSWORD realm IP-or-domain-of-Trunk.com

Step 3 - Use Trunk for outgoing calls

This is a generic use the trunk for all non-local calls, but in practice, you may have many providers and may have a more specific dial pattern so perhaps calls for country ABC go through dialpeer 4444 to give better or cheaper calls to a specific destination.

Be in config mode

In our example we call our dial-peer "123" but it could be any unused number.

Create the dial-peer

Router(config)#dial-peer voice 123 voip

We set destination pattern as anything starting with a 9 (the idea is that 9 is for dialing out, change according to your needs).

Router(config-dial-peer)#destination-pattern 9T

We set the protocol as sip, since we use this protocol for a SIP trunk of course.

Router(config-dial-peer)#session protocol sipv2

We set the codec, a very standard g711ulaw, but change according to your needs (what your provider also must support).

Router(config-dial-peer)#codec g711ulaw

Set callerid (usually should be the number your provider assigned):

In this example we set callerid as "12345678"

Router(config-dial-peer)#clid network-number 12345678

Set your session target

It's Cisco talk about which IP/domain do we send the calls to when this dial-peer is matched?

You can use a hostname like this

Router(config-dial-peer)#session target dns:your-server-domain

Or preferably if they have a static IP use this:

Router(config-dial-peer)#session target ipv4:192.168.5.254

 

Congrats, after this you should be able to make outgoing calls to the PSTN!

 

 


Tags:

cisco, cme, configure, sip, voipthis, pstn, dialing, ll, config, mode, voip, router, ip, conf, voi, serv, ips, static, ranges, insecure, lan, cfg, iptrust, ipv, specify, entries,

Latest Articles

  • FreePBX 17 How To Add a Trunk
  • Docker Container Onboot Policy - How to make sure a container is always running
  • FreePBX 17 How To Add Phones / Extensions and Register
  • Warning: The driver descriptor says the physical block size is 2048 bytes, but Linux says it is 512 bytes. solution
  • Cisco How To Use a Third Party SIP Phone (eg. Avaya, 3CX)
  • Cisco Unified Communication Manager (CUCM) - How To Add Phones
  • pptp / pptpd not working in DD-WRT iptables / router
  • systemd-journald high memory usage solution
  • How to Install FreePBX 17 in Linux Debian Ubuntu Mint Guide
  • How To Install Cisco's CUCM (Cisco Unified Communication Manager) 12 Guide
  • Linux Ubuntu Redhat How To Extract Images from PDF
  • Linux and Windows Dual Boot Issue NIC Won't work After Booting Windows
  • Cisco CME How To Enable ACD hunt groups
  • How to install gns3 on Linux Ubuntu Mint
  • How to convert audio for Asterisk .wav format
  • Using Cisco CME Router with Asterisk as a dial-peer
  • Cisco CME How To Configure SIP Trunk VOIP
  • Virtualbox host Only Network Error Failed to save host network interface parameter - Cannot change gateway IP of host only network
  • Cisco CME and C7200 Router Testing and Learning Environment on Ubuntu 20+ Setup Tutorial Guide
  • Abusive IP ranges blacklist