CME – Configuring a SIP trunk

      5 Comments on CME – Configuring a SIP trunk

A typical type of outbound connectivity defined on a IP telephone system is a SIP trunk.  SIP is Session Initiation Protocol which is, ironically, what it stands for as well.  The description couldn’t be more accurate.  SIP as protocol defines the way that voice calls are setup, maintained, and terminated in an IP telephony network.  SIP, in my mind, offers ISDN/PSTN like features over existing infrastructure (in many cases), at significantly lower costs, and with extended capabilities.

One misconception I’ve heard rather frequently is that SIP is the protocol used to carry voice and data packets between the endpoints.  This isn’t true at all.  SIP is the protocol used to establish the session and maintain it, it does not actually carry the voice payload.  In most cases RTP is the protocol that is used to transfer the traffic between the endpoints.  So while the two protocols are directly related to each other, they both perform their own separate tasks.

At the core level there are two types of SIP network objects, clients and servers.  The clients can be something like an actual IP phone that has SIP functionality or a gateway device that is the terminating point for a SIP trunk.  The clients are often referred to as user agents (UA) or endpoints.  On the server side there are a few different types of servers.  I’ll talk about the 2 main server types briefly.

Proxy Server – The server that receives the SIP request from a SIP client and forwards the request to its next hop.  The next hop can be another proxy server or a receiving user agent.  Proxies general support basic functionality such as AAA, routing, and other security features.
Registrar Server – Handles the registration for a client user agent.

SIP uses what many call a ‘HTTP-like’ request and response model for communication between the network objects.  The user agents in a SIP network are identified by a email like address in this format…

sip:<SIP-UA ID>@SIPgateway.com

The SIP-UA ID can be a username or a standard telephone number.  The SIPGateway can be a a domain or a specific IP address.

While that was by no means a detailed description, it should give you some base understanding of what SIP is and its function in an IP telephony network.  In my last post, we did a full CME 7.1 setup but we didn’t talk much about the SIP trunk setup piece of the configuration.  Let’s run through that configuration now.

The entire SIP trunk configuration we did looked like this…

sip-ua
  credentials username <username> password <passwd> realm sip-ua.com
  registrar dns:proxy.sip-ua.com expires 60
  authentication username <username> password
<passwd>
  sip-server dns:proxy.sip-ua.com

So from what we’ve learned above, we know that the 2801 in this case is acting as SIP user agent.  So that fact that we are in ‘SIP-UA’ configuration mode makes sense.  The line…

credentials username <username> password <passwd> realm sip-ua.com

Provides the user agent with the credentials it needs to log into the SIP server to receive inbound calls.  The ‘realm’ piece of it tells the user agent that these credentials should be used when registering to a gateway that’s in the ‘sip-ua.com’ diomain.  The next line…

registrar dns:proxy.sip-ua.com expires 60

Tells the user agent that proxy.sip-ua.com is the registrar it should be using to register itself with the SIP server.  Note how its prefaced with ‘dns’.  If we wanted to use an IP address we could use the ‘ipv4’ preface followed by a version 4 IP address.  These two lines alone are all the configuration that is required to allow inbound calling.  The next two lines, are what is required to make outbound calling on the same SIP trunk.  The line…

  authentication username <username> password <passwd>

Provides the authentication needed when making an outbound call on the SIP trunk.  The next line…

  sip-server dns:proxy.sip-ua.com

Configures a SIP server interface on the gateway.  Again, we point this towards the proxy.sip-ua.com FQDN.  These two lines together are what is required to make outbound calls.

As you saw in the full example, we put a button on the phone for the external line.  Once that’s done, the system knows that inbound calls should ring on that button.  For outbound calls, we just need to have a dial peer that matches the digits dialed and has a destination of the ‘sip-server’ defined in the last line of the sip-ua configuration.  In our example, dial peers 1, 2, and 3 all have that as their destination…

dial-peer voice 1 voip
  description *** 10 Digit Calls ***
  destination-pattern [2-9]..[2-9]……
  session protocol sipv2
  session target sip-server
  dtmf-relay rtp-nte
  codec g711ulaw
  no vad

In the next post, we’ll talk more about dial-peers in more detail.

5 thoughts on “CME – Configuring a SIP trunk

  1. Brj

    Hi,
    I followed you instructions and outgoing calls are working fine, but I’m having problems with incoming calls, I want to ring a specific extension, lets say ext.301. but cannot achieve that.

    I’d be very grateful for any helpful suggestions.

    thanx

    Reply
    1. Jon Langemak Post author

      I can try to help, but its been awhile 🙂

      Do you see traffic coming into the CME box? Its just not working?

      Reply
      1. Brandon Price

        Hi Jon, I’m digging up a super old thread, but I’m hoping you can still help. I have basically the same problem. Outbound works fine. I can see the call coming into the CME but it doesn’t go anywhere. I’m really new to the CME. All I want basically is to have all calls that come in regardless of number dialed or caller-id or really anything to go straight to my hunt group at pilot 2020. I have made this work with my analogs by doing connection plar 2020 for that analog voice port, but I want my SIP calls to do the exact same thing. I would really appreciate any ideas you might have, I’ve tried everything I can think of.

        Here are some of the things I have in the config now:

        voice translation-rule 1
        rule 1 /\(.*\)/ /2020/
        !
        !
        voice translation-profile Incoming
        translate called 1

        dial-peer voice 1 voip
        description **Incoming Call from SIP Trunk**
        translation-profile incoming Incoming
        session protocol sipv2
        session target dns:{my sip provider info}
        dtmf-relay rtp-nte
        codec g711ulaw
        no vad

        Reply
  2. David E Smith

    Hi,

    Can I use one router for the SIP trunk and another for the CME? I use a 2811 for my home router. But I have another 2811 for labs. How can I build a SIP lab? I have a free SIP trunk with a service provider I want to use

    Reply
  3. voip

    Excellent way of describing, and nice paragraph to take data on the topic of my presentation subject,
    which i am going to present in college.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *