(Logo Tech-invite)  

a Portal devoted to SIP and Security technologies

  (World Map)    
    Search Home Site Map Contact
 SIP/IMS Standardization
> IETF Standardization Process
> RFCs related to SIP (4 p.) o
> SIP-SIPPING-SIMPLE... I-Ds (22 p.) o
> Audio-Video Transport RFCs (2 p.)
> 3GPP Specifications (12 p.)
> OMA Specifications related to SIP
> TISPAN NGN Specifications (3 p.) o
> SIP Topics
> IMS Topics
 SIP/IMS Call Flows
> RFC3261's Example
> Basic -- RFC3665
> SIP PSTN -- RFC3666 (3 p.)
> SIP Service Examples (19 p.)
> IMS Signaling Flows (35 p.)
 SIP/IMS Architecture
> SIP Protocol Structure
> Dialogs & Routing
> UMTS Network Evolution
 Security
> PKIX-TLS-SMIME... Standards (20 p.) o
> Cryptography Basics
> ASN.1 for PKI Certificate & CRL Profile
> ASN.1 for CMS
> RFC3280's Certificate Examples (4)
> RFC4134's CMS-S/MIME Examples (14)
> RFC4474's SIP Authentication Service
> SSL/TLS Time-Diagrams
> IPSec Guides
 ABNF Grammars
> ABNF Notation & Rules
> URI Generic Syntax
> ABNF for SIP
> SIP Messages & URIs
> SIP Header Fields
> MIME Media Types
> ABNF for SDP
> ABNF for MSRP
> ABNF for MRCPv2
> ABNF for RTSP 2.0
> Internet Message Format
 DiffServ CoS Simulation
> IPVCoSS Simulator
> IP-VPN Case Study
  o (daily updated)

Augmented BNF (ABNF) for SIP
-- RFC 3261 and subsequent SIP RFCs

This page documents the ABNF (Augmented Backus-Naur Form) definitions for SIP text messages, defined in RFC 3261 - chapter 25, and subsequent RFCs.

Top SIP Messages SIP URIs Response Codes Basic Rules SIP Header Fields

SIP Messages

SIP-messageRequest-LineStatus-LineMethodRequest-URISIP-Versionmessage-headermessage-body #
SIP-message   Up
SIP-message= Request   /   Response
 
Request= Request-Line
*(  message-header )
CRLF
[ message-body ]
 
Response= Status-Line
*(  message-header )
CRLF
[ message-body ]
 

(SIP message examples)

Request-Line   Up
Request-Line= Method   SP   Request-URI   SP   SIP-Version   CRLF
 
Status-Line   Up
Status-Line= SIP-Version   SP   Status-Code   SP   Reason-Phrase   CRLF
 
Method   Up
Method=   INVITEm / ACKm / OPTIONSm
/ BYEm / CANCELm / REGISTERm
/ INFOm / PRACKm / SUBSCRIBEm / NOTIFYm
/ UPDATEm / MESSAGEm / REFERm / PUBLISHm
/ extension-method
 
INVITEm = %x49.4E.56.49.54.45 ; INVITE in caps  
ACKm = %x41.43.4B ; ACK in caps
OPTIONSm = %x4F.50.54.49.4F.4E.53 ; OPTIONS in caps
BYEm = %x42.59.45 ; BYE in caps
CANCELm = %x43.41.4E.43.45.4C ; CANCEL in caps
REGISTERm = %x52.45.47.49.53.54.45.52 ; REGISTER in caps
INFOm = %x49.4E.46.4F ; INFO in caps [RFC2976]
PRACKm = %x50.52.41.43.4B ; PRACK in caps [RFC3262]
SUBSCRIBEm = %x53.55.42.53.43.52.49.42.45 ; SUBSCRIBE in caps [RFC3265]
NOTIFYm = %x4E.4F.54.49.46.59 ; NOTIFY in caps [RFC3265]
UPDATEm = %x55.50.44.41.54.45 ; UPDATE in caps [RFC3311]
MESSAGEm = %x4D.45.53.53.41.47.45 ; MESSAGE in caps [RFC3428]
REFERm = %x52.45.46.45.52 ; REFER in caps [RFC3515]
PUBLISHm = %x50.55.42.4C.49.53.48 ; PUBLISH in caps [RFC3903]
 
extension-method = token

 
Request-URI   Up
Request-URI= SIP-URI   /   SIPS-URI   /   absoluteURI
 
SIP-Version   Up
SIP-Version= "SIP"   "/"   1*DIGIT   "."   1*DIGIT
 
