Configuration example:
SCCP/SIP phone and Directory number config

 

The CME configured as below:

ip dhcp excluded-address 192.168.255.1 192.168.255.10

ip dhcp pool ephone255
 network 192.168.255.0 255.255.255.0
 default-router 192.168.255.2 
 option 150 ip 192.168.255.2 

!-- option 150 ip must match the ip specified by "ip source-address" under telephony service
 lease 7
!
!
voice service voip 
 allow-connections h323 to h323
 allow-connections h323 to sip
 allow-connections sip to h323
 allow-connections sip to sip
 redirect ip2ip
 signaling forward unconditional
 sip
 bind control source-interface FastEthernet1/0
 bind media source-interface FastEthernet1/0
 registrar server
!
!
voice class codec 1
 codec preference 1 g711alaw
 codec preference 2 g711ulaw
 codec preference 3 g729r8
 codec preference 4 g729br8
 codec preference 6 g723ar63
!
!
!
!
voice register global
 mode cme
 source-address 192.168.255.2 port 5060
 max-dn 10
 max-pool 10
 authenticate realm local
 timezone 47
 date-format D/M/Y
 dst start Oct week 1 day Sun time 02:00
 dst stop Apr week 1 day Sun time 02:00
 tftp-path flash:
 file text
 create profile sync 0001324321105938
!
voice register dn 1
 number 1003
 name Peter
 label Peter
!
voice register pool 1
 id mac 000C.2917.A83B
 number 1 dn 1
 dtmf-relay rtp-nte
 voice-class codec 1
 username 1003 password test123
!
!
!
interface FastEthernet0/0
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface FastEthernet1/0
 ip address 192.168.255.2 255.255.255.0
 duplex auto
 speed auto
!
!
!
no ip http server
no ip http secure-server
!
no cdp log mismatch duplex
!
!
!
!
!
!
control-plane
!
!

dial-peer voice 1 voip
 destination-pattern 1...
 session protocol sipv2
 dtmf-relay sip-notify
 codec g711alaw
 no vad
!
!
!
!
!
telephony-service
 max-ephones 190
 max-dn 300
 ip source-address 192.168.255.2 port 2000
 cnf-file location flash:
 mwi relay
 max-conferences 8 gain -6
 web admin system name cisco password cisco
 dn-webedit 
 time-webedit 
 transfer-system full-consult
 create cnf-files version-stamp Jan 01 2002 00:00:00
!
!
ephone-dn 1
 number 1002
 label frank
 name frank
!
!
ephone 1
 device-security-mode none
 mac-address 000C.292B.C840
 type CIPC
 button 1:1
!
!

 

Troubleshooting

1 .  debug voice ccapi inout

The debug voip ccapi inout EXEC command traces the execution path through the call control API, which serves as the interface between the call session application and the underlying network-specific software. You can use the output from this command to understand how calls are being handled by the router.

This command shows how a call flows through the system. Using this debug level, you can see the call setup and teardown operations performed on both the telephony and network call legs.

you can dial, and hear the ringing, but it disconnect once you click answer.

2.  debug ccsip

  • debug ccsip calls: This command displays all SIP call details as they are updated in the SIP call control block. You can use this debug command to monitor call records for suspicious clearing causes.
  • debug ccsip errors: This command traces all errors that are encountered by the SIP subsystem.
  • debug ccsip events: this command traces event, such as call setups, connections and disconnections. An events version of a debug command is often the best place to start because detailed debugs provide much useful information.

Enable debug:

debug ccsip calls

Redial and generate debug messages:

*Mar  1 00:48:58.203: //27/EFD853388035/SIP/Call/sipSPICallInfo: 

The Call Setup Information is:

Call Control Block (CCB) : 0x66BA6E24

State of The Call        : STATE_DEAD

TCP Sockets Used         : NO

Calling Number           : 1002

Called Number            : 1003

Source IP Address (Sig  ): 192.168.255.2

Destn SIP Req Addr:Port  : 192.168.255.129:5060

Destn SIP Resp Addr:Port : 192.168.255.129:5060

Destination Name         : 192.168.255.129

CME2#

*Mar  1 00:48:58.203: //27/EFD853388035/SIP/Call/sipSPIMediaCallInfo: 

Number of Media Streams: 1

Media Stream             : 1

Negotiated Codec         : No Codec     //issue here

Negotiated Codec Bytes   : 0

Negotiated Dtmf-relay    : 0

Dtmf-relay Payload       : 0

Source IP Address (Media): 192.168.255.2

Source IP Port    (Media): 16946

Destn  IP Address (Media): 0.0.0.0

Destn  IP Port    (Media): 0

Orig Destn IP Address:Port (Media): 0.0.0.0:0

*Mar  1 00:48:58.207: //27/EFD853388035/SIP/Call/sipSPICallInfo: 

Disconnect Cause (CC)    : 65

Disconnect Cause (SIP)   : 200

We found there is no codec configured, to resolve this issue, create codec class:

voice class codec 1

 codec preference 1 g711alaw

 codec preference 2 g711ulaw

 codec preference 3 g729r8

 codec preference 4 g729br8

 codec preference 5 g722-64

 codec preference 6 g723ar63

Apply to Voice register pool:

voice register pool  1

 id mac 000C.2917.A83B

 number 1 dn 1

 dtmf-relay rtp-nte

 voice-class codec 1

Redial and check the debug.

*Mar  1 01:20:14.723: //33/442A29208043/SIP/Call/sipSPICallInfo: 

The Call Setup Information is:

Call Control Block (CCB) : 0x66BAB1DC

State of The Call        : STATE_DEAD

TCP Sockets Used         : NO

Calling Number           : 1002

Called Number            : 1003

Source IP Address (Sig  ): 192.168.255.2

Destn SIP Req Addr:Port  : 192.168.255.129:5060

Destn SIP Resp Addr:Port : 192.168.255.129:5060

Destination Name         : 192.168.255.129

CME2(config-class)#

*Mar  1 01:20:14.727: //33/442A29208043/SIP/Call/sipSPIMediaCallInfo: 

Number of Media Streams: 1

Media Stream             : 1

Negotiated Codec         : g711alaw

Negotiated Codec Bytes   : 160

Negotiated Dtmf-relay    : 6

Dtmf-relay Payload       : 101

Source IP Address (Media): 192.168.255.2

Source IP Port    (Media): 19492

Destn  IP Address (Media): 192.168.255.129

Destn  IP Port    (Media): 5062

Orig Destn IP Address:Port (Media): 0.0.0.0:0

*Mar  1 01:20:14.731: //33/442A29208043/SIP/Call/sipSPICallInfo: 

Disconnect Cause (CC)    : 16

Disconnect Cause (SIP)   : 200
SCCP registration

 

Go to the status message check which tftp file it tried to download.

Make sure the ip address in the DHCP option 150 matches the ip source-address in telephony service configuration mode.

now the two phones should connect

 

Reference

https://www.cisco.com/c/en/us/support/docs/voice-unified-communications/unified-communications-manager-express/99946-cme-sip-guide.html