Está en la página 1de 32

Implementing SIP

Gateways

Implementing VoIP Gateways

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—3-1


SIP Fundamentals

 SIP is a simple extensible protocol.


 SIP is defined in IETF RFC 2543 and RFC 3261.
 SIP creates, modifies, and terminates multimedia sessions with
one or more participants.
 SIP leverages various standards: RTP, RTCP, HTTP, SDP, DNS,
SAP, MGCP, and RTSP.
 SIP performs addressing by E.164, e-mail, or DNS service record.
 SIP is ASCII text-based for easy implementation and debugging.

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—3-2


SIP Fundamentals (Cont.)

SIP provides these capabilities:


 Determines the location of the target endpoint
 Determines the media capabilities of the target endpoint
 Determines the availability of the target endpoint
 Establishes a session between the originating and target
endpoints
 Handles the transfer and termination of calls

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—3-3


How SIP Works

 ASCI-based protocol
 User identified by a unique SIP address
– sip:userID@gateway.com
 Users register with registrar server using their assigned SIP
addresses
 When user initiates a call, a SIP request is sent to a SIP server
 Location of end user can be dynamically registered with the SIP
server

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—3-4


Why SIP

Advantages of SIP gateways:


 Dial-plan configuration directly on the gateway
 Translations defined per gateway
 Advanced support for third-party telephony system integration
 Interoperability with third-party voice gateways
 Support of third-party end devices (SIP phones)

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—3-5


SIP Architecture
SIP Proxy,
Registrar,
Location, and
Redirect Servers

SIP

SIP SIP
SIP User Agents
(UAs) PSTN
SIP Gateway
RTP
T1 or
PRI

Legacy
PBX

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—3-6


SIP Call Flow
SIP Proxy SIP Gateway
Server
PSTN
Invite (SDP)
Invite (SDP)
100 Trying
100 Trying
180 Ringing
Signaling
180 Ringing
200 OK
200 OK
ACK ACK

RTP Stream Bearer or Media

BYE
200 OK Signaling

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—3-7


Direct Call Setup
SIP Gateway SIP Gateway

IP

Calling Party Invite (SDP) Called Party

100 Trying SIP Signaling and SDP


(UDP or TCP)
180 Ringing

200 OK

ACK

RTP Stream Bearer or Media


(UDP)
BYE

200 OK Signaling

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—3-8


Call Setup Using a Proxy Server
Proxy Server
SIP Gateway SIP Gateway

IP
Invite
Calling Party (SDP) Invite (SDP) Called Party

100 100 Trying


SIP Signaling and SDP Trying
(UDP or TCP) 180 Ringing
180
Ringing
200 OK
200 OK
ACK
ACK

Bearer or Media RTP Stream


(UDP)
BYE BYE
200 OK 200 OK

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—3-9


Call Setup Using a Redirect Server
Redirect Server
SIP Gateway SIP Gateway

IP
Invite
Calling Party Called Party
Moved

SIP Signaling and SDP Invite


(UDP or TCP)
Trying

Ringing

OK

ACK

Bearer or Media RTP Stream


(UDP)
BYE
200 OK

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—3-10


SIP Addresses

 Fully qualified domain names


– sip:jdoe@cisco.com
 E.164 addresses
– sip:14085551234@gateway.com; user=phone
 Mixed addresses
– sip:14085551234; password=changeme@10.1.1.1
sip:jdoe@10.1.1.1

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—3-11


Address Registration

Registrar Redirect Location


Server Server Database

SIP Proxy
(UAS)
Register
Here I am! SIP UACs

SIP UACs

SIP Gateway

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—3-12


Address Resolution

Registrar Redirect Location


Server Server Database
Where is the name or phone
number?
SIP Proxy

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—3-13


SIP DTMF Configuration Considerations

SIP DTMF on Cisco Unified Communications Manager


 SIP DTMF requires MTP on Cisco Unified Communications
Manager.

SCCP Phone
Out-of-Band SCCP

Out-of-Band Information

SIP Gateway
In-Band SIP

RTP MTP RTP

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—3-14


SIP DTMF Considerations (Cont.)

SIP DTMF on Cisco IOS gateways:


 SIP DTMF relay is configured on gateways in dial-peer
configuration mode. There are two methods:
– RTP Named Telephony Event: Forwards DTMF tones by using
RTP with the NTE payload type
– SIP NOTIFY: Forwards DTMF tones using SIP NOTIFY
messages
 SCCP IP phones only support out-of band. Therefore SIP
NOTIFY must be used.

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—3-15


Configuring a SIP Gateway

 Enable SIP voice services


 Configure SIP service
– Transport
– Bind interface
 Configure SIP User Agent (UA)
– Timers
– Authentication
– SIP servers
 Configure dial-peer SIP parameters
