I have a trivial doubt with respect to SIP. I tried googling and referring many books, but still I am not able to find a solid reason for adding from-tag in SIP request.
Example SIP request (Snapshot from rfc-3261)
INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds
Max-Forwards: 70
To: Bob <sip:[email protected]>
From: Alice <sip:[email protected]>;tag=1928301774
Call-ID: [email protected]
CSeq: 314159 INVITE
Contact: <sip:[email protected]>
Content-Type: application//sdp
Content-Length: 142
As per rfc-3261:
Dialog can be identified using from-tag, to-tag and call-id.
I know the precise reason for adding to-tag and call-id. What I don't know is,
[EDIT] About the meaning of the attribute "tag" inside the header field From, here is your answer : http://andrewjprokop.wordpress.com/2013/09/23/lets-play-sip-tag/
Removing the tag would simply invite servers to consider messages as duplicated.
To resume what Andrew Prokop wrote :
The most obvious problem with using Call-ID to uniquely identify a message arises with call forking. In call forking, a single SIP Invite message is turned into multiple Invite messages to different destinations. For example, you might call me, Andrew Prokop, but call forking might cause Invite messages to be sent to all my registered endpoints — my smart phone, my desk phone, and my PC phone. That single Call-ID was fine when it was one Invite, but it’s not so fine when it becomes three. This is where tags come in.
Tags are really quite simple, but require a bit of explanation. The goal of a tag is to work with the Call-ID to make an entire dialog unique no matter how many times a session might be forked. Actually, I should have said tags since there are two. There is the local tag (From tag) which is assigned by the sender of a message or the UAC. There is also the remote tag (To tag) which is assigned by the final recipient of the message or the UAS (User Agent Server). The UAC puts its tag in the From header and the UAS puts its tag in the To header. So, when a message leaves a UAC it has one tag in the From header and there is no tag in the To header. When a UAS receives that message and responds back with a SIP response (e.g. 180 Ringing), it then adds a tag to the To header. If multiple clients received the original message then they would all add their own specific tag values. In other words, all those SIP messages will have the same From tag, but depending on who is responding, there will be different To tags.