You are on page 1of 28

Introducción al protocolo SIP

Juan Salvador Escobar


CS Core

juan.salvador@mobilesrevices-group.com
Protocolo SIP

• SIP es un protocolo basado en requerimientos y respuestas


tipo texto similar al protocolo HTTP en su diseño.
• SIP se encarga principalmente de la iniciación y terminación
de sesiones incluyendo multiparty, multimedia o
transferencia de archivos, adicionalmente también se usa
para diferentes propósitos como mensajería instantánea y
servicios de valor agregado.
• Los usuarios son identificados usando una estructura tipo
email llamada SIP URL, como por ejemplo
sip:591605865@sipnetwork.com
Protocolo SIP (cont.)

• Un mensaje SIP es bien una petición desde un cliente hacia


un servidor o una respuesta desde un servidor hacia un
cliente. Ambos mensajes están compuestos de una línea de
inicio (Start Line), uno o mas encabezados (Headers) y un
contenido opcional (Message Body).

SIP Message structure


Request/Response Line
Header Field
Empty Line
Message Body (opcional)
SIP Request

• Las peticiones en SIP tienen una línea de inicio Request que


contiene un método, un Request-URI y una versión de
protocolo.
SIP Request (cont)

Mensaje Función
INVITE Inicia un nuevo dialogo o sesión
ACK Respuesta a un mensaje INVITE
BYE Fin de sesión
CANCEL Cancela una petición no terminada
REGISTER Registrarse
OPTIONS Preguntar sobre los atributos del servidor
INFO Opciones interactivos para una llamada
MESSAGE Short Message
SUBSCRIBE Suscribirse a un evento
NOTIFY Envío de un evento
SIP Request (cont.)

• INVITE
INVITE sip:bob@biloxi.com SIP/2.0
Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8
Max-Forwards: 70 To: Bob <sip:bob@biloxi.com>
From: Alice <sip:alice@atlanta.com>;tag=1928301774
Call-ID: a84b4c76e66710 CSeq: 314159
INVITE Contact: sip:alice@pc33.atlanta.com
Content-Type: application/sdp
Content-Length: 142

• REGISTER
REGISTER sip:registrar.biloxi.com SIP/2.0
Via: SIP/2.0/UDP bobspc.biloxi.com:5060;branch=z9hG4bKnashds7
Max-Forwards: 70
To: Bob sip:bob@biloxi.com
From: Bob <sip:bob@biloxi.com>;tag=456248
Call-ID: 843817637684230@998sdasdh09
CSeq: 1826 REGISTER
Contact: sip:bob@192.0.2.4
Expires: 7200 Content-Length: 0
SIP Response

• Las respuestas SIP se diferencian de las peticiones por que


tienen un Status-Line como línea de inicio. El Status-Line
consiste de una versión de protocolo seguida por un Status-
Code numérico y su respectiva frase de explicación Reason.
SIP Response (cont.)

• El primer digito de los mensajes define el tipo de respuesta,


los dos dígitos siguientes no tienen labor de categorización
especifica, únicamente complementan el tipo de respuesta.

Status Codes
1xx Respuesta provisional
2xx Respuesta Exitosa
3xx Redirección
4xx Error del cliente
5xx Error del Servidor
6xx Falla Global
SIP Response (cont.)
1xx Respuesta Temporal
100 Trying
180 Ringing
2xx Respuesta Exitosa
200 OK
202 Accepted
3xx Redireccion
301 Moved Permanently
302 Moved Temporarily
4xx Error del Cliente
480 Temporarily Unavailable
486 Busy Here
5xx Error del Servidor
500 Server Internal Error
503 Server Unavailable
6xx Falla Global
600 Busy Everywhere
606 Not Acceptable
SIP Response (cont)

• 100 Trying
SIP/2.0 100 Trying
Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8
To: Bob sip:bob@biloxi.com
From: Alice <sip:alice@atlanta.com>;tag=1928301774
Call-ID: a84b4c76e66710
CSeq: 314159 INVITE Content-Length: 0

• 180 Ringing
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8
To: Bob <sip:bob@biloxi.com>;tag=a6c85cf
From: Alice <sip:alice@atlanta.com>;tag=1928301774
Call-ID: a84b4c76e66710
Contact: sip:bob@192.0.2.4
CSeq: 314159 INVITE Content-Length: 0
Flujo de llamada

• En este ejemplo se muestra un flujo de llamada resumido


incluyendo únicamente los mensajes básicos.
Transacciones

• En general, una transacción incluye todos los mensajes