– Session protocol
– Session target
– DTMF relay

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—3-16


Integrating Cisco IOS Gateways with a
SIP ITSP
Sip2.cisco.com
Configure Cisco Unified Communications Manager
Express to connect to a SIP service provider
network and route external calls via that connection.

SIP ITSP
SIP Gateway

router(config)# voice service voip


router(conf-voi-serv)# sip
router(conf-serv-sip)# session transport udp
router(conf-serv-sip)# bind control source-interface Loopback 0
router(conf-serv-sip)# bind media source-interface Loopback 0

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—3-17


Integrating Cisco IOS Gateways with a
SIP ITSP (Cont.)
Sip2.cisco.com

SIP ITSP

SIP Gateway

router(config)# sip-ua
router(config-sip-ua)# authentication username JDoe password secret
router(config-sip-ua)# registrar dns:sip2.cisco.com expires 3600
router(config-sip-ua)# sip-server dns:sip2.cisco.com
router(config-sip-ua)# retry invite 2
router(config-sip-ua)# retry response 2
router(config-sip-ua)# retry bye 2
router(config-sip-ua)# retry cancel 2

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—3-18


Integrating Cisco IOS Gateways with a
SIP ITSP (Cont.)
Cisco Unified
Sip2.cisco.com
Communications
Manager:
10.1.1.15 192.168.1.100

SIP Gateway

Ext.: 2…
SIP ITSP

router(config)# dial-peer voice 2000 voip


router(config-dial-peer)# destination-pattern 2...
router(config-dial-peer)# session protocol sipv2
router(config-dial-peer)# session target sip-server
router(config-dial-peer)# dtmf-relay rtp-nte
router(config)# dial-peer voice 2001 voip
router(config-dial-peer)# destination-pattern 2...
router(config-dial-peer)# session protocol sipv2
router(config-dial-peer)# session target ipv4:10.1.1.15
router(config-dial-peer)# dtmf-relay sip-notify
router(config-dial-peer)# preference 1
router(config)# dial-peer voice 90 voip
router(config-dial-peer)# destination-pattern 9T
router(config-dial-peer)# session target ipv4:192.168.1.100
router(config-dial-peer)# session protocol sipv2
router(config-dial-peer)# dtmf-relay rtp-nte
© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—3-19
Verifying SIP Gateways
Command Description

show sip-ua service Displays the status of the SIP VoIP service.

show sip-ua status Displays the status of the SIP UA.

show sip-ua register status Displays the status of E.164 numbers that a SIP
gateway has registered with an external primary
SIP registrar.
show sip-ua timers Displays SIP UA timers.

show sip-ua connections Displays active SIP UA connections.

show sip-ua calls Displays active SIP UA calls.

show sip-ua statistics Displays SIP traffic statistics.

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—3-20


Verifying SIP Gateways (Cont.)

Router# show sip service


SIP Service is up

Router# show sip-ua status


SIP User Agent Status
SIP User Agent for UDP : ENABLED
SIP User Agent for TCP : ENABLED
SIP User Agent bind status(signaling): DISABLED
SIP User Agent bind status(media): DISABLED
SIP max-forwards : 6
SIP DNS SRV version: 1 (rfc 2052)
Redirection (3xx) message handling: ENABLED

Router# show sip-ua timers


SIP UA Timer Values (millisecs)
trying 500, expires 180000, connect 500, disconnect 500
comet 500, prack 500, rel1xx 500, notify 500
refer 500, register 500

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—3-21


Verifying SIP Gateways (Cont.)

Router# show sip-ua register status

Line peer expires(sec) registered


4001 20001 596 no
4002 20002 596 no
5100 1 596 no
9998 2 596 no

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—3-22


Verifying SIP Gateways (Cont.)
router# show sip-ua calls
SIP UAC CALL INFO
Number of SIP User Agent Client(UAC) calls: 0

SIP UAS CALL INFO


Call 1
SIP Call ID : D215F304-7B5A11DC-8005EA1A-
6A8F4AD@10.10.10.2
State of the call : STATE_ACTIVE (7)
Substate of the call : SUBSTATE_NONE (0)
Calling Number : 2818902001
Called Number : 1003
Bit Flags : 0x1212003A 0x100000 0x488
CC Call ID : 1
Source IP Address (Sig ): 10.10.10.1
Destn SIP Req Addr:Port : 10.10.10.2:5060
Destn SIP Resp Addr:Port: 10.10.10.2:56884
Destination Name : 10.10.10.2
.
.
© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—3-23
Verifying SIP Gateways (Cont.)
.
.
Number of Media Streams : 1
Number of Active Streams: 1
RTP Fork Object : 0x0
Media Stream 1
State of the stream : STREAM_ACTIVE
Stream Call ID : 1
Stream Type : voice-only (0)
Negotiated Codec : g729r8 (20 bytes)
Codec Payload Type : 18
Negotiated Dtmf-relay : inband-voice
Dtmf-relay Payload Type : 0
Media Source IP Addr:Port: 10.10.10.1:18050
Media Dest IP Addr:Port : 10.10.10.2:16522
Orig Media Dest IP Addr:Port : 0.0.0.0:0