message-header   Up
message-header= ( Accept / Accept-Contact / Accept-Encoding / Accept-Language
/ Accept-Resource-Priority / Alert-Info / Allow / Allow-Events / Authentication-Info
/ Authorization / Call-ID / Call-Info / Contact / Content-Disposition / Content-Encoding
/ Content-Language / Content-Length / Content-Type / CSeq / Date / Error-Info / Event
/ Expires / From / History-Info / Identity / Identity-Info / In-Reply-To / Join
/ Max-Forwards / MIME-Version / Min-Expires / Min-SE / Organization / Path / Priority
/ Privacy / Proxy-Authenticate / Proxy-Authorization / Proxy-Require / RAck / Reason
/ Record-Route / Refer-Sub / Refer-To / Referred-By / Reject-Contact / Replaces
/ Reply-To / Request-Disposition / Require / Resource-Priority / Retry-After / Route
/ RSeq / Security-Client / Security-Server / Security-Verify / Server / Service-Route
/ Session-Expires / SIP-ETag / SIP-If-Match / Subject / Subscription-State / Supported
/ Target-Dialog / Timestamp / To / Unsupported / User-Agent / Via / Warning
/ WWW-Authenticate
/ P-Access-Network-Info / P-Answer-State / P-Asserted-Identity / P-Associated-URI
/ P-Called-Party-ID / P-Charging-Function-Addresses / P-Charging-Vector
/ P-DCS-Billing-Info / P-DCS-LAES / P-DCS-OSPS / P-DCS-Redirect
/ P-DCS-Trace-Party-ID / P-Early-Media / P-Media-Authorization / P-Preferred-Identity
/ P-Profile-Key / P-User-Database / P-Visited-Network-ID
/ extension-header ) CRLF
 
extension-header= header-name   HCOLON   header-value
header-name= token
header-value= *( TEXT-UTF8char   /   UTF8-CONT   /   LWS )
 
message-body   Up
message-body= *OCTET
 
Top SIP Messages SIP URIs Response Codes Basic Rules SIP Header Fields

URIs

## SIP-URI / SIPS-URI ## userinfo ## hostport ## uri-parameters ## headers ## absoluteURI ## "tel" URI ##
SIP-URI / SIPS-URI   Up
SIP-URI= "sip:"
[ userinfo ]   hostport   uri-parameters   [ headers ]
SIPS-URI= "sips:"
[ userinfo ]   hostport   uri-parameters   [ headers ]
 
URI -- userinfo   Up
userinfo= ( user   /   telephone-subscriber )   [ ":" password ]   "@"
; examples:
;    sip:alice@atlanta.com
;    sip:alice:secretword@atlanta.com;transport=tcp
;    sip:+1-212-555-1212:1234@gateway.com;user=phone

 
user= 1*( unreserved   /   escaped   /   user-unreserved )
user-unreserved= "&"   /   "="   /   "+"   /   "$"   /   ","   /   ";"   /   "?"   /   "/"
 
password= *( unreserved   /   escaped   /   "&"   /   "="   /   "+"   /   "$"   /   "," )
 
URI -- hostport   Up
hostport= host [ ":" port ]
; examples:
;    sip:alice@atlanta.com
;    sip:alice:secretword@atlanta.com;transport=tcp
;    sip:+1-212-555-1212:1234@gateway.com;user=phone
;    sip:alice@192.0.2.4

 
host= hostname   /   IPv4address   /   IPv6reference
hostname= *( domainlabel   "." )   toplabel   [ "." ]
domainlabel= alphanum   /   alphanum   *( alphanum   /   "-" )   alphanum
toplabel= ALPHA   /   ALPHA   *( alphanum   /   "-" )   alphanum
IPv4address= 1*3DIGIT   "."   1*3DIGIT   "."   1*3DIGIT   "."   1*3DIGIT
IPv6reference= "["   IPv6address   "]"
IPv6address= hexpart   [ ":"   IPv4address ]
hexpart= hexseq   /   hexseq   "::"   [ hexseq ]   /   "::"   [ hexseq ]
hexseq= hex4   *( ":"   hex4 )
hex4= 1*4HEXDIG
 
port= 1*DIGIT
 