asociados con una petición (SIP Request) y su fin con un
mensaje 2xx. Cuando el mensaje ACK se refiere a una
respuesta 2xx se considera como una transacción
independiente.
Dialogo SIP

• Múltiples transacciones relacionan un dialogo. Un Dialogo


implica una relación punto a punto entre dos usuarios. De
acuerdo con los estándares, un dialogo únicamente puede
ser establecido usando una petición INVITE.
SIP-T y SIP-I
• Debido a ciertas limitantes de interoperabilidad que presenta
SIP al interactuar con la PSTN se desarrollan los protocolos
SIP-T y SIP-I para proveer parámetros específicos de ISUP.

SIP-T SIP-I
• Definido por la RFC3372 de la • Definido por TRQ.2815 y Q.1912.5
IETF. de la ITU.
• Es una extensión de SIP, por lo • Contiene requerimientos técnicos
que contiene la misma flexibilidad. de interoperabilidad entre 3GPPSIP
• Proporciona compatibilidad con y BICC/ISUP, SIP y BICC/ISUP y
telefonía tradicional lo que le hace SIP-I y BICC/ISUP en detalle.
adecuado para redes IP. • SIP-I hace uso de numerosos
• Permite a los mensajes SIP llevar estándares y drafts del IETF que
información de señalización ISUP. contienen no solo llamadas básicas
• Solo se concentra en la sino también la interoperabilidad de
interoperabilidad de llamadas los servicios suplementarios de
básicas y no incluye servicios BICC/SIP.
suplementarios.
Relación entre SIP y ISUP
• De acuerdo a los estándares mencionados anteriormente
existe un mapeo de mensajes y parámetros entre SIP y
ISUP.

Mensaje ISUP Mensaje SIP


Initial address message (IAM) INVITE
Subsecuent address message (SAM) INVITE
Address complete message (ACM) 180 RINGING / 183 PROGRESS
Answer message (ANM) 200 OK
Connect message (CON) 200 OK
Call progress message(CPG) 183 CALL PROGRESS
Release message (REL) BYE/CANCEL
Release complete message (RLC) N/A
Reset circuit (RSC) BYE/CANCEL (only for a call)
Circuit group reset message(GRS) BYE/CANCEL (only for a call)
Circuit group blocking message(CGB) BYE/CANCEL (only for a call)
Suspend message (SUS) Re-Invite or INFO
Resume message (RES) Re-Invite or INFO
Relación entre SIP y ISUP (cont)

Causa ISUP Causa SIP


1 unallocated number 404 Not Found
2 no route to network 404 Not found
3 no route to destination 404 Not found
16 normal call clearing BYE
17 user busy 486 Busy here
18 no user responding 408 Request Timeout
19 no answer from the user 480 Temporarily unavailable
20 subscriber absent 480 Temporarily unavailable
21 call rejected 403 Forbidden
22 number changed (w/o diagnostic) 410 Gone
22 number changed (w/ diagnostic) 301 Moved Permanently
23 redirection to new destination 410 Gone
26 non-selected user clearing 404 Not Found
27 destination out of order 502 Bad Gateway
28 address incomplete 484 Address incomplete
29 facility rejected 501 Not implemented
31 normal unspecified 480 Temporarily unavailable
Relación entre SIP y ISUP (cont)

Mensaje recibido SIP Causa en el mensaje REL