Number of SIP User Agent Server(UAS) calls: 1

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—3-24


Debug Commands

Command Description
debug asnl events Verifies that the SIP subscription
server is up.
debug voip ccapi inout Shows every interaction with the call
control API.
debug voip ccapi protoheaders Displays messages sent between
the originating and terminating
gateways.
debug ccsip For general SIP debugging; for
example views direction-attribute
settings and port and network
address-translation traces.

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—3-25


Debug Commands (Cont.)
HQ-1# debug ccsip messages

SIP Call messages tracing is enabled


HQ-1#
*Mar 6 14:19:14: Sent:
INVITE sip:3660210@166.34.245.231;user=phone;phone-context=unknown
SIP/2.0
Via: SIP/2.0/UDP 166.34.245.230:55820
From: "3660110" <sip:3660110@166.34.245.230>
To: <sip:3660210@166.34.245.231;user=phone;phone-context=unknown>
Date: Sat, 06 Mar 1993 19:19:14 GMT
Call-ID: ABBAE7AF-823100E2-0-1CD274BC@172.18.192.194
Cisco-Guid: 2881152943-2184249568-0-483551624
User-Agent: Cisco VoIP Gateway/ IOS 12.x/ SIP enabled
CSeq: 101 INVITE
Max-Forwards: 6
Timestamp: 731427554
Contact: <sip:3660110@166.34.245.230:5060;user=phone>
Expires: 180
Content-Type: application/sdp
Content-Length: 138

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—3-26


Debug Commands (Cont.)
*Mar 6 14:19:16: Received:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 166.34.245.230:55820
From: "3660110" <sip:3660110@166.34.245.230>
To: <sip:3660210@166.34.245.231;user=phone;phone-
context=unknown>;tag=27DBC6D8-1357
Date: Mon, 08 Mar 1993 22:45:12 GMT
Call-ID: ABBAE7AF-823100E2-0-1CD274BC@172.18.192.194
Timestamp: 731427554
Server: Cisco VoIP Gateway/ IOS 12.x/ SIP enabled
Contact: <sip:3660210@166.34.245.231:5060;user=phone>
CSeq: 101 INVITE
Content-Type: application/sdp
Content-Length: 138

v=0
o=CiscoSystemsSIP-GW-UserAgent 1193 7927 IN IP4 166.34.245.231
s=SIP Call
t=0 0
c=IN IP4 166.34.245.231
m=audio 20224 RTP/AVP 0
© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—3-27
Debug Commands (Cont.)

*Mar 6 14:19:19: Received:


BYE sip:3660110@166.34.245.230:5060;user=phone SIP/2.0
Via: SIP/2.0/UDP 166.34.245.231:53600
From: <sip:3660210@166.34.245.231;user=phone;phone-
context=unknown>;tag=27DBC6D8-1357
To: "3660110" <sip:3660110@166.34.245.230>
Date: Mon, 08 Mar 1993 22:45:14 GMT
Call-ID: ABBAE7AF-823100E2-0-1CD274BC@172.18.192.194
User-Agent: Cisco VoIP Gateway/ IOS 12.x/ SIP enabled
Max-Forwards: 6
Timestamp: 731612717
CSeq: 101 BYE
Content-Length: 0

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—3-28


Summary

 SIP is defined by IETF RFC 2543 and RFC 3261 and allows easy
integration with third-party VoIP networks.
 There are five advantages to using SIP gateways as voice
gateways.
 SIP is modeled on the interworking of UAs and network servers.
 A SIP call flow consists of signaling and transmitting bearer and
media packets.

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—3-29


Summary (Cont.)

 A SIP address consists of an optional user ID, a host description,


and optional parameters to qualify the address more precisely.
 SIP call-setup models include direct, proxy server, and
redirection.
 There are seven commands available on Cisco IOS to configure
SIP on Cisco IOS routers.
 There are at least thirteen commands available on Cisco IOS to
verify and troubleshoot a SIP integration.

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—3-30


Icons
Cisco Unified
POTS Voice
Gateway Communications
Phone
Manager

Cisco
Unified
IP Phone Switch IP
Border
Element

IP Telephony
Router with
Cisco Unified Router PBX
Communications
Manager
Express
Voice-Enabled Network
Router PC
Cloud

Line: Serial Line: Ethernet

© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—3-31


© 2008 Cisco Systems, Inc. All rights reserved. CVOICE v6.0—3-32

También podría gustarte