URI -- uri-parameters   Up
transport-paramuser-parammethod-paramttl-parammaddr-paramlr-paramcompression-paramtarget-param
cause-paramother-param #
uri-parameters= *( ";"   uri-parameter )
; examples:
;    sip:alice:secretword@atlanta.com;transport=tcp
;    sip:+1-212-555-1212:1234@gateway.com;user=phone
;    sip:atlanta.com;method=REGISTER?to=alice%40atlanta.com
;    sip:alice@atlanta.com;maddr=239.255.255.1;ttl=15
;    Route: <sip:ss2.biloxi.example.com;lr>
;    sip:alice@atlanta.com;comp=sigcomp

 
uri-parameter=     transport-param   /   user-param   /   method-param
/   ttl-param   /   maddr-param   /   lr-param
/   compression-param   /   target-param   /   cause-param
/   other-param
 
transport-param   Up
transport-param= "transport="
( "udp"   /   "tcp"   /   "sctp"   /   "tls"   /   "tls-sctp"   /   other-transport )
; tls-sctp is defined in [RFC4168]
other-transport= token
 
user-param   Up
user-param= "user="
( "phone"   /   "ip"   /   "dialstring"   /   other-user )
; dialstring is defined in [RFC4967]
other-user= token
 
dialstring= dialstring-digits   context
dialstring-digits= *dialstring-element   dialstring-digit   *dialstring-element
dialstring-digit= HEXDIG / "*" / "#"
dialstring-element= dialstring-digit   /   "P"   /   "X"   /   visual-separator
 
method-param   Up
method-param= "method="   Method
 
ttl-param   Up
ttl-param= "ttl="   ttl
; The ttl parameter determines the time-to-live value of the UDP
; multicast packet and MUST only be used if maddr is a multicast
; address and the transport protocol is UDP.

 
maddr-param   Up
maddr-param= "maddr="   host
; multicast address
 
lr-param   Up
lr-param= "lr"
; loose routing
 
compression-param   Up
compression-param= "comp="   ( "sigcomp"   /   other-compression )
; compression-param is defined in [RFC3486]
other-compression= token
 
target-param   Up
target-param= "target"   EQUAL   pvalue
; target-param is defined in [RFC4458]

 
cause-param   Up
cause-param= "cause"   EQUAL   Status-Code
; cause-param is defined in [RFC4458]

 
other-param   Up
other-param= pname   [ "="   pvalue ]
 
pname= 1*paramchar
pvalue= 1*paramchar
paramchar= param-unreserved / unreserved / escaped
param-unreserved= "["   /   "]"   /   "/"   /   ":"   /   "&"   /   "+"   /   "$"
 
URI -- headers   Up
headers= "?"   header   *( "&"   header )
; examples:
;    sip:atlanta.com;method=REGISTER?to=alice%40atlanta.com
;    sips:alice@atlanta.com?subject=project%20x&priority=urgent

 
header= hname   [ "="   hvalue ]
hname= 1*( hnv-unreserved   /   unreserved   /   escaped )
hvalue= *( hnv-unreserved   /   unreserved   /   escaped )
hnv-unreserved= "["   /   "]"   /   "/"   /   "?"   /   ":"   /   "+"   /   "$"
 
absoluteURI   Up
absoluteURI= scheme   ":"   ( hier-part   /   opaque-part )
 
hier-part= ( net-path   /   abs-path )   [ "?"   query ]
net-path= "//"   authority   [ abs-path ]
abs-path= "/"   path-segments
query= *uric
 
opaque-part= uric-no-slash   *uric
 
uric= reserved   /   unreserved   /   escaped
uric-no-slash= unreserved   /   escaped
/  ";"   /   "?"   /   ":"   /   "@"   /   "&"   /   "="   /   "+"   /   "$"   /   ","
 
path-segments= segment   *( "/"   segment )
segment= *pchar   *( ";"   param )
param= *pchar
pchar= unreserved   /   escaped   /   ":"   /   "@"   /   "&"   /   "="   /   "+"   /   "$"   /   ","
 
scheme= ALPHA   *( ALPHA   /   DIGIT   /   "+"   /   "-"   /   "." )
authority= srvr   /   reg-name
 
srvr= [   [ userinfo   "@" ]   hostport ]
reg-name= 1*( unreserved   /   escaped
/   "$"   /   ","   /   ";"   /   ":"   /   "@"   /   "&"   /   "="   /   "+" )
 
telephone-URI   RFC 3966 Up
parcontextparameterextensionisdn-subaddressisub-encodingNumber Portability Parameters
enum-dip-indicatortrunk-groupdescriptorxnumber-digitsxxdomainname #
telephone-uri= "tel:"   telephone-subscriber
; examples:
;    tel:+1-201-555-0123
;    tel:7042;phone-context=example.com
;    tel:863-1234;phone-context=+1-914-555

 
telephone-subscriber= global-number   /   local-number
 
