summaryrefslogtreecommitdiff
path: root/doc/rfc/rfc6141.txt
blob: f77c367c82d5f347902b6fbbe2dcc271d70ea063 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
Internet Engineering Task Force (IETF)                 G. Camarillo, Ed.
Request for Comments: 6141                                   C. Holmberg
Updates: 3261                                                   Ericsson
Category: Standards Track                                         Y. Gao
ISSN: 2070-1721                                                      ZTE
                                                              March 2011


             Re-INVITE and Target-Refresh Request Handling
                in the Session Initiation Protocol (SIP)

Abstract

   The procedures for handling SIP re-INVITEs are described in RFC 3261.
   Implementation and deployment experience has uncovered a number of
   issues with the original documentation, and this document provides
   additional procedures that update the original specification to
   address those issues.  In particular, this document defines in which
   situations a UAS (User Agent Server) should generate a success
   response and in which situations a UAS should generate an error
   response to a re-INVITE.  Additionally, this document defines further
   details of procedures related to target-refresh requests.

Status of This Memo

   This is an Internet Standards Track document.

   This document is a product of the Internet Engineering Task Force
   (IETF).  It represents the consensus of the IETF community.  It has
   received public review and has been approved for publication by the
   Internet Engineering Steering Group (IESG).  Further information on
   Internet Standards is available in Section 2 of RFC 5741.

   Information about the current status of this document, any errata,
   and how to provide feedback on it may be obtained at
   http://www.rfc-editor.org/info/rfc6141.















Camarillo, et al.            Standards Track                    [Page 1]
^L
RFC 6141                Re-INVITE Handling in SIP             March 2011