400 Bad Request 41 Temporary Failure
401 Unauthorized 21 Call rejected
402 Payment required 21 Call rejected
403 Forbidden 21 Call rejected
404 Not found 1 Unallocated number
405 Method not allowed 63 Service or option unavailable
406 Not acceptable 79 Service/option not implemented
407 Proxy authentication required 21 Call rejected
408 Request timeout 102 Recovery on timer expiry
410 Gone 22 Number changed (w/o diagnostic)
413 Request Entity too long 127 Interworking
414 Request-URI too long 127 Interworking
415 Unsupported media type 79 Service/option not implemented
416 Unsupported URI Scheme 127 Interworking
420 Bad extension 127 Interworking
421 Extension Required 127 Interworking
423 Interval Too Brief 127 Interworking
Call Flow MSS
Call Flow MSS
• INVITE sip :10.211.12.96:5072 SIP/2 .0
Content-Length:760
Via:SIP/2.0/UDP public.apollon.tas.com:5060;branch=z9hG4bK13Cg4CBA.eVZ3Xhb
From:<sip:User.0@apollon.tas.com>;tag=3Va08dZg15fd1e7U To:<sip:User.1@apollon.tas.com>
Call-ID: 681EE514642E6F6729E00549
CSeq:1 INVITE
Contact:<sip:+491774190000@10.211.7.112:5060;user=phone> Require:precondition
Supported: 100rel,precondition, timer
Allow:ACK,BYE, CANCEL, INVITE,MESSAGE,OPTIONS,PRACK,REGISTER,UPDATE Max-Forwards : 68
Min-SE: 90
Session-Expires:2000,refresher=uac Record-Route:<sip:AAZUB8gBCqUIAH+ArAGNzjAAG@10.211.7.112:5060;lr> Privacy: none
P-Asserted-Identity:tel:+491774190000,sip:User.0@apollon.tas.com Content-Type: application/sdp
v=0
o=- 0 1 IN IP4 10.211.7.158
s=MSS call
c=IN IP4 17.10.9.10 t=0 0
m=audio 2500 RTP/AVP 8 96 97 98 99 100 101 102
b=AS:64
a=rtpmap:8 PCMA/8000 a=rtpmap:96 AMR/8000 a=fmtp:96 mode-set=0,2,3,6; mode-change-period=1
a=rtpmap:97 AMR/8000
a=fmtp:97 mode-set=0,3,6; mode-change-period=1
a=rtpmap:98 AMR/8000
a=fmtp:98 mode-set=3,6; mode-change-period=1
a=rtpmap:99 AMR/8000
a=fmtp:99 mode-set=3; mode-change-period=1
a=rtpmap:100 AMR/8000
a=fmtp:100 mode-set=0,2,3,6; mode-change-period=2
a=rtpmap:101 AMR/8000
a=fmtp:101 mode-set=0,3,6; mode-change-period=2
a=rtpmap:102 AMR/8000
a=fmtp:102 mode-set=3,6; mode-change-period=2
a=curr:qos local none a=curr:qos remote none a=des:qos mandatory local sendrecv
a=des:qos none remote sendrecv
Call Flow MSS
• SIP/2.0 100 Trying
Content-Length:0
Via:SIP/2.0/UDP public.apollon.tas.com:5060;branch=z9hG4bK13Cg4CBA.eVZ3Xhb
From:<sip:User.0@apollon.tas.com>;tag=3Va08dZg15fd1e7U To:<sip:User.1@apollon.tas.com>
Call-ID: 681EE514642E6F6729E00549
CSeq:1 INVITE

• SIP/2.0 183 Session Progress


Via:SIP/2 . 0/UDP public.apollon.tas .com:5060;branch=z9hG4bK13Cg4CBA.eVZ3Xhb
From: <sip:User. 0@apollon.tas.com>;tag=3Va08dZg15fd1e7U
To: <sip:User. 1@apollon.tas .com>;tag=14383101f9
Require: 100rel, precondition RSeq: 1
Record-Route:<sip:AAZUB8gBCqUIAH+ArAGNzjAAG@10.211.7.112:5060;lr>
Call-ID: 681EE514642E6F6729E00549 CSeq:1 INVITE
Contact: sip:10.211.12. 96:5072 Content-Type: application/sdp Content-Length: 280
v=0
o=- 111111 112222 IN IP4 172.24.175.10
s=
c=IN IP4 172.24.175.10 t=0 0
m=audio 3456 RTP/AVP 8 a=rtpmap: 8 PCMA/8000 a=curr:qos local sendrecv a=curr:qos remote none
a=des:qos mandatory local sendrecv
a=des:qos mandatory remote sendrecv
a=conf:qos remote sendrecv

• PRACK sip:10.211.12 .96:5072 SIP/2.0


Content-Length:0
Via:SIP/2 . 0/UDP public.apollon.tas .com:5060;branch=z9hG4bKhCbaVe46UBc385aZ
From:<sip:User.0@apollon.tas.com>;tag=3Va08dZg15fd1e7U To:<sip:User.1@apollon.tas.com>;tag=14383101f9
Call-ID: 681EE514642E6F6729E00549
CSeq:2 PRACK
RAck:1 1 INVITE
Max-Forwards :70
Call Flow MSS
• SIP/2.0 200 OK
Via:SIP/2 . 0/UDP public.apollon.tas .com:5060;branch=z9hG4bKhCbaVe46UBc385aZ From: <sip:User.
0@apollon.tas.com>;tag=3Va08dZg15fd1e7U
To: <sip:User. 1@apollon.tas .com>;tag=14383101f9
Call-ID: 681EE514642E6F6729E00549
CSeq:2 PRACK
Content-Length: 0