global-number= global-number-digits   *par
local-number= local-number-digits   *par   context   *par
 
par   Up
par=     parameter   /   extension   /   isdn-subaddress ;   [RFC3966]
/   rn   /   cic   /   npdi ;   [RFC4694]
/   enum-dip-indicator ;   [RFC4759]
/   trunk-group   /   trunk-context ;   [RFC4904]
 
context   Up
context= ";phone-context="   descriptor
 
parameter   Up
parameter= ";"   pname   [ "="   pvalue ]
pname= 1*( alphanum   /   "-" )
pvalue= 1*paramchar
paramchar= param-unreserved   /   unreserved   /   pct-encoded
pct-encoded= "%"   HEXDIG   HEXDIG
param-unreserved= "["   /   "]"   /   "/"   /   ":"   /   "&"   /   "+"   /   "$"
 
extension   Up
extension= ";ext="   1*phonedigit
 
isdn-subaddress   Up
isdn-subaddress= ";isub="   1*uric
 
isub-encoding   RFC 4715 Up
isub-encoding= isub-encoding-tag   "="   isub-encoding-value
isub-encoding-tag= "isub-encoding"
isub-encoding-value= "nsap-ia5"   /   "nsap-bcd"   /   "nsap"   /   token
 
Number Portability Parameters: rn, npdi, cic   RFC 4694 Up
rn= ";rn="   ( global-rn   /   local-rn )
cic= ";cic="   ( global-cic   /   local-cic )
npdi= ";npdi"
 
global-rn= global-hex-digits
local-rn= 1*hex-phonedigit   rn-context
rn-context= ";rn-context="   rn-descriptor
rn-descriptor= domainname   /   global-hex-digits
global-hex-digits= "+"   1*3(DIGIT)   *hex-phonedigit
hex-phonedigit= HEXDIG   /   visual-separator
 
global-cic= global-hex-digits
local-cic= 1*hex-phonedigit   cic-context
cic-context= ";cic-context="   rn-descriptor
 
enum-dip-indicator   RFC 4759 Up
enum-dip-indicator= ";enumdi"
 
trunk-group   RFC 4904 Up
trunk-group= ";tgrp="   trunk-group-label
trunk-context= ";trunk-context="   descriptor
trunk-group-label= 1*( unreserved   /   escaped /   trunk-group-unreserved )
trunk-group-unreserved= "/"   /   "&"   /   "+"   /   "$"
 
descriptor   Up
descriptor= domainname   /   global-number-digits
 
global- & local-number-digits   Up
global-number-digits= "+"   *phonedigit   DIGIT   *phonedigit
local-number-digits= *phonedigit-hex   ( HEXDIG   /   "*"   /   "#" )   *phonedigit-hex
 
phonedigit= DIGIT   /   [ visual-separator ]
phonedigit-hex= HEXDIG   /   "*"   /   "#"   /   [ visual-separator ]
 
visual-separator= "-"   /   "."   /   "("   /   ")"
 
domainname   Up
domainname= *( domainlabel   "." )   toplabel   [ "." ]
domainlabel= alphanum   /   alphanum   *( alphanum   /   "-" )   alphanum
toplabel= ALPHA   /   ALPHA   *( alphanum   /   "-" )   alphanum
 
Top SIP Messages SIP URIs Response Codes Basic Rules SIP Header Fields

Response Codes

Informational (1xx)Success (2xx)Redirection (3xx)Client-Error (4xx)Server-Error (5xx)Global-Failure (6xx) #

Note: All response codes below are defined by [RFC3261] unless otherwise noted.

Status-Code=   Informational
/ Success
/ Redirection
/ Client-Error
/ Server-Error
/ Global-Failure
/ extension-code
 
extension-code= 3DIGIT
 
Reason-Phrase= *( reserved / unreserved / escaped / UTF8-NONASCII / UTF8-CONT / SP / HTAB )

 
1xx   Up
Informational=   "100" ; Trying
/ "180" ; Ringing
/ "181" ; Call Is Being Forwarded
/ "182" ; Queued
/ "183"
 
; Session Progress
2xx   Up
Success=   "200" ; OK  
/ "202"
 
; Accepted [RFC3265]
3xx   Up
Redirection=   "300" ; Multiple Choices
/ "301" ; Moved Permanently
/ "302" ; Moved Temporarily
/ "305" ; Use Proxy
/ "380"
 
