Hi ,
according to sip ,some fields of sip message can be
modified by proxies ,redirect servers and registrar
for ex. via,max-forward ,route etc but some fields are never modified in sip message for ex. call
id,content-length,content-type etc.
we can classify sip message into following
categories
1. read/write fields(these can be modified by
proxy,redirect servers)
2. read only (these can never be modified by intermediate
entities ,only UAS,UAC can modify these)
3. Message body
READ/WRITE fileds SHOULD always be at starting of SIP
message .
SIP should discourage use of intermingled read/write &
read only fields .
call-id field SHOULD act as separation between read/write
and read only fields.
Advantages:
if read/write fields are in starting of sip message then
proxy dont have to search for particular field till
end of message.
It saves processing time at proxies and improves call
setup time as well.
It also reduces risk of message curruption .
for ex:
following sip message
INVITE sip:[EMAIL PROTECTED] SIP/2.0
Via: SIP/2.0/UDP home.domain.com:5060;branch=fffcdr45.1
(read/write)
Via: SIP/2.0/UDP lab.domain.com:5060;branch=ghf456.1
(read/write)
From: USERB<[EMAIL PROTECTED]>;tag=89349
To: USERA<[EMAIL PROTECTED]>
contact: <[EMAIL PROTECTED]>
(read/write)
Max-forward: 70 (read/write)
Call-id: [EMAIL PROTECTED]
Content-type: application/sdp
content-length: 150
(sdp not shown here )
CAN BE WRITTEN AS
INVITE sip:[EMAIL PROTECTED] SIP/2.0
Via: SIP/2.0/UDP home.domain.com:5060;branch=fffcdr45.1
(read/write)
Via: SIP/2.0/UDP lab.domain.com:5060;branch=ghf456.1
(read/write)
contact: <[EMAIL PROTECTED]>
(read/write)
Max-forward: 70 (read/write)
Call-id: [EMAIL PROTECTED] (read only)
From: USERB<[EMAIL PROTECTED]>;tag=89349 (read only
)
To: USERA<[EMAIL PROTECTED]> (read only, can be
modified by UAS)
Content-type: application/sdp (read only )
content-length: 150 (read only )
(sdp not shown here )
any comments are welcome ,
regards, vishal