• UPDATE sip :10.211.12. 96:5072 SIP/2 .0 Content-Length :257


Via:SIP/2.0/UDP public.apollon.tas.com:5060;branch=z9hG4bK2hUUhBUUiUUd3fD1
From:<sip:User.0@apollon.tas.com>;tag=3Va08dZg15fd1e7U To:<sip:User.1@apollon.tas.com>;tag=14383101f9
Call-ID: 681EE514642E6F6729E00549
CSeq:3 UPDATE
Contact:<sip:10.211.7. 112 :5060>
Allow:ACK,BYE, CANCEL, INVITE,MESSAGE,OPTIONS,PRACK,REGISTER,UPDATE Max-Forwards :70
Record-Route:<sip:AAZUB8gBCqUIAH+ArAGNzjAAG@10.211.7.112:5060;lr> Reason: X.int ;cause=0x000007FF
Content-Type: application/sdp
v=0
o=- 0 2 IN IP4 10.211.7.158
s=MSS call
c=IN IP4 17.10.9.10
t=0 0
m=audio 2500 RTP/AVP 8
b=AS:64
a=rtpmap:8 PCMA/8000
a=curr:qos local sendrecv
a=curr:qos remote sendrecv
a=des:qos mandatory local sendrecv a=des:qos mandatory remote sendrecv
Call Flow MSS
• SIP/2.0 200 OK
Via:SIP/2.0/UDP public.apollon.tas.com:5060;branch=z9hG4bK2hUUhBUUiUUd3fD1 From: <sip:User. 0@apollon.tas
.com>;tag=3Va08dZg15fd1e7U
To: <sip:User. 1@apollon.tas .com>;tag=14383101f9
Call-ID: 681EE514642E6F6729E00549
CSeq:3 UPDATE
Content-Type: application/sdp
Content-Length: 256
v=0
o=- 222222 112224 IN IP4 172.24.175.10
s=
c=IN IP4 172.24.175.10 t=0 0
m=audio 3456 RTP/AVP 8 a=rtpmap: 8 PCMA/8000 a=curr:qos local sendrecv a=curr:qos remote sendrecv
a=des:qos mandatory local sendrecv
a=des:qos mandatory remote sendrecv

• SIP/2.0 180 Ringing


Via: SIP/2.0/UDP public.apollon.tas.com:5060;branch=z9hG4bK13Cg4CBA.eVZ3Xhb From: <sip:User. 0@apollon.tas
.com>;tag=3Va08dZg15fd1e7U
To: <sip:User. 1@apollon.tas .com>;tag=14383101f9 Record-Route:<sip:AAZUB8gBCqUIAH+ArAGNzjAAG@10.211.7.112:5060;lr> Call-ID:
681EE514642E6F6729E00549
CSeq: 1 INVITE
Contact: <sip:10.211.12 .96:5072> Require: 100rel, precondition RSeq: 2
Content-Length: 0

• PRACK sip:10.211.12 .96:5072 SIP/2.0


Content-Length:0
Via:SIP/2.0/UDP public.apollon.tas.com:5060;branch=z9hG4bKdWdecbgYh19.cCc.
From:<sip:User.0@apollon.tas.com>;tag=3Va08dZg15fd1e7U To:<sip:User.1@apollon.tas.com>;tag=14383101f9
Call-ID: 681EE514642E6F6729E00549
CSeq:4 PRACK
RAck:2 1 INVITE
Max-Forwards :70
Call Flow MSS
• SIP/2.0 200 OK
Via:SIP/2 . 0/UDP public.apollon.tas .com:5060;branch=z9hG4bKhCbaVe46UBc385aZ From: <sip:User.
0@apollon.tas.com>;tag=3Va08dZg15fd1e7U
To: <sip:User. 1@apollon.tas .com>;tag=14383101f9
Call-ID: 681EE514642E6F6729E00549
CSeq:2 PRACK
Content-Length: 0