; Alternative Service
4xx   Up
Client-Error=   "400" ; Bad Request  
/ "401" ; Unauthorized
/ "402" ; Payment Required
/ "403" ; Forbidden
/ "404" ; Not Found
/ "405" ; Method Not Allowed
/ "406" ; Not Acceptable
/ "407" ; Proxy Authentication Required
/ "408" ; Request Timeout
/ "410" ; Gone
/ "412" ; Conditional Request Failed [RFC3903]
/ "413" ; Request Entity Too Large
/ "414" ; Request-URI Too Long
/ "415" ; Unsupported Media Type
/ "416" ; Unsupported URI Scheme
/ "417" ; Unknown Resource-Priority [RFC4412]
/ "420" ; Bad Extension
/ "421" ; Extension Required
/ "422" ; Session Interval Too Small [RFC4028]
/ "423" ; Interval Too Brief
/ "428" ; Use Identity Header [RFC4474]
/ "429" ; Provide Referrer Identity [RFC3892]
/ "433" ; Anonymity Disallowed [RFC5079]
/ "436" ; Bad Identity-Info [RFC4474]
/ "437" ; Unsupported Certificate [RFC4474]
/ "438" ; Invalid Identity Header [RFC4474]
/ "480" ; Temporarily Unavailable
/ "481" ; Call/Transaction Does Not Exist
/ "482" ; Loop Detected
/ "483" ; Too Many Hops
/ "484" ; Address Incomplete
/ "485" ; Ambiguous
/ "486" ; Busy Here
/ "487" ; Request Terminated
/ "488" ; Not Acceptable Here
/ "489" ; Bad Event [RFC3265]
/ "491" ; Request Pending
/ "493" ; Undecipherable
/ "494"
 
; Security Agreement Required [RFC3329]
5xx   Up
Server-Error=   "500" ; Server Internal Error  
/ "501" ; Not Implemented
/ "502" ; Bad Gateway
/ "503" ; Service Unavailable
/ "504" ; Server Time-out
/ "505" ; Version Not Supported
/ "513" ; Message Too Large
/ "580"
 
; Precondition Failure [RFC3312]
6xx   Up
Global-Failure=   "600" ; Busy Everywhere
/ "603" ; Decline
/ "604" ; Does Not Exist Anywhere
/ "606"
 
; Not Acceptable
Top SIP Messages SIP URIs Response Codes Basic Rules SIP Header Fields

SIP Basic Rules

alphanumLHEXWSHCOLONseparatorsdelimiterstokenquoted-stringcommentswordtextescaped
mark(un)reserved #
US ASCII, ANSI X3.4-1986 (ISO 646 International Reference Version)
000NUL
101SOH
202STX
303ETX
404EOT
505ENQ
606ACQ
707BEL
808BS
909HT
100ALF
110BVT
120CFF
130DCR
140ESO
150FSI
 
1610DLE
1711DC1
1812DC2
1913DC3
2014DC4
2115NAK
2216SYN
2317ETB
2418CAN
2519EM
261ASUB
271BESC
281CFS
291DGS
301ERS
311FUS
 
3220 
3321!
3422"
3523#
3624$
3725%
3826&
3927'
4028(
4129)
422A*
432B+
442C,
452D-
462E.
472F/
 
48300
49311
50322
51333
52344
53355
54366
55377
56388
57399
583A:
593B;
603C<
613D=
623E>
633F?
 
6440@
6541A
6642B
6743C
6844D
6945E
7046F
7147G
7248H
7349I
744AJ
754BK
764CL
774DM
784EN
794FO
 
8050P
8151Q
8252R
8353S
8454T
8555U
8656V
8757W
8858X
8959Y
905AZ
915B[
925C\
935D]
945E^
955F_
 
9660`
9761a
9862b
9963c
10064d
10165e
10266f
10367g
10468h
10569i
1066Aj
1076Bk
1086Cl
1096Dm
1106En
1116Fo
 
11270p
11371q
11472r
11573s
11674t
11775u
11876v
11977w
12078x
12179y
1227Az
1237B{
1247C|
1257D}
1267E~
1277FRUB
alphanum   Up
alphanum= ALPHA   /   DIGIT
 
LHEX   Up
LHEX= DIGIT   /   %x61-66
 
; lowercase a-f
 
WS   Up
LWS= [*WSP   CRLF]   1*WSP ; linear whitespace
SWS= [LWS] ; sep whitespace
 
HCOLON   Up
HCOLON