Difference Between SIP REFER and (RE) INVITE
Difference Between SIP REFER and (RE) INVITE
What is this and when it is used? When I started working in SIP environment, it was
confusing to me, as well.
But after reading RFC3261, it became clear to me. Simply said, REFER method is used for
transferring a call and INVITE is used to change session media information.
REFER – Example
Suppose Alice and Bob are on call and Alice wants to transfer call to Carol, Alice will send
REFER to Bob with Carol information.
REFER sips:bob@client.biloxi.example.com SIP/2.0
Via: SIP/2.0/TLS client.biloxi.example.com:506;branch=z9hG4bKnashds8
Max-Forwards: 70
From: Alice <sips:alice@atlanta.example.com>;tag=1234567
To: Bob <sips:bob@biloxi.example.com>;tag=314159
Call-ID: 12345601@atlanta.example.com
CSeq: 101 REFER
Refer-To: <sips:carol@chicago.example.com>
Referred-By: <alice@atlanta.example.com>
Contact: <sips:alice@client.atlanta.example.com>
Content-Length: 0
(RE)INVITE – Example
If Bob wants to session media information, then INVITE is sent again with updated
information. Consider, call on hold as an example for this.
In this scenario, Alice calls Bob, then Bob places the call on hold.Bob then takes the call off
hold, then Alice hangs up the call.
F1 INVITE Alice -> Proxy 1
v=0
o=bob 2890844527 2890844528 IN IP4 client.biloxi.example.com
s=
c=IN IP4 client.biloxi.example.com
t=0 0
m=audio 3456 RTP/AVP 0
a=rtpmap:0 PCMU/8000
a=sendonly
Here, you can see Bob changed SDP session attribute as ‘sendonly’ to place the call on hold
and to retrieve the call, this will be changed to ‘sendrecv’.