F6
UPDATE sip :10.211.12. 96:5072 SIP/2 .0 Content-Length :257
Via:SIP/2.0/UDP public.apollon.tas.com:5060;branch=z9hG4bK2hUUhBUUiUUd3fD1
From:<sip:User.0@apollon.tas.com>;tag=3Va08dZg15fd1e7U To:<sip:User.1@apollon.tas.com>;tag=14383101f9
Call-ID: 681EE514642E6F6729E00549
CSeq:3 UPDATE
Contact:<sip:10.211.7. 112 :5060>
Allow:ACK,BYE, CANCEL, INVITE,MESSAGE,OPTIONS,PRACK,REGISTER,UPDATE Max-Forwards :70
Record-Route:<sip:AAZUB8gBCqUIAH+ArAGNzjAAG@10.211.7.112:5060;lr> Reason: X.int ;cause=0x000007FF
Content-Type: application/sdp
v=0
o=- 0 2 IN IP4 10.211.7.158
s=MSS call
c=IN IP4 17.10.9.10
t=0 0
m=audio 2500 RTP/AVP 8
b=AS:64
a=rtpmap:8 PCMA/8000
a=curr:qos local sendrecv
a=curr:qos remote sendrecv
a=des:qos mandatory local sendrecv a=des:qos mandatory remote sendrecv
Call Flow MSS
• SIP/2.0 200 OK
Via:SIP/2.0/UDP public.apollon.tas.com:5060;branch=z9hG4bK2hUUhBUUiUUd3fD1 From: <sip:User. 0@apollon.tas
.com>;tag=3Va08dZg15fd1e7U
To: <sip:User. 1@apollon.tas .com>;tag=14383101f9
Call-ID: 681EE514642E6F6729E00549
CSeq:3 UPDATE
Content-Type: application/sdp
Content-Length: 256
v=0
o=- 222222 112224 IN IP4 172.24.175.10
s=
c=IN IP4 172.24.175.10 t=0 0
m=audio 3456 RTP/AVP 8 a=rtpmap: 8 PCMA/8000 a=curr:qos local sendrecv a=curr:qos remote sendrecv
a=des:qos mandatory local sendrecv
a=des:qos mandatory remote sendrecv

• SIP/2.0 180 Ringing


Via: SIP/2.0/UDP public.apollon.tas.com:5060;branch=z9hG4bK13Cg4CBA.eVZ3Xhb From: <sip:User. 0@apollon.tas
.com>;tag=3Va08dZg15fd1e7U
To: <sip:User. 1@apollon.tas .com>;tag=14383101f9 Record-Route:<sip:AAZUB8gBCqUIAH+ArAGNzjAAG@10.211.7.112:5060;lr>
Call-ID: 681EE514642E6F6729E00549
CSeq: 1 INVITE
Contact: <sip:10.211.12 .96:5072> Require: 100rel, precondition RSeq: 2
Content-L

• PRACK sip:10.211.12 .96:5072 SIP/2.0


Content-Length:0
Via:SIP/2.0/UDP public.apollon.tas.com:5060;branch=z9hG4bKdWdecbgYh19.cCc.
From:<sip:User.0@apollon.tas.com>;tag=3Va08dZg15fd1e7U To:<sip:User.1@apollon.tas.com>;tag=14383101f9
Call-ID: 681EE514642E6F6729E00549
CSeq:4 PRACK
RAck:2 1 INVITE
Max-Forwards :70 ength: 0
Call Flow MSS
• SIP/2.0 200 OK
Via:SIP/2.0/UDP public.apollon.tas.com:5060;branch=z9hG4bKdWdecbgYh19.cCc. From: <sip:User.
0@apollon.tas.com>;tag=3Va08dZg15fd1e7U
To: <sip:User. 1@apollon.tas .com>;tag=14383101f9
Call-ID: 681EE514642E6F6729E00549
CSeq:4 PRACK
Content-Length: 0

• SIP/2.0 200 OK
Via: SIP/2.0/UDP public.apollon.tas.com:5060;branch=z9hG4bK13Cg4CBA.eVZ3Xhb
From: <sip:User. 0@apollon.tas.com>;tag=3Va08dZg15fd1e7U
To: <sip:User. 1@apollon.tas .com>;tag=14383101f9
Call-ID: 681EE514642E6F6729E00549 CSeq: 1 INVITE
Contact: <sip:10.211.12 .96:5072>
Record-Route:< sip:AAZUB8gBCqUIAH+ArAGNzjAAG@10.211.7.112:5060;lr>
Content-Length: 0

• ACK sip:10.211.12.96:5072 SIP/2.0


Content-Length:0
Via:SIP/2 . 0/UDP public.apollon.tas .com:5060;branch=z9hG4bKfB0Z27dZ9a1CVWUj
From:<sip:User.0@apollon.tas.com>;tag=3Va08dZg15fd1e7U To:<sip:User.1@apollon.tas.com>;tag=14383101f9
Call-ID: 681EE514642E6F6729E00549
CSeq:1 ACK
Max-Forwards :70
Ejemplo de un mensaje SIP-I
Ejemplo de un mensaje SIP-I
Ejemplo de un mensaje SIP-I

You might also like