Copyright Notice

   Copyright (c) 2011 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (http://trustee.ietf.org/license-info) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.





































Camarillo, et al.            Standards Track                    [Page 2]
^L
RFC 6141                Re-INVITE Handling in SIP             March 2011


Table of Contents

   1. Introduction ....................................................3
   2. Terminology .....................................................4
   3. Changing the Session State during a Re-INVITE ...................5
      3.1. Background on Re-INVITE Handling by UASs ...................5
      3.2. Problems with Error Responses and Already Executed Changes .9
      3.3. UAS Behavior ..............................................10
      3.4. UAC Behavior ..............................................11
      3.5. Glare Situations ..........................................11
      3.6. Example of UAS Behavior ...................................12
      3.7. Example of UAC Behavior ...................................14
      3.8. Clarifications on Canceling Re-INVITEs ....................17
   4. Refreshing a Dialog's Targets ..................................17
      4.1. Background and Terminology on a Dialog's Targets ..........17
      4.2. Background on Target-Refresh Requests .....................17
      4.3. Clarification on the Atomicity of Target-Refresh Requests .18
      4.4. UA Updating the Dialog's Local Target in a Request ........19
      4.5. UA Updating the Dialog's Local Target in a Response .......19
      4.6. A Request Updating the Dialog's Remote Target .............19
      4.7. A Response Updating the Dialog's Remote Target ............20
      4.8. Race Conditions and Target Refreshes ......................20
      4.9. Early Dialogs .............................................21
   5. A UA Losing Its Contact ........................................21
      5.1. Background on Re-INVITE Transaction Routing ...............22
      5.2. Problems with UAs Losing Their Contact ....................22
      5.3. UAS Losing Its Contact: UAC Behavior ......................22
      5.4. UAC Losing Its Contact: UAS Behavior ......................23
      5.5. UAC Losing Its Contact: UAC Behavior ......................24
   6. Security Considerations ........................................24
   7. Acknowledgements ...............................................24
   8. References .....................................................25
      8.1. Normative References ......................................25
      8.2. Informative References ....................................25

1.  Introduction

   As discussed in Section 14 of RFC 3261 [RFC3261], an INVITE request
   sent within an existing dialog is known as a re-INVITE.  A re-INVITE
   is used to modify session parameters, dialog parameters, or both.
   That is, a single re-INVITE can change both the parameters of its
   associated session (e.g., changing the IP address where a media
   stream is received) and the parameters of its associated dialog
   (e.g., changing the remote target of the dialog).  A re-INVITE can
   change the remote target of a dialog because it is a target refresh
   request, as defined in Section 6 of RFC 3261 [RFC3261].





Camarillo, et al.            Standards Track                    [Page 3]
^L
RFC 6141                Re-INVITE Handling in SIP             March 2011


   A re-INVITE transaction has an offer/answer [RFC3264] exchange
   associated with it.  The UAC (User Agent Client) generating a given
   re-INVITE can act as the offerer or as the answerer.  A UAC willing
   to act as the offerer includes an offer in the re-INVITE.  The UAS
   (User Agent Server) then provides an answer in a response to the
   re-INVITE.  A UAC willing to act as answerer does not include an
   offer in the re-INVITE.  The UAS then provides an offer in a response
   to the re-INVITE becoming, thus, the offerer.

   Certain transactions within a re-INVITE (e.g., UPDATE [RFC3311]
   transactions) can also have offer/answer exchanges associated to
   them.  A UA (User Agent) can act as the offerer or the answerer in
   any of these transactions regardless of whether the UA was the
   offerer or the answerer in the umbrella re-INVITE transaction.

   There has been some confusion among implementors regarding how a UAS
   should handle re-INVITEs.  In particular, implementors requested
   clarification on which type of response a UAS should generate in
   different situations.  In this document, we clarify these issues.

   Additionally, there has also been some confusion among implementors
   regarding target refresh requests, which include but are not limited
   to re-INVITEs.  In this document, we also clarify the process by
   which remote targets are refreshed.

      Indented passages such as this one are used in this document to
      provide additional information and clarifying text.  They do not
      contain normative protocol behavior.

2.  Terminology

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
   document are to be interpreted as described in RFC 2119 [RFC2119].

   UA: User Agent.

   UAC: User Agent Client.

   UAS: User Agent Server.

      Note that the terms UAC and UAS are used with respect to an INVITE
      or re-INVITE transaction and do not necessarily reflect the role
      of the UA concerned with respect to any other transaction, such as
      an UPDATE transaction occurring within the INVITE transaction.






Camarillo, et al.            Standards Track                    [Page 4]
^L
RFC 6141                Re-INVITE Handling in SIP             March 2011


3.  Changing the Session State during a Re-INVITE

   The following sub-sections discuss how to change the state of the
   session during a re-INVITE transaction.

3.1.  Background on Re-INVITE Handling by UASs

   Eventually, a UAS receiving a re-INVITE will need to generate a
   response to it.  Some re-INVITEs can be responded to immediately
   because their handling does not require user interaction (e.g.,
   changing the IP address where a media stream is received).  The
   handling of other re-INVITEs requires user interaction (e.g., adding
   a video stream to an audio-only session).  Therefore, these
   re-INVITEs cannot be responded to immediately.

   An error response to a re-INVITE has the following semantics.  As
   specified in Section 12.2.2 of RFC 3261 [RFC3261], if a re-INVITE is
   rejected, no state changes are performed.  These state changes
   include state changes associated to the re-INVITE transaction and all
   other transactions within the re-INVITE (this section deals with
   changes to the session state; target refreshes are discussed in
   Section 4.2).  That is, the session state is the same as before the
   re-INVITE was received.  The example in Figure 1 illustrates this
   point.

                 UAC                                          UAS

                  |                                            |
                  |-------------(1) INVITE SDP1--------------->|
                  |                                            |
                  |<------------(2) 200 OK SDP2----------------|
                  |                                            |
                  |------------------(3) ACK------------------>|
                  |                                            |
                  |                                            |
                  |-------------(4) INVITE SDP3--------------->|
                  |                                            |
                  |<-----------------(5) 4xx-------------------|
                  |                                            |
                  |------------------(6) ACK------------------>|
                  |                                            |

                    Figure 1: Rejection of a re-INVITE








Camarillo, et al.            Standards Track                    [Page 5]
^L
RFC 6141                Re-INVITE Handling in SIP             March 2011


   The UAs perform an offer/answer exchange to establish an audio-only
   session:

         SDP1:
            m=audio 30000 RTP/AVP 0

         SDP2:
            m=audio 31000 RTP/AVP 0

   At a later point, the UAC sends a re-INVITE (4) in order to add a
   video stream to the session.

         SDP3:
            m=audio 30000 RTP/AVP 0
            m=video 30002 RTP/AVP 31

   The UAS is configured to automatically reject video streams.
   Consequently, the UAS returns an error response (5).  At that point,
   the session parameters in use are still those resulting from the
   initial offer/answer exchange, which are described by SDP1 and SDP2.
   That is, the session state is the same as before the re-INVITE was
   received.

   In the previous example, the UAS rejected all the changes requested
   in the re-INVITE by returning an error response.  However, there are
   situations where a UAS wants to accept some but not all the changes
   requested in a re-INVITE.  In these cases, the UAS generates a 200
   (OK) response with a Session Description Protocol (SDP) indicating
   which changes were accepted and which were not.  The example in
   Figure 2 illustrates this point.





















Camarillo, et al.            Standards Track                    [Page 6]
^L
RFC 6141                Re-INVITE Handling in SIP             March 2011


                 UAC                                          UAS

                  |                                            |
                  |-------------(1) INVITE SDP1--------------->|
                  |                                            |
                  |<------------(2) 200 OK SDP2----------------|
                  |                                            |
                  |------------------(3) ACK------------------>|
                  |                                            |
                  |                                            |
                  |-------------(4) INVITE SDP3--------------->|
                  |                                            |
                  |<------------(5) 200 OK SDP4----------------|
                  |                                            |
                  |------------------(6) ACK------------------>|
                  |                                            |

              Figure 2: Automatic rejection of a video stream

   The UAs perform an offer/answer exchange to establish an audio-only
   session:

         SDP1:
            m=audio 30000 RTP/AVP 0
            c=IN IP4 192.0.2.1

         SDP2:
            m=audio 31000 RTP/AVP 0
            c=IN IP4 192.0.2.5

   At a later point, the UAC moves to an access that provides a higher
   bandwidth.  Therefore, the UAC sends a re-INVITE (4) in order to
   change the IP address where it receives the audio stream to its new
   IP address and add a video stream to the session.

         SDP3:
            m=audio 30000 RTP/AVP 0
            c=IN IP4 192.0.2.2
            m=video 30002 RTP/AVP 31
            c=IN IP4 192.0.2.2

   The UAS is automatically configured to reject video streams.
   However, the UAS needs to accept the change of the audio stream's
   remote IP address.  Consequently, the UAS returns a 200 (OK) response
   and sets the port of the video stream to zero in its SDP.






Camarillo, et al.            Standards Track                    [Page 7]
^L
RFC 6141                Re-INVITE Handling in SIP             March 2011


         SDP4:
            m=audio 31000 RTP/AVP 0
            c=IN IP4 192.0.2.5
            m=video 0 RTP/AVP 31

   In the previous example, the UAS was configured to automatically
   reject the addition of video streams.  The example in Figure 3
   assumes that the UAS requires its user's input in order to accept or
   reject the addition of a video stream and uses reliable provisional
   responses [RFC3262] (PRACK transactions are not shown for clarity).

                 UAC                                          UAS

                  |                                            |
                  |-------------(1) INVITE SDP1--------------->|
                  |                                            |
                  |<------------(2) 200 OK SDP2----------------|
                  |                                            |
                  |------------------(3) ACK------------------>|
                  |                                            |
                  |                                            |
                  |-------------(4) INVITE SDP3--------------->|
                  |                                            |
                  |<----(5) 183 Session Progress SDP4----------|
                  |                                            |
                  |                                            |
                  |<------------(6) UPDATE SDP5----------------|
                  |                                            |
                  |-------------(7) 200 OK SDP6--------------->|
                  |                                            |
                  |<---------------(8) 200 OK------------------|
                  |                                            |
                  |------------------(9) ACK------------------>|
                  |                                            |

         Figure 3: Manual rejection of a video stream by the user

   Everything up to (4) is identical to the previous example.  In (5),
   the UAS accepts the change of the audio stream's remote IP address
   but does not accept the video stream yet (it provides a null IP
   address instead of setting the stream to 'inactive' because inactive
   streams still need to exchange RTP Control Protocol (RTCP) traffic).

         SDP4:
            m=audio 31000 RTP/AVP 0
            c=IN IP4 192.0.2.5
            m=video 31002 RTP/AVP 31
            c=IN IP4 0.0.0.0



Camarillo, et al.            Standards Track                    [Page 8]
^L
RFC 6141                Re-INVITE Handling in SIP             March 2011


   At a later point, the UAS's user rejects the addition of the video
   stream.  Consequently, the UAS sends an UPDATE request (6) setting
   the port of the video stream to zero in its offer.

         SDP5:
            m=audio 31000 RTP/AVP 0
            c=IN IP4 192.0.2.5
            m=video 0 RTP/AVP 31
            c=IN IP4 0.0.0.0

   The UAC returns a 200 (OK) response (7) to the UPDATE with the
   following answer:

         SDP6:
            m=audio 30000 RTP/AVP 0
            c=IN IP4 192.0.2.2
            m=video 0 RTP/AVP 31

   The UAS now returns a 200 (OK) response (8) to the re-INVITE.

   In all the previous examples, the UAC of the re-INVITE transaction
   was the offerer.  Examples with UACs acting as the answerers would be
   similar.

3.2.  Problems with Error Responses and Already Executed Changes

   Section 3.1 contains examples on how a UAS rejects all the changes
   requested in a re-INVITE without executing any of them by returning
   an error response (Figure 1), and how a UAS executes some of the
   changes requested in a re-INVITE and rejects some of them by
   returning a 2xx response (Figures 2 and 3).  A UAS can accept and
   reject different sets of changes simultaneously (Figure 2) or at
   different times (Figure 3).

   The scenario that created confusion among implementors consists of a
   UAS that receives a re-INVITE, executes some of the changes requested
   in it, and then wants to reject all those already executed changes
   and revert to the pre-re-INVITE state.  Such a UAS may consider
   returning an error response to the re-INVITE (the message flow would
   be similar to the one in Figure 1), or using an UPDATE request to
   revert to the pre-re-INVITE state and then returning a 2xx response
   to the re-INVITE (the message flow would be similar to the one in
   Figure 3).  This section explains the problems associated with
   returning an error response in these circumstances.  In order to
   avoid these problems, the UAS should use the latter option (UPDATE
   request plus a 2xx response).  Sections 3.3 and 3.4 contain the
   normative statements needed to avoid these problems.




Camarillo, et al.            Standards Track                    [Page 9]
^L
RFC 6141                Re-INVITE Handling in SIP             March 2011


   The reason for not using an error response to undo already executed
   changes is that an error response to a re-INVITE for which changes
   have already been executed (e.g., as a result of UPDATE transactions
   or reliable provisional responses) is effectively requesting a change
   in the session state.  However, the UAC has no means to reject that
   change if it is unable to execute them.  That is, if the UAC is
   unable to revert to the pre-re-INVITE state, it will not be able to
   communicate this fact to the UAS.

3.3.  UAS Behavior

   UASs should only return an error response to a re-INVITE if no
   changes to the session state have been executed since the re-INVITE
   was received.  Such an error response indicates that no changes have
   been executed as a result of the re-INVITE or any other transaction
   within it.

   If any of the changes requested in a re-INVITE or in any transaction
   within it have already been executed, the UAS SHOULD return a 2xx
   response.

   A change to the session state is considered to have been executed if
   an offer/answer without preconditions [RFC4032] for the stream has
   completed successfully or the UA has sent or received media using the
   new parameters.  Connection establishment messages (e.g., TCP SYN),
   connectivity checks (e.g., when using Interactive Connectivity
   Establishment (ICE) [RFC5245]), and any other messages used in the
   process of meeting the preconditions for a stream are not considered
   media.

      Normally, a UA receiving media can easily detect when the new
      parameters for the media stream are used (e.g., media is received
      on a new port).  However, in some scenarios, the UA will have to
      process incoming media packets in order to detect whether they use
      the old or new parameters.

   The successful completion of an offer/answer exchange without
   preconditions indicates that the new parameters for the media stream
   are already considered to be in use.  The successful completion of an
   offer/answer exchange with preconditions means something different.
   The fact that all mandatory preconditions for the stream are met
   indicates that the new parameters for the media stream are ready to
   be used.  However, they will not actually be used until the UAS
   decides to use them.  During a session establishment, the UAS can
   wait before using the media parameters until the callee starts being
   alerted or until the callee accepts the session.  During a session
   modification, the UAS can wait until its user accepts the changes to
   the session.  When dealing with streams where the UAS sends media



Camarillo, et al.            Standards Track                   [Page 10]
^L
RFC 6141                Re-INVITE Handling in SIP             March 2011


   more or less continuously, the UAC notices that the new parameters
   are in use because the UAC receives media that uses the new
   parameters.  However, this mechanism does not work with other types
   of streams.  Therefore, it is RECOMMENDED that when a UAS decides to
   start using the new parameters for a stream for which all mandatory
   preconditions have been met, the UAS either sends media using the new
   parameters or sends a new offer where the precondition-related
   attributes for the stream have been removed.  As indicated above, the
   successful completion of an offer/answer exchange without
   preconditions indicates that the new parameters for the media stream
   are already considered to be in use.

3.4.  UAC Behavior

   A UAC that receives an error response to a re-INVITE that undoes
   already executed changes within the re-INVITE may be facing a legacy
   UAS that does not support this specification (i.e., a UAS that does
   not follow the guidelines in Section 3.3).  There are also certain
   race condition situations that get both user agents out of
   synchronization.  In order to cope with these race condition
   situations, a UAC that receives an error response to a re-INVITE for
   which changes have been already executed SHOULD generate a new
   re-INVITE or UPDATE request in order to make sure that both UAs have
   a common view of the state of the session (the UAC uses the criteria
   in Section 3.3 in order to decide whether or not changes have been
   executed for a particular stream).  The purpose of this new offer/
   answer exchange is to synchronize both UAs, not to request changes
   that the UAS may choose to reject.  Therefore, session parameters in
   the offer/answer exchange SHOULD be as close to those in the
   pre-re-INVITE state as possible.

3.5.  Glare Situations

   Section 4 of RFC 3264 [RFC3264] defines glare conditions as a user
   agent receiving an offer after having sent one but before having
   received an answer to it.  That section specifies rules to avoid
   glare situations in most cases.  When, despite following those rules,
   a glare condition occurs (as a result of a race condition), it is
   handled as specified in Sections 14.1 and 14.2 of RFC 3261 [RFC3261].
   The UAS returns a 491 (Request Pending) response and the UAC retries
   the offer after a randomly selected time, which depends on which user
   agent is the owner of the Call-ID of the dialog.  The rules in RFC
   3261 [RFC3261] not only cover collisions between re-INVITEs that
   contain offers, they cover collisions between two re-INVITEs in
   general, even if they do not contain offers.  Sections 5.2 and 5.3 of
   RFC 3311 [RFC3311] extend those rules to also cover collisions
   between an UPDATE request carrying an offer and another message
   (UPDATE, PRACK, or INVITE) also carrying an offer.



Camarillo, et al.            Standards Track                   [Page 11]
^L
RFC 6141                Re-INVITE Handling in SIP             March 2011


   The rules in RFC 3261 [RFC3261] do not cover collisions between an
   UPDATE request and a non-2xx final response to a re-INVITE.  Since
   both the UPDATE request and the reliable response could be requesting
   changes to the session state, it would not be clear which changes
   would need to be executed first.  However, the procedures discussed
   in Section 3.4 already cover this type of situation.  Therefore,
   there is no need to specify further rules here.

3.6.  Example of UAS Behavior

   This section contains an example of a UAS that implements this
   specification using an UPDATE request and a 2xx response to a
   re-INVITE in order to revert to the pre-re-INVITE state.  The example
   shown in Figure 4 assumes that the UAS requires its user's input in
   order to accept or reject the addition of a video stream and uses
   reliable provisional responses [RFC3262] (PRACK transactions are not
   shown for clarity).

                 UAC                                          UAS

                  |                                            |
                  |-------------(1) INVITE SDP1--------------->|
                  |                                            |
                  |<------------(2) 200 OK SDP2----------------|
                  |                                            |
                  |------------------(3) ACK------------------>|
                  |                                            |
                  |                                            |
                  |-------------(4) INVITE SDP3--------------->|
                  |                                            |
                  |<----(5) 183 Session Progress SDP4----------|
                  |                                            |
                  |-------------(6) UPDATE SDP5--------------->|
                  |                                            |
                  |<------------(7) 200 OK SDP6----------------|
                  |                                            |
                  |                                            |
                  |<------------(8) UPDATE SDP7----------------|
                  |                                            |
                  |-------------(9) 200 OK SDP8--------------->|
                  |                                            |
                  |<--------------(10) 200 OK------------------|
                  |                                            |
                  |-----------------(11) ACK------------------>|
                  |                                            |

             Figure 4: Rejection of a video stream by the user




Camarillo, et al.            Standards Track                   [Page 12]
^L
RFC 6141                Re-INVITE Handling in SIP             March 2011


   The UAs perform an offer/answer exchange to establish an audio-only
   session:

         SDP1:
            m=audio 30000 RTP/AVP 0
            c=IN IP4 192.0.2.1

         SDP2:
            m=audio 31000 RTP/AVP 0
            c=IN IP4 192.0.2.5

   At a later point, the UAC sends a re-INVITE (4) in order to add a new
   codec to the audio stream and to add a video stream to the session.

         SDP3:
            m=audio 30000 RTP/AVP 0 3
            c=IN IP4 192.0.2.1
            m=video 30002 RTP/AVP 31
            c=IN IP4 192.0.2.1

   In (5), the UAS accepts the addition of the audio codec but does not
   accept the video stream yet (it provides a null IP address instead of
   setting the stream to 'inactive' because inactive streams still need
   to exchange RTCP traffic).

         SDP4:
            m=audio 31000 RTP/AVP 0 3
            c=IN IP4 192.0.2.5
            m=video 31002 RTP/AVP 31
            c=IN IP4 0.0.0.0

   At a later point, the UAC sends an UPDATE request (6) to remove the
   original audio codec from the audio stream (the UAC could have also
   used the PRACK to (5) to request this change).

         SDP5:
            m=audio 30000 RTP/AVP 3
            c=IN IP4 192.0.2.1
            m=video 30002 RTP/AVP 31
            c=IN IP4 192.0.2.1

         SDP6:
            m=audio 31000 RTP/AVP 3
            c=IN IP4 192.0.2.5
            m=video 31002 RTP/AVP 31
            c=IN IP4 0.0.0.0





Camarillo, et al.            Standards Track                   [Page 13]
^L
RFC 6141                Re-INVITE Handling in SIP             March 2011


   Yet, at a later point, the UAS's user rejects the addition of the
   video stream.  Additionally, the UAS decides to revert to the
   original audio codec.  Consequently, the UAS sends an UPDATE request
   (8) setting the port of the video stream to zero and offering the
   original audio codec in its SDP.

         SDP7:
            m=audio 31000 RTP/AVP 0
            c=IN IP4 192.0.2.5
            m=video 0 RTP/AVP 31
            c=IN IP4 0.0.0.0

   The UAC accepts the change in the audio codec in its 200 (OK)
   response (9) to the UPDATE request.

         SDP8:
            m=audio 30000 RTP/AVP 0
            c=IN IP4 192.0.2.1
            m=video 0 RTP/AVP 31
            c=IN IP4 192.0.2.1

   The UAS now returns a 200 (OK) response (10) to the re-INVITE.  Note
   that the media state after this 200 (OK) response is the same as the
   pre-re-INVITE media state.

3.7.  Example of UAC Behavior

   Figure 5 shows an example of a race condition situation in which the
   UAs end up with different views of the state of the session.






















Camarillo, et al.            Standards Track                   [Page 14]
^L
RFC 6141                Re-INVITE Handling in SIP             March 2011


  a:sendrecv                                                  a:sendrecv
  v:inactive                                                  v:inactive

             UA1                   Proxy                   UA2

              |                      |                      |
              |----(1) INVITE SDP1-->|                      |
              |                      |----(2) INVITE SDP1-->|
              |                      |                      |
              |                      |<----(3) 183 SDP2-----| a:sendrecv
  a:sendrecv  |<----(4) 183 SDP2-----|                      | v:recvonly
  v:sendonly  |                      |                      |
              |                      |<------(5) 4xx -------|
              |                      |-------(6) ACK ------>| a:sendrecv
              |           +-(7) 4xx -|                      | v:inactive
              |           |          |<---(8) UPDATE SDP3---|
              |<---(9) UPDATE SDP3---|                      |
              |           |          |                      |
  a:sendonly  |---(10) 200 OK SDP4-->|                      |
  v:inactive  |           |          |---(11) 200 OK SDP4-->| a:recvonly
              |<-(7) 4xx -+          |                      | v:inactive
  a:sendrecv  |------(12) ACK ------>|                      |
  v:inactive  |                      |                      |

                       a: status of the audio stream
                       v: status of the video stream

                Figure 5: Message flow with race condition

   The UAs in Figure 5 are involved in a session that, just before the
   message flows in the figures starts, includes a sendrecv audio stream
   and an inactive video stream.  UA1 sends a re-INVITE (1) requesting
   to make the video stream sendrecv.

         SDP1:
            m=audio 20000 RTP/AVP 0
            a=sendrecv
            m=video 20002 RTP/AVP 31
            a=sendrecv

   UA2 is configured to automatically accept incoming video streams but
   to ask for user input before generating an outgoing video stream.
   Therefore, UAS2 makes the video stream recvonly by returning a 183
   (Session Progress) response (2).







Camarillo, et al.            Standards Track                   [Page 15]
^L
RFC 6141                Re-INVITE Handling in SIP             March 2011


         SDP2:
            m=audio 30000 RTP/AVP 0
            a=sendrecv
            m=video 30002 RTP/AVP 31
            a=recvonly

   When asked for input, UA2's user chooses not to have either incoming
   or outgoing video.  In order to make the video stream inactive, UA2
   returns a 4xx error response (5) to the re-INVITE.  The ACK request
   (6) for this error response is generated by the proxy between both
   user agents.  Note that this error response undoes already executed
   changes.  So, UA2 is a legacy UA that does not support this
   specification.

   The proxy relays the 4xx response (7) towards UA1.  However, the 4xx
   response (7) takes time to arrive to UA1 (e.g., the response may have
   been sent over UDP and the first few retransmissions were lost).  In
   the meantime, UA2's user decides to put the audio stream on hold.
   UA2 sends an UPDATE request (8) making the audio stream recvonly.
   The video stream, which is inactive, is not modified and, thus,
   continues being inactive.

         SDP3:
            m=audio 30000 RTP/AVP 0
            a=recvonly
            m=video 30002 RTP/AVP 31
            a=inactive

   The proxy relays the UPDATE request (9) to UA1.  The UPDATE request
   (9) arrives at UA1 before the 4xx response (7) that had been
   previously sent.  UA1 accepts the changes in the UPDATE request and
   returns a 200 (OK) response (10) to it.


         SDP4:
            m=audio 20000 RTP/AVP 0
            a=sendonly
            m=video 30002 RTP/AVP 31
            a=inactive

   At a later point, the 4xx response (7) finally arrives at UA1.  This
   response makes the session return to its pre-re-INVITE state.
   Therefore, for UA1, the audio stream is sendrecv and the video stream
   is inactive.  However, for UA2, the audio stream is recvonly (the
   video stream is also inactive).






Camarillo, et al.            Standards Track                   [Page 16]
^L
RFC 6141                Re-INVITE Handling in SIP             March 2011


   After the message flow in Figure 5, following the recommendations in
   this section, when UA1 received an error response (7) that undid
   already executed changes, UA1 would generate an UPDATE request with
   an SDP reflecting the pre-re-INVITE state (i.e., sendrecv audio and
   inactive video).  UA2 could then return a 200 (OK) response to the
   UPDATE request making the audio stream recvonly, which is the state
   UA2's user had requested.  Such an UPDATE transaction would get the
   UAs back into synchronization.

3.8.  Clarifications on Canceling Re-INVITEs

   Section 9.2 of RFC 3261 [RFC3261] specifies the behavior of a UAS
   responding to a CANCEL request.  Such a UAS responds to the INVITE
   request with a 487 (Request Terminated) at the SHOULD level.  Per the
   rules specified in Section 3.3, if the INVITE request was a re-INVITE
   and some of its requested changes had already been executed, the UAS
   would return a 2xx response instead.

4.  Refreshing a Dialog's Targets

   The following sections discuss how to refresh the targets of a
   dialog.

4.1.  Background and Terminology on a Dialog's Targets

   As described in Section 12 of RFC 3261 [RFC3261], a UA involved in a
   dialog keeps a record of the SIP or Session Initiation Protocol
   Secure (SIPS) URI at which it can communicate with a specific
   instance of its peer (this is called the "dialog's remote target URI"
   and is equal to the URI contained in the Contact header of requests
   and responses it receives from the peer).  This document introduces
   the complementary concept of the "dialog's local target URI", defined
   as a UA's record of the SIP or SIPS URI at which the peer can
   communicate with it (equal to the URI contained in the Contact header
   of requests and responses it sends to the peer).  These terms are
   complementary because the "dialog's remote target URI" according to
   one UA is the "dialog's local target URI" according to the other UA,
   and vice versa.

4.2.  Background on Target-Refresh Requests

   A target-refresh request is defined as follows in Section 6 of RFC
   3261 [RFC3261]:

      A target-refresh request sent within a dialog is defined as a
      request that can modify the remote target of the dialog.





Camarillo, et al.            Standards Track                   [Page 17]
^L
RFC 6141                Re-INVITE Handling in SIP             March 2011


   Additionally, 2xx responses to target-refresh requests can also
   update the remote target of the dialog.  As discussed in Section 12.2
   of RFC 3261 [RFC3261], re-INVITEs are target-refresh requests.

   RFC 3261 [RFC3261] specifies the behavior of UASs receiving target-
   refresh requests and of UACs receiving a 2xx response for a target-
   refresh request.

   Section 12.2.2 of RFC 3261 [RFC3261] says:

      When a UAS receives a target refresh request, it MUST replace the
      dialog's remote target URI with the URI from the Contact header
      field in that request, if present.

   Section 12.2.1.2 of RFC 3261 [RFC3261] says:

      When a UAC receives a 2xx response to a target refresh request, it
      MUST replace the dialog's remote target URI with the URI from the
      Contact header field in that response, if present.

   The fact that re-INVITEs can be long-lived transactions and can have
   other transactions within them makes it necessary to revise these
   rules.  Section 4.3 specifies new rules for the handling of target-
   refresh requests.  Note that the new rules apply to any target-
   refresh request, not only to re-INVITEs.

4.3.  Clarification on the Atomicity of Target-Refresh Requests

   The local and remote targets of a dialog are special types of state
   information because of their essential role in the exchange of SIP
   messages between UAs in a dialog.  A UA involved in a dialog receives
   the remote target of the dialog from the remote UA.  The UA uses the
   received remote target to send SIP requests to the remote UA.

   The dialog's local target is a piece of state information that is not
   meant to be negotiated.  When a UA changes its local target (i.e.,
   the UA changes its IP address), the UA simply communicates its new
   local target to the remote UA (e.g., the UA communicates its new IP
   address to the remote UA in order to remain reachable by the remote
   UA).  UAs need to follow the behavior specified in Sections 4.4, 4.5,
   4.6, and 4.7 of this specification instead of that specified in RFC
   3261 [RFC3261], which was discussed in Section 4.2.  The new behavior
   regarding target-refresh requests implies that a target-refresh
   request can, in some cases, update the remote target even if the
   request is responded to with a final error response.  This means that
   target-refresh requests are not atomic.





Camarillo, et al.            Standards Track                   [Page 18]
^L
RFC 6141                Re-INVITE Handling in SIP             March 2011


4.4.  UA Updating the Dialog's Local Target in a Request

   In order to update its local target, a UA can send a target-refresh
   request.  If the UA receives an error response to the target-refresh
   request, the remote UA has not updated its remote target.

      This allows UASs to authenticate target-refresh requests (see
      Section 26.2 of RFC 3261 [RFC3261]).

   If the UA receives a reliable provisional response or a 2xx response
   to the target-refresh request, or the UA receives an in-dialog
   request on the new local target, the remote UA has updated its remote
   target.  The UA can consider the target refresh operation completed.

      Even if the target request was a re-INVITE and the final response
      to the re-INVITE was an error response, the UAS would not revert
      to the pre-re-INVITE remote target.

   A UA SHOULD NOT use the same target refresh request to refresh the
   target and to make session changes unless the session changes can be
   trivially accepted by the remote UA (e.g., an IP address change).
   Piggybacking a target refresh with more complicated session changes
   would make it unnecessarily complicated for the remote UA to accept
   the target refresh while rejecting the session changes.  Only in case
   the target refresh request is a re-INVITE and the UAS supports
   reliable provisional response or UPDATE requests, the UAC MAY
   piggyback session changes and a target refresh in the same re-INVITE.

4.5.  UA Updating the Dialog's Local Target in a Response

   A UA processing an incoming target refresh request can update its
   local target by returning a reliable provisional response or a 2xx
   response to the target-refresh request.  The response needs to
   contain the updated local target URI in its Contact header field.  On
   sending the response, the UA can consider the target refresh
   operation completed.

4.6.  A Request Updating the Dialog's Remote Target

   Behavior of a UA after having received a target-refresh request
   updating the remote target:

   If the UA receives a target-refresh request that has been properly
   authenticated (see Section 26.2 of RFC 3261 [RFC3261]), the UA SHOULD
   generate a reliable provisional response or a 2xx response to the
   target-refresh request.  If generating such responses is not possible
   (e.g., the UA does not support reliable provisional responses and
   needs user input before generating a final response), the UA SHOULD



Camarillo, et al.            Standards Track                   [Page 19]
^L
RFC 6141                Re-INVITE Handling in SIP             March 2011


   send an in-dialog request to the remote UA using the new remote
   target (if the UA does not need to send a request for other reasons,
   the UAS can send an UPDATE request).  On sending a reliable
   provisional response or a 2xx response to the target-refresh request,
   or a request to the new remote target, the UA MUST replace the
   dialog's remote target URI with the URI from the Contact header field
   in the target-refresh request.

      Reliable provisional responses in SIP are specified in RFC 3262
      [RFC3262].  In this document, reliable provisional responses are
      those that use the mechanism defined in RFC 3262 [RFC3262].  Other
      specifications may define ways to send provisional responses
      reliably using non-SIP mechanisms (e.g., using media-level
      messages to acknowledge the reception of the SIP response).  For
      the purposes of this document, provisional responses using those
      non-SIP mechanisms are considered unreliable responses.  Note that
      non-100 provisional responses are only applicable to INVITE
      transactions [RFC4320].

   If instead of sending a reliable provisional response or a 2xx
   response to the target-refresh request, or a request to the new
   target, the UA generates an error response to the target-refresh
   request, the UA MUST NOT update its dialog's remote target.

4.7.  A Response Updating the Dialog's Remote Target

   If a UA receives a reliable provisional response or a 2xx response to
   a target-refresh request, the UA MUST replace the dialog's remote
   target URI with the URI from the Contact header field in that
   response, if present.

   If a UA receives an unreliable provisional response to a target-
   refresh request, the UA MUST NOT refresh the dialog's remote target.

4.8.  Race Conditions and Target Refreshes

   SIP provides request ordering by using the Cseq header field.  That
   is, a UA that receives two requests at roughly the same time can know
   which one is newer.  However, SIP does not provide ordering between
   responses and requests.  For example, if a UA receives a 200 (OK)
   response to an UPDATE request and an UPDATE request at roughly the
   same time, the UA cannot know which one was sent last.  Since both
   messages can refresh the remote target, the UA needs to know which
   message was sent last in order to know which remote target needs to
   be used.






Camarillo, et al.            Standards Track                   [Page 20]
^L
RFC 6141                Re-INVITE Handling in SIP             March 2011


   This document specifies the following rule to avoid the situation
   just described.  If the protocol allows a UA to use a target-refresh
   request at the point in time that the UA wishes to refresh its local
   target, the UA MUST use a target-refresh request instead of a
   response to refresh its local target.  This rule implies that a UA
   only uses a response (i.e., a reliable provisional response or a 2xx
   response to a target-refresh request) to refresh its local target if
   the UA is unable to use a target-refresh request at that point in
   time (e.g., the UAS of an ongoing re-INVITE without support for
   UPDATE).

4.9.  Early Dialogs

   The rules given in this section about which messages can refresh the
   target of a dialog also apply to early dialogs created by an initial
   INVITE transaction.  Additionally, as specified in Section 13.2.2.4
   of RFC 3261 [RFC3261], on receiving a 2xx response to the initial
   INVITE, the UAC recomputes the whole route set of the dialog, which
   transitions from the "early" state to the "confirmed" state.

   Section 12.1 of RFC 3261 allows unreliable provisional responses to
   create early dialogs.  However, per the rules given in this section,
   unreliable provisional responses cannot refresh the target of a
   dialog.  Therefore, the UAC of an initial INVITE transaction will not
   perform any target refresh as a result of the reception of an
   unreliable provisional response with an updated Contact value on an
   (already established) early dialog.  Note also that a given UAS can
   establish additional early dialogs, which can have different targets,
   by returning additional unreliable provisional responses with
   different To tags.

5.  A UA Losing Its Contact

   The following sections discuss the case where a UA loses its
   transport address during an ongoing re-INVITE transaction.  Such a UA
   will refresh the dialog's local target so that it reflects its new
   transport address.  Note that target refreshes that do not involve
   changes in the UA's transport address are outside of the scope of
   this section.  Also, UAs losing their transport address during a
   non-re-INVITE transaction (e.g., a UA losing its transport address
   right after having sent an UPDATE request before having received a
   response to it) are out of scope as well.

   The rules given in this section are also applicable to initial INVITE
   requests that have established early dialogs.






Camarillo, et al.            Standards Track                   [Page 21]
^L
RFC 6141                Re-INVITE Handling in SIP             March 2011


5.1.  Background on Re-INVITE Transaction Routing

   Re-INVITEs are routed using the dialog's route set, which contains
   all the proxy servers that need to be traversed by requests sent
   within the dialog.  Responses to the re-INVITE are routed using the
   Via entries in the re-INVITE.

   ACK requests for 2xx responses and for non-2xx final responses are
   generated in different ways.  As specified in Sections 14.1 and
   13.2.1 of RFC 3261 [RFC3261], ACK requests for 2xx responses are
   generated by the UAC core and are routed using the dialog's route
   set.  As specified in Section 17.1.1.2 of RFC 3261 [RFC3261], ACK
   requests for non-2xx final responses are generated by the INVITE
   client transaction (i.e., they are generated in a hop-by-hop fashion
   by the proxy servers in the path) and are sent to the same transport
   address as the re-INVITE.

5.2.  Problems with UAs Losing Their Contact

   Refreshing the dialog's remote target during a re-INVITE transaction
   (see Section 4.3) presents some issues because of the fact that
   re-INVITE transactions can be long lived.  As described in
   Section 5.1, the way responses to the re-INVITE and ACKs for non-2xx
   final responses are routed is fixed once the re-INVITE is sent.  The
   routing of this messages does not depend on the dialog's route set
   and, thus, target refreshes within an ongoing re-INVITE do not affect
   their routing.  A UA that changes its location (i.e., performs a
   target refresh) but is still reachable at its old location will be
   able to receive those messages (which will be sent to the old
   location).  However, a UA that cannot be reachable at its old
   location any longer will not be able to receive them.

   The following sections describe the errors UAs face when they lose
   their transport address during a re-INVITE.  On detecting some of
   these errors, UAs following the rules specified in RFC 3261 [RFC3261]
   will terminate the dialog.  When the dialog is terminated, the only
   option for the UAs is to establish a new dialog.  The following
   sections change the requirements RFC 3261 [RFC3261] places on UAs
   when certain errors occur so that the UAs can recover from those
   errors.  In short, the UAs generate a new re-INVITE transaction to
   synchronize both UAs.  Note that there are existing UA
   implementations deployed that already implement this behavior.

5.3.  UAS Losing Its Contact: UAC Behavior

   When a UAS that moves to a new contact and loses its old contact
   generates a non-2xx final response to the re-INVITE, it will not be
   able to receive the ACK request.  The entity receiving the response



Camarillo, et al.            Standards Track                   [Page 22]
^L
RFC 6141                Re-INVITE Handling in SIP             March 2011


   and, thus, generating the ACK request will either get a transport
   error or a timeout error, which, as described in Section 8.1.3.1 of
   RFC 3261 [RFC3261], will be treated as a 503 (Service Unavailable)
   response and as a 408 (Request Timeout) response, respectively.  If
   the sender of the ACK request is a proxy server, it will typically
   ignore this error.  If the sender of the ACK request is the UAC,
   according to Section 12.2.1.2 of RFC 3261 [RFC3261], it is supposed
   to (at the SHOULD level) terminate the dialog by sending a BYE
   request.  However, because of the special properties of ACK requests
   for non-2xx final responses, most existing UACs do not terminate the
   dialog when ACK request fails, which is fortunate.

   A UAC that accepts a target refresh within a re-INVITE MUST ignore
   transport and timeout errors when generating an ACK request for a
   non-2xx final response.  Additionally, UAC SHOULD generate a new
   re-INVITE in order to make sure that both UAs have a common view of
   the state of the session.

      It is possible that the errors ignored by the UAC were not related
      to the target refresh operation.  If that was the case, the second
      re-INVITE would fail and the UAC would terminate the dialog
      because, per the rules above, UACs only ignore errors when they
      accept a target refresh within the re-INVITE.

5.4.  UAC Losing Its Contact: UAS Behavior

   When a UAC moves to a new contact and loses its old contact, it will
   not be able to receive responses to the re-INVITE.  Consequently, it
   will never generate an ACK request.

   As described in Section 16.9 of RFC 3261 [RFC3261], a proxy server
   that gets an error when forwarding a response does not take any
   measures.  Consequently, proxy servers relaying responses will
   effectively ignore the error.

   If there are no proxy servers in the dialog's route set, the UAS will
   get an error when sending a non-2xx final response.  The UAS core
   will be notified of the transaction failure, as described in Section
   17.2.1 of RFC 3261 [RFC3261].  Most existing UASs do not terminate
   the dialog on encountering this failure, which is fortunate.

   Regardless of the presence or absence of proxy servers in the
   dialog's route set, a UAS generating a 2xx response to the re-INVITE
   will never receive an ACK request for it.  According to Section 14.2
   of RFC 3261 [RFC3261], such a UAS is supposed to (at the "should"
   level) terminate the dialog by sending a BYE request.





Camarillo, et al.            Standards Track                   [Page 23]
^L
RFC 6141                Re-INVITE Handling in SIP             March 2011


   A UAS that accepts a target refresh within a re-INVITE and never
   receives an ACK request after having sent a final response to the
   re-INVITE SHOULD NOT terminate the dialog if the UA has received a
   new re-INVITE with a higher CSeq sequence number than the original
   one.

5.5.  UAC Losing Its Contact: UAC Behavior

   When a UAC moves to a new contact and loses its old contact, it will
   not be able to receive responses to the re-INVITE.  Consequently, it
   will never generate an ACK request.

   Such a UAC SHOULD generate a CANCEL request to cancel the re-INVITE
   and cause the INVITE client transaction corresponding to the
   re-INVITE to enter the "Terminated" state.  The UAC SHOULD also send
   a new re-INVITE in order to make sure that both UAs have a common
   view of the state of the session.

      Per Section 14.2 of RFC 3261 [RFC3261], the UAS will accept new
      incoming re-INVITEs as soon as it has generated a final response
      to the previous INVITE request, which had a lower CSeq sequence
      number.

6.  Security Considerations

   This document does not introduce any new security issue.  It just
   clarifies how certain transactions should be handled in SIP.
   Security issues related to re-INVITEs and UPDATE requests are
   discussed in RFC 3261 [RFC3261] and RFC 3311 [RFC3311].

   In particular, in order not to reduce the security level for a given
   session, re-INVITEs and UPDATE requests SHOULD be secured using a
   mechanism equivalent to or stronger than the initial INVITE request
   that created the session.  For example, if the initial INVITE request
   was end-to-end integrity protected or encrypted, subsequent
   re-INVITEs and UPDATE requests should also be so.

7.  Acknowledgements

   Paul Kyzivat provided useful ideas on the topics discussed in this
   document.










Camarillo, et al.            Standards Track                   [Page 24]
^L
RFC 6141                Re-INVITE Handling in SIP             March 2011


8.  References

8.1.  Normative References

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119, March 1997.

   [RFC3261]  Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston,
              A., Peterson, J., Sparks, R., Handley, M., and E.
              Schooler, "SIP: Session Initiation Protocol", RFC 3261,
              June 2002.

   [RFC3262]  Rosenberg, J. and H. Schulzrinne, "Reliability of
              Provisional Responses in Session Initiation Protocol
              (SIP)", RFC 3262, June 2002.

   [RFC3264]  Rosenberg, J. and H. Schulzrinne, "An Offer/Answer Model
              with Session Description Protocol (SDP)", RFC 3264,
              June 2002.

   [RFC3311]  Rosenberg, J., "The Session Initiation Protocol (SIP)
              UPDATE Method", RFC 3311, October 2002.

   [RFC4032]  Camarillo, G. and P. Kyzivat, "Update to the Session
              Initiation Protocol (SIP) Preconditions Framework",
              RFC 4032, March 2005.

8.2.  Informative References

   [RFC4320]  Sparks, R., "Actions Addressing Identified Issues with the
              Session Initiation Protocol's (SIP) Non-INVITE
              Transaction", RFC 4320, January 2006.

   [RFC5245]  Rosenberg, J., "Interactive Connectivity Establishment
              (ICE): A Protocol for Network Address Translator (NAT)
              Traversal for Offer/Answer Protocols", RFC 5245,
              April 2010.














Camarillo, et al.            Standards Track                   [Page 25]
^L
RFC 6141                Re-INVITE Handling in SIP             March 2011


Authors' Addresses

   Gonzalo Camarillo (editor)
   Ericsson
   Hirsalantie 11
   Jorvas  02420
   Finland

   EMail: Gonzalo.Camarillo@ericsson.com


   Christer Holmberg
   Ericsson
   Hirsalantie 11
   Jorvas  02420
   Finland

   EMail: Christer.Holmberg@ericsson.com


   Yang Gao
   ZTE
   China

   EMail: gao.yang2@zte.com.cn


























Camarillo, et al.            Standards Track                   [Page 26]
^L