summaryrefslogtreecommitdiff
path: root/doc/rfc/rfc4596.txt
blob: 542870f827871ec4e85deea39d77fee1576361c4 (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
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
Network Working Group                                       J. Rosenberg
Request for Comments: 4596                                    P. Kyzivat
Category: Informational                                    Cisco Systems
                                                               July 2006


     Guidelines for Usage of the Session Initiation Protocol (SIP)
                      Caller Preferences Extension

Status of This Memo

   This memo provides information for the Internet community.  It does
   not specify an Internet standard of any kind.  Distribution of this
   memo is unlimited.

Copyright Notice

   Copyright (C) The Internet Society (2006).

Abstract

   This document contains guidelines for usage of the Caller Preferences
   Extension to the Session Initiation Protocol (SIP).  It demonstrates
   the benefits of caller preferences with specific example
   applications, provides use cases to show proper operation, provides
   guidance on the applicability of the registered feature tags, and
   describes a straightforward implementation of the preference and
   capability matching algorithm specified in Section 7.2 of RFC 3841.























Rosenberg & Kyzivat          Informational                      [Page 1]
^L
RFC 4596                Caller Preferences Uses                July 2006


Table of Contents

   1. Introduction ....................................................4
   2. Motivations for Caller Preferences ..............................5
      2.1. One-Number .................................................7
      2.2. Direct-to-Voicemail ........................................7
   3. Caller Preference Use Cases .....................................8
      3.1. Routing of INVITE and MESSAGE to Different UA ..............8
           3.1.1. Desired Behavior ....................................8
           3.1.2. Solution ............................................9
      3.2. Single Contact Not Matching Implicit Preferences ..........10
           3.2.1. Desired Behavior ...................................10
           3.2.2. Solution ...........................................10
      3.3. Package-Based Routing .....................................11
           3.3.1. Desired Behavior ...................................11
           3.3.2. Solution ...........................................11
      3.4. Package Routing II ........................................12
           3.4.1. Desired Behavior ...................................12
           3.4.2. Solution ...........................................13
      3.5. Audio/Video vs. Audio Only ................................13
           3.5.1. Desired Behavior ...................................13
           3.5.2. Solution ...........................................14
      3.6. Forcing Audio/Video .......................................15
           3.6.1. Desired Behavior ...................................15
           3.6.2. Solution ...........................................15
      3.7. Third-Party Call Control: Forcing Media ...................16
           3.7.1. Desired Behavior ...................................16
           3.7.2. Solution ...........................................16
      3.8. Maximizing Media Overlaps .................................17
           3.8.1. Desired Behavior ...................................17
           3.8.2. Solution ...........................................17
      3.9. Multilingual Lines ........................................18
           3.9.1. Desired Behavior ...................................18
           3.9.2. Solution ...........................................19
      3.10. I Hate Voicemail! ........................................20
           3.10.1. Desired Behavior ..................................20
           3.10.2. Solution ..........................................20
      3.11. I Hate People! ...........................................21
           3.11.1. Desired Behavior ..................................21
           3.11.2. Solution ..........................................21
      3.12. Prefer Voicemail .........................................22
           3.12.1. Desired Behavior ..................................22
           3.12.2. Solution ..........................................22
      3.13. Routing to an Executive ..................................22
           3.13.1. Desired Behavior ..................................22
           3.13.2. Solution ..........................................22





Rosenberg & Kyzivat          Informational                      [Page 2]
^L
RFC 4596                Caller Preferences Uses                July 2006


      3.14. Speak to the Executive ...................................23
           3.14.1. Desired Behavior ..................................23
           3.14.2. Solution ..........................................24
      3.15. Mobile Phone Only ........................................24
           3.15.1. Desired Behavior ..................................24
           3.15.2. Solution ..........................................24
      3.16. Simultaneous Languages ...................................25
           3.16.1. Desired Behavior ..................................25
           3.16.2. Solution ..........................................25
      3.17. The Number You Have Called... ............................26
           3.17.1. Desired Behavior ..................................26
           3.17.2. Solution ..........................................26
      3.18. The Number You Have Called, Take Two .....................27
           3.18.1. Desired Behavior ..................................27
           3.18.2. Solution ..........................................27
      3.19. Forwarding to a Colleague ................................28
           3.19.1. Desired Behavior ..................................28
           3.19.2. Solution ..........................................28
   4. Capability Use Cases ...........................................30
      4.1. Web Redirect ..............................................30
      4.2. Voicemail Icon ............................................30
   5. Usage of the Feature Tags ......................................31
      5.1. Traditional Cell Phone ....................................31
      5.2. Traditional Work Phone ....................................32
      5.3. PC Messaging Application ..................................32
      5.4. Standalone Videophone .....................................33
   6. Example of Implementation of Preference and Capability
      Matching .......................................................33
      6.1. Extracting a Feature Set from a Header ....................34
      6.2. Extracting Values from a Feature Parameter ................35
      6.3. Comparing Two Value-Ranges ................................36
      6.4. Feature Set to Feature Set Matching .......................36
      6.5. Selecting and Ordering Contacts Based on Caller
           Preferences ...............................................37
           6.5.1. Reject-Contact Processing ..........................37
           6.5.2. Accept-Contact Processing ..........................37
   7. Security Considerations ........................................38
   8. Acknowledgements ...............................................38
   9. Informative References .........................................38












Rosenberg & Kyzivat          Informational                      [Page 3]
^L
RFC 4596                Caller Preferences Uses                July 2006


1.  Introduction

   The Session Initiation Protocol (SIP) [1] extension for Callee
   Capabilities [2] describes mechanisms that allow a UA (User Agent) to
   register its capabilities in a REGISTER request.  A caller can
   express preferences, either explicitly or implicitly, about how that
   request is to be handled.  This is accomplished with the Accept-
   Contact and Reject-Contact header fields described in Caller
   Preferences for the Session Initiation Protocol[3].

   The caller preferences extension can serve as a useful tool for
   supporting many applications.  However, its generality makes it
   difficult to use correctly and effectively in any one situation.  To
   remedy that, this document serves as a compendium of examples of the
   usage of the caller preferences extension.

      NOTE: This document is intended to assist the reader in
      understanding RFCs 3840 and 3841.  It is not intended to serve as
      a substitute for reading those documents.  The examples presented
      in this document cannot be fully understood without awareness of
      the mechanisms defined in RFCs 3840 and 3841.

   First, Section 2 demonstrates the benefits of using caller
   preferences by describing several concrete applications that are
   enabled by the extension.  Section 3 describes a set of detailed use
   cases for expressing caller preferences.  Each use case presents a
   situation, describes how caller preferences can be used to handle the
   requirements for the situation, and verifies that the desired
   behavior occurs by showing the results of the matching operation.
   These use cases validate that the caller preferences specification is
   complete and capable of meeting a specific set of requirements.
   Since the caller preferences specification predates the SIP change
   process [4], no requirements document was ever published for it.  To
   some degree, this document "backfills" requirements.  However, this
   is not an academic exercise only, since the use cases described here
   did result in changes in the caller preferences document as it
   evolved.  These use cases also help implementors figure out how to
   use caller preferences in their own applications.

   Section 4 discusses applications for the callee capabilities
   specification.  Section 5 discusses the example registrations of the
   feature tags described in [2].  Proper usage of the caller
   preferences extension depends on proper interpretation of the
   semantics of these tags.  More detail is provided on the tags, and
   example registrations are included that show typical usage.






Rosenberg & Kyzivat          Informational                      [Page 4]
^L
RFC 4596                Caller Preferences Uses                July 2006


   Section 6 outlines an implementation approach to the matching
   algorithm that doesn't require RFC 2533 [6] to be implemented in all
   its generality.

2.  Motivations for Caller Preferences

   At its core, SIP is a protocol that facilitates rendezvous of users.
   The caller and callee need to meet up in order to exchange session
   information, so that they may communicate.  The rendezvous process is
   complicated by the fact that a user has multiple points of attachment
   to the network.  A called user (callee) can have a cell phone, a PDA,
   a work phone, a home phone, and one of several PC-based
   communications applications.  When someone calls that user, to which
   of these devices is the call routed?

   Certainly, the call can be routed to all of them at the same time, a
   process known as parallel forking.  However, that is not always the
   desired behavior.  Users may prefer that their registered devices be
   tried in a particular order.  As an example, a user might prefer that
   his cell phone ring first, and if no one answers, that his work phone
   ring next.  Another user might prefer that her cell phone ring first,
   and then her home and work phones ring at the same time, and then, if
   no one answers either of those, that the call be forwarded to
   voicemail.  These variations are all referred to as find-me/
   follow-me features.

   SIP supports find-me/follow-me features in many ways.  The most basic
   is through the SIP registration process.  Each device at which a user
   can be contacted registers to the network.  This registration
   associates the device with the canonical name of the user, called the
   address-of-record (AOR), which is a SIP URI.  Each registration can
   include a preference value, indicating the relative preference for
   receiving calls at that device, compared to other devices.  When
   someone makes a call to the AOR, proxies compliant to RFC 3261 will
   try the registered devices in order of preference, unless
   administrative policy overrides user preferences.

   Preference values in SIP registrations can only provide basic find-
   me/follow-me features.  To support more complex features, the Call
   Processing Language (CPL) [5] has been specified.  It is an XML
   script that provides specific call routing instructions.  Users can
   upload these scripts to the network, instructing the servers how
   calls should be routed.  As an example, a CPL script can instruct a
   proxy to route a call to the work phone during work hours (9 am -
   5 pm) and then to the cell phone after hours, unless the call is from
   a family member, in which case it always goes to the cell phone.





Rosenberg & Kyzivat          Informational                      [Page 5]
^L
RFC 4596                Caller Preferences Uses                July 2006


   It is important to note that both CPL scripts and preference values
   in registrations describe operation of a service from the perspective
   of the called party.  That is, they describe how a call made to the
   called party should be routed by the network.  However, the called
   party is not the only one with preferences.  A caller will also have
   preferences for how they want their call to be routed.  As an
   example, a caller will often want to reach a user on their cell
   phone.  In the current telephone network, this is accomplished by
   requiring a user to have a separate number for each device.  This
   way, when a caller wishes to reach the cell phone, they dial the
   number for the cell phone.  This requires users to maintain lists of
   potential reach numbers for a user, and then select the appropriate
   one.  A far better approach is for a user to maintain a single
   address-of-record.  When someone wishes to reach them on their cell
   phone, they call the AOR, but indicate a preference for the call to
   be routed to the cell phone.

   A caller may actually have a wide variety of preferences for how a
   call should be routed.  They may prefer to go right to voicemail.
   They may prefer never to reach voicemail.  The may prefer to reach
   the user on a device that supports video (because a video-conference
   is desired).  They may wish to reach a device that has an attendant
   who can answer if the user is not there.

   The SIP caller preferences extension allows a caller to express these
   preferences for the way in which their calls are handled.  These
   preferences are expressed in terms of properties of the desired
   device.  These properties are name-value pairs that convey some kind
   of information about a device.  One example is the property
   "mobility", which can have the values "mobile" or "fixed".  When a
   caller wishes to reach a cell phone, they include information in
   their call setup request (the INVITE method) which indicates that the
   call should be routed to a device that has the property "mobility"
   set to "mobile".  When devices register to the network, they include
   their properties (also known as callee capabilities) as part of the
   registration.  In this way, a proxy can match the caller's
   preferences against the capabilities of the various devices
   registered to the user and route the call appropriately.

   While this document addresses the preferences of a caller, it does so
   from the perspective of a SIP User Agent representing the caller.
   Caller preferences are herein represented via syntactic elements
   placed in a SIP request.  This document does not attempt to address
   how preferences might be conveyed by a human user to the User Agent.
   Thus this document is likely to be of most value to the developer of
   a User Agent.





Rosenberg & Kyzivat          Informational                      [Page 6]
^L
RFC 4596                Caller Preferences Uses                July 2006


   The caller preferences extension can support a wide variety of call
   routing applications and features.  Two particularly important
   examples are "one-number" and "direct-to-voicemail".

2.1.  One-Number

   In today's circuit-switched telephony networks, users have multiple
   devices, and each device is associated with its own phone number.  A
   user will typically list all of these numbers on a business card:
   cell phone, work phone, home office phone, and so on.  Other users
   need to store and manage all of these numbers.  It is difficult to
   keep these numbers complete and up-to-date.  Worse, when you want to
   call someone, you need to pick a number to try.  Sometimes, you want
   a specific device (the cell phone); and other times, you just want to
   reach them wherever they are.  In the latter case, a user is forced
   to try each number, one at a time.  This is inefficient, and
   difficult to do while driving, for example.

   As an alternative, a user can have a single address.  This is the one
   and only address they give out to other users on their business
   cards.  If a caller wishes to reach that user on their cell phone,
   they select that one address, and then access a pull-down menu of
   device types.  This menu would include home phone, work phone, and
   cell phone.  The caller can select cell-phone, and then the call is
   placed to the cell phone.  There is no need to manage or maintain
   more than one number for the user -- a single number will suffice.

   If, on the other hand, the caller wishes to reach the user wherever
   they are, they make a call to that one number without a selection of
   a preferred device.  The network will ring all devices at the same
   time, and therefore reach the user as fast as possible.

   This one-number service makes use of caller preferences.  To express
   a preference for the cell phone, the caller's device would include a
   header in the SIP INVITE request, indicating a desire to reach a
   device with "mobility" equal to "mobile".

2.2.  Direct-to-Voicemail

   Frequently, a busy executive on the road wants to quickly pass a
   message to a colleague by voice.  As an example, a boss might want to
   instruct an employee to call a specific customer and resolve a
   pending issue.  In such a case, the user doesn't actually want to
   talk to the person; they just want to leave a voice message.  Having
   a phone conversation may require too much time, whereas a voice
   message can be quick and to the point.  The voice message can also
   serve as a record of exactly what is desired, whereas a fleeting
   voice conversation can be forgotten or misremembered.



Rosenberg & Kyzivat          Informational                      [Page 7]
^L
RFC 4596                Caller Preferences Uses                July 2006


   In today's circuit-switched telephone networks, there is often no way
   to go directly to someone's voicemail and leave a message.
   Sometimes, you can dial the main number for the voicemail system,
   enter in the extension of the desired party, and leave a message by
   entering a specific prompt.  This is time consuming, and requires the
   caller to know the main voicemail number.

   Instead, an address book in a cell phone can have an option called
   "leave voice message", available for each entry in the address book.
   When this option is selected, a call is made directly to the
   voicemail for that user, which immediately picks up and prompts for a
   message.  In fact, a rapid greeting is played, so that the caller can
   go directly to the recording procedure.

   This saves time for the caller, making it very easy to quickly leave
   recorded messages for a large number of people.

   This feature is possible using the caller preferences extension.
   When the user selects the "leave voice message" option, the phone
   sends a SIP INVITE request, and includes a caller preferences header
   field that indicates a preference for devices whose "msgserver"
   attribute has a value of "true".  This will cause the proxy to route
   the call directly to a registered voicemail service.  Furthermore,
   the voicemail server will see that the caller asked to go directly to
   voicemail, and can therefore play an abbreviated greeting explicitly
   designed for this case.

3.  Caller Preference Use Cases

   Each use case is described as a situation along with a desired
   behavior.  Then, it demonstrates how the various caller preferences
   headers and the proxy processing logic would result in the
   appropriate decision.

3.1.  Routing of INVITE and MESSAGE to Different UA

3.1.1.  Desired Behavior

   Address of Record (AOR) Y has two contacts, Y1 and Y2.  Y1 is a phone
   and supports the standard operations INVITE, ACK, OPTIONS, BYE, and
   CANCEL but does not support MESSAGE, whereas Y2 is a pager and
   supports only OPTIONS and MESSAGE.  Caller X wants to send pages to
   Y.  There is a lot of traffic in the network of both calls and pages,
   so there is a goal not to unnecessarily fork messages to devices that
   can't support them.  So, this is done by ensuring that INVITEs of Y
   are delivered only to Y1, while MESSAGEs to Y are delivered only to
   Y2.




Rosenberg & Kyzivat          Informational                      [Page 8]
^L
RFC 4596                Caller Preferences Uses                July 2006


3.1.2.  Solution

   Y1 will create a registration that looks like, in part:

      REGISTER sip:example.com SIP/2.0
      To: sip:Y@example.com
      Contact:<sip:Y1@pc.example.com>
        ;methods="INVITE,ACK,OPTIONS,BYE,CANCEL"
        ;uri-user="<Y1>"
        ;uri-domain="example.com"
        ;audio
        ;schemes="sip"
        ;mobility="mobile"

   Y2 will create a registration that looks like, in part:

      REGISTER sip:example.com SIP/2.0
      To: sip:Y@example.com
      Contact: <sip:Y2@pc.example.com>
        ;methods="OPTIONS,MESSAGE"
        ;uri-user="<Y2>"
        ;uri-domain="example.com"
        ;+sip.message
        ;schemes="sip,im"
        ;mobility="mobile"

   When a UAC (User Agent Client) sends an INVITE, it will arrive at the
   proxy for example.com.  There are no caller preferences in the
   request.  However, per Section 7.2.2 of [3], the proxy will construct
   an implicit require-flagged Accept-Contact preference that looks
   like:

      (& (sip.methods="INVITE"))

   Applying the matching algorithm of RFC 2533 [6] to this feature set
   and those registered by Y1 and Y2, the feature set of Y1 alone
   matches.  Because the Accept-Contact predicate has its require flag
   set, Y2 is discarded, and the INVITE is routed to Y1.

   If the request was MESSAGE, the proxy constructs an implicit Accept-
   Contact preference with its require flag set (require-flagged) that
   looks like:

      (& (sip.methods="MESSAGE"))

   which matches the feature set of Y2, but not Y1.  Thus, Y1 is
   discarded, and the request is routed to Y2.




Rosenberg & Kyzivat          Informational                      [Page 9]
^L
RFC 4596                Caller Preferences Uses                July 2006


3.2.  Single Contact Not Matching Implicit Preferences

3.2.1.  Desired Behavior

   AOR Y has a single contact, Y1.  It's a phone, and therefore supports
   the standard operations INVITE, ACK, OPTIONS, BYE, and CANCEL but
   does not support MESSAGE.  A caller X sends a MESSAGE request.  The
   desired behavior is that the request is still routed to the solitary
   contact so that it can generate a 405 response.

3.2.2.  Solution

   The single contact Y1 will generate a registration that looks like,
   in part:

      REGISTER sip:example.com SIP/2.0
      To: sip:Y@example.com
      Contact: <sip:Y1@pc.example.com>
        ;methods="INVITE,ACK,OPTIONS,BYE,CANCEL"
        ;uri-user="<Y1>"
        ;uri-domain="example.com"
        ;audio
        ;schemes="sip"
        ;mobility="fixed"
        ;class="personal"

   X sends a MESSAGE request.  There are no explicit caller preferences.
   This results in an implicit require-flagged Accept-Contact
   preference:

      (& (sip.methods="MESSAGE"))

   Since Y1 doesn't match and the Accept-Contact predicate is require-
   flagged, it is discarded.  However, according to section 7.2.4 of RFC
   3841, if there are no matching targets, the original target set is
   used.  Thus, the request is sent to the one original target, Y1, as
   desired.  Y1 then responds with a 405.

   If there were multiple contacts, and none of them matched the Accept-
   Contact predicate, then the original target set including all of the
   contacts would be restored.  Then all the contacts would be processed
   according to Section 16.6 of RFC 3261.









Rosenberg & Kyzivat          Informational                     [Page 10]
^L
RFC 4596                Caller Preferences Uses                July 2006


3.3.  Package-Based Routing

3.3.1.  Desired Behavior

   AOR Y has a number of contacts, Y1, Y2, ..., Yn, that can each
   support the standard operations INVITE, ACK, OPTIONS, BYE, and CANCEL
   and can also support SUBSCRIBE for the "dialog" event package [7].  Y
   also has another contact, Yp, that is a presence agent (PA) [8]: it
   can accept only SUBSCRIBE requests for the "presence" event package.
   The goal is for SUBSCRIBE requests for presence to be routed to Yp
   while INVITEs and SUBSCRIBEs for the dialog package are forked to
   Y1...Yn.

3.3.2.  Solution

   Y1..Yn will generate REGISTER requests that look like, in part:

      REGISTER sip:example.com SIP/2.0
      To: sip:Y@example.com
      Contact: <sip:Yi@pc.example.com>
        ;methods="INVITE,BYE,OPTIONS,ACK,CANCEL,SUBSCRIBE"
        ;events="dialog"
        ;uri-user="<Yi>"
        ;uri-domain="example.com"
        ;audio
        ;schemes="sip"
        ;mobility="fixed"
        ;class="personal"

   and Yp will generate a REGISTER request that looks like, in part:

      REGISTER sip:example.com SIP/2.0
      To: sip:Y@example.com
      Contact: <sip:Yp@pc.example.com>;methods="SUBSCRIBE"
        ;events="presence"
        ;uri-user="<Yp>"
        ;uri-domain="example.com"
        ;schemes="sip,pres"
        ;mobility="fixed"
        ;class="business"

   A SUBSCRIBE request for presence will arrive at the proxy for
   example.com.  Since there are no explicit preferences, it constructs
   an implicit require-flagged Accept-Contact preference from the
   request:

      (& (sip.methods="SUBSCRIBE") (sip.events="presence"))




Rosenberg & Kyzivat          Informational                     [Page 11]
^L
RFC 4596                Caller Preferences Uses                July 2006


   Following Section 7.2.4 of RFC 3841, this feature set only matches
   the one registered by Yp.  Because the require flag is set, the
   contacts which do not match are removed from the target set.
   Therefore, Y1..Yn are discarded.  The request is sent to the
   remaining contact, Yp, representing the PA.

   An INVITE request without explicit preferences results in an implicit
   require-flagged Accept-Contact preference:

      (& (sip.methods="INVITE"))

   The implicit Accept-Contact feature set matches Y1..Yn, but does not
   match Yp.  Using the scoring algorithm from Section 7.2.4 of RFC
   3841, the score for Y1..Yn against this predicate is 1.0.  As a
   result, the caller preference Qa for each contact is 1.0.  The
   registrations did not contain q-values, so the default q-value of 1.0
   is applied to each Contact URI.  Since the caller and callee
   preferences are the same and all equal to 1.0, there is no reordering
   of contacts.  The result is that the proxy will consider Y1..Yn each
   as equally good targets for the request and possibly fork the request
   to each.

   A SUBSCRIBE request for the dialog event package without explicit
   preferences will result in an implicit require-flagged Accept-Contact
   preference:

      (& (sip.methods="SUBSCRIBE") (sip.events="dialog"))

   This only matches Y1..Yn, so Yp is discarded, and the request is
   routed to the remaining contacts just as the INVITE was.

3.4.  Package Routing II

3.4.1.  Desired Behavior

   This case is nearly identical to that of Section 3.3.  However,
   Y1..Yn omit the "events" feature tag from their registration.  Yp
   registers as in Section 3.3.  A SUBSCRIBE for the presence event
   package should still preferentially route to Yp.












Rosenberg & Kyzivat          Informational                     [Page 12]
^L
RFC 4596                Caller Preferences Uses                July 2006


3.4.2.  Solution

   The registration from Y1..Yn will look like:

      REGISTER sip:example.com SIP/2.0
      To: sip:Y@example.com
      Contact: <sip:Yi@pc.example.com>
        ;methods="INVITE,BYE,OPTIONS,ACK,CANCEL,SUBSCRIBE"
        ;uri-user="<Yi>"
        ;uri-domain="example.com"
        ;audio
        ;schemes="sip"
        ;mobility="fixed"
        ;class="personal"

   When the caller sends a SUBSCRIBE for the presence event package
   (without explicit preferences), the proxy computes an implicit
   preference:

      (& (sip.methods="SUBSCRIBE") (sip.events="presence"))

   This predicate matches Y1..Yn and Yp.  However, the score for Y1..Yn
   against this predicate is 0.5, and the score of Yp is 1.0.  The
   result is a caller preference Qa of 0.5 for Y1..Yn, and a caller
   preference Qa of 1.0 for Yp.  Since the callee provided no q-values,
   the proxy will assume a default of 1.0.  Thus, all contacts are in
   the same equivalence class.  They are then sorted by Qa, so that Yp
   is first, followed by Y1 through Yn.  It will therefore route the
   request first to Yp, and if that should fail, to Y1..Yn.

3.5.  Audio/Video vs. Audio Only

3.5.1.  Desired Behavior

   X sends an invitation to Y to initiate an audio/video call, including
   both m=audio and m=video lines in the SDP.  AOR Y has two contacts,
   Y1 and Y2.  Y1 represents a normal audio phone, where Y prefers to
   receive their calls.  It will answer an audio/video call, refusing
   the video.  Y2 represents an audio/video phone that should only used
   when needed.  The caller really wants the call answered by a device
   that supports video, but will accept an audio-only call as a second
   choice.









Rosenberg & Kyzivat          Informational                     [Page 13]
^L
RFC 4596                Caller Preferences Uses                July 2006


3.5.2.  Solution

   Y1 will generate a registration that looks like, in part:

      REGISTER sip:example.com SIP/2.0
      To: sip:Y@example.com
      Contact: <sip:Y1@pc.example.com>;q=1.0
        ;methods="INVITE,BYE,OPTIONS,ACK,CANCEL"
        ;uri-user="<Y1>"
        ;uri-domain="example.com"
        ;audio
        ;schemes="sip,tel"
        ;mobility="fixed"
        ;class="business"

   Y2 will generate a registration that looks like, in part:

      REGISTER sip:example.com SIP/2.0
      To: sip:Y@example.com
      Contact: <sip:Y2@pc.example.com>;q=0.6
        ;methods="INVITE,BYE,OPTIONS,ACK,CANCEL"
        ;uri-user="<Y2>"
        ;uri-domain="example.com"
        ;audio
        ;video
        ;schemes="sip,tel"
        ;mobility="fixed"
        ;class="business"

   Note the different q-values, allowing Y2 to be selected as a device
   of "last resort".

   To have the call preferentially routed to a device that supports
   video, the caller X sends an INVITE that looks like, in part:

      INVITE sip:Y@example.com SIP/2.0
      Accept-Contact: *
        ;methods="INVITE"
        ;video

   The proxy will convert this to a feature set.  This feature set
   matches Y2 and Y1.  However, the score for Y2 is 1.0, and 0.5 for Y1.
   The two contacts are then ordered by q-value and broken into
   equivalence classes.  There are two equivalence classes, each with
   one contact.  As a result, the caller preference values have no
   impact on the ordering.  The call will first try the higher priority
   Y1, which will answer the call and reject the video stream.  Thus,
   the desired behavior is not achieved.



Rosenberg & Kyzivat          Informational                     [Page 14]
^L
RFC 4596                Caller Preferences Uses                July 2006


   The desired behavior could be achieved by adding the "explicit" and
   "require" tags to the Accept-Contact header field in the INVITE, as
   is done in Section 3.6.  However, doing so may result in calls
   failing when they could occur, but without video.  As discussed in
   [3], both the "require" and "explicit" tags are generally used only
   when the request cannot be serviced in any way unless the preferences
   are met.  That is not the case here.

3.6.  Forcing Audio/Video

3.6.1.  Desired Behavior

   This case is similar to that of Section 3.5.  However, X requires an
   audio/video call and would like the call to fail if this is not
   possible, rather than succeed with audio only.

3.6.2.  Solution

   The solution is similar to that of Section 3.5; however, the Accept-
   Contact header field now includes the "explicit" and "require" tags,
   guaranteeing that the call is never established to any UA that had
   not explicitly indicated support for video:

      INVITE sip:Y@example.com SIP/2.0
      Accept-Contact: *;video;require;explicit

   This arrives at the example.com proxy.  This explicit feature set
   matches the feature set for Y2 and Y1.  However, the match for Y1 did
   not have a score of 1.  Since the "explicit" and "require" tags are
   present, the contact is discarded.  That leaves Y2 only.  The call
   will therefore get routed to the videophone, and if the user is not
   there, the audio phone will never ring.

   Because both the "require" and "explicit" flags are present, a
   contact will also be discarded if it does not include a feature tag
   indicating support for video.  Thus, a UA that can do video, but
   neglected to indicate it, would not be reached in this case.  This is
   why it is important for a UA to indicate all of its capabilities.
   Note that this is only true for a contact that indicated some
   capabilities but not the video capability.  Contacts that don't
   indicate any capabilities are "immune" from caller preferences
   filtering and would not be discarded.









Rosenberg & Kyzivat          Informational                     [Page 15]
^L
RFC 4596                Caller Preferences Uses                July 2006


3.7.  Third-Party Call Control: Forcing Media

3.7.1.  Desired Behavior

   Z is a third-party call control controller (3pcc) [9] trying to
   establish an audio/video call from X to Y.  X has contacts X1 and X2,
   and Y has contacts Y1 and Y2.  X1 and X2 have capabilities identical
   to Y1 and Y2, respectively.  Z needs to send an offerless invite to X
   and use the offer proposed by X to send an invite to Y.  When sending
   the offerless invite to X, the 3pcc controller must ensure that an
   audio/video contact (X2) is chosen over an audio only contact (X1).

3.7.2.  Solution

   X1 will generate a registration that looks like, in part:

      REGISTER sip:example.com SIP/2.0
      To: sip:X@example.com
      Contact: <sip:X1@pc.example.com>;q=1.0
        ;methods="INVITE,BYE,OPTIONS,ACK,CANCEL"
        ;uri-user="<X1>"
        ;uri-domain="example.com"
        ;audio
        ;schemes="sip,tel"
        ;mobility="fixed"
        ;class="business"

   X2 will generate a registration that looks like, in part:

      REGISTER sip:example.com SIP/2.0
      To: sip:X@example.com
      Contact: <sip:X2@pc.example.com>;q=0.6
        ;methods="INVITE,BYE,OPTIONS,ACK,CANCEL"
        ;uri-user="<X2>"
        ;uri-domain="example.com"
        ;audio
        ;video
        ;schemes="sip,tel"
        ;mobility="fixed"
        ;class="business"

   Z would include, in its INVITE, an Accept-Contact header field:

      INVITE sip:X@example.com SIP/2.0
      Accept-Contact: *;audio;video;require;explicit






Rosenberg & Kyzivat          Informational                     [Page 16]
^L
RFC 4596                Caller Preferences Uses                July 2006


   This caller preference matches both X1 and X2.  However, it matches
   X1 with a score of .5 and X2 with a score of 1.  Because of the
   "require" and "explicit" tags, X1 is discarded despite X's preference
   for it.  Thus, the call is routed to X2.

   The same caveats apply here as do in Section 3.6.  Generally, it is
   not advisable to mandate support for features (such as video) that
   are not strictly necessary for the request to proceed.

3.8.  Maximizing Media Overlaps

3.8.1.  Desired Behavior

   AOR Y has two contacts: Y1, which is a regular audio phone, and Y2,
   which is a PC capable of supporting both audio and session-oriented
   IM [10].  X is a PC with capability to support audio, video, and
   session-oriented IM.  X calls Y for the purpose of establishing a
   voice call.  However, X wishes to connect to the device that has the
   maximal overlap with its media capabilities, in order to maximize the
   functionality available to the caller.

3.8.2.  Solution

   Y1 will generate a registration that looks like, in part:

      REGISTER sip:example.com SIP/2.0
      To: sip:Y@example.com
      Contact: <sip:Y1@phone.example.com>
        ;methods="INVITE,BYE,OPTIONS,ACK,CANCEL"
        ;uri-user="<Y1>"
        ;uri-domain="example.com"
        ;audio
        ;schemes="sip,tel"
        ;mobility="fixed"
        ;class="business"
















Rosenberg & Kyzivat          Informational                     [Page 17]
^L
RFC 4596                Caller Preferences Uses                July 2006


   Y2 will generate a registration that looks like, in part:

      REGISTER sip:example.com SIP/2.0
      To: sip:Y@example.com
      Contact: <sip:Y2@pc.example.com>
        ;methods="INVITE,BYE,OPTIONS,ACK,CANCEL,MESSAGE"
        ;uri-user="<Y2>"
        ;uri-domain="example.com"
        ;audio
        ;+sip.message
        ;schemes="sip,tel"
        ;mobility="fixed"
        ;class="business"

   The solution requires the caller to support caller preferences.  The
   caller would include, in their INVITE, an Accept-Contact header field
   that lists all the media types they support.  In this case:

      INVITE sip:Y@example.com SIP/2.0
      Accept-Contact: *;audio;video;+sip.message

   Both Y1 and Y2 match the predicate.  Y1 matches with a score of 0.33,
   and Y2 matches with a score of 0.66.  Since there is only one Accept-
   Contact predicate, the Qa for each contact is equal to the score.
   The registered contacts are then sorted by q-value and broken into
   equivalence classes.  There is a single equivalence class with
   q-value of 1.0.  The two contacts in that class are then re-ordered
   based on the values of Qa.  Y2 has a higher Qa, so it is used first,
   followed by Y1.  The result is that the call is routed to the device
   with the maximum overlap in media capabilities, as desired.

   Note that neither "require" nor "explicit" tags are used because
   there is no intent to exclude contacts, only to order them.

3.9.  Multilingual Lines

3.9.1.  Desired Behavior

   AOR Y represents a shared line in an office.  Several employees in
   the office have phones registered for Y.  Some of the employees speak
   only English, some speak Spanish fluently and have some limited
   capability for English, and some speak both English and Spanish
   fluently.  Calls from callers that speak only English should be
   parallel forked to all office workers that speak fluent English.  If
   the call isn't picked up, then the phones of workers that speak
   English marginally should be rung.  Calls from callers that speak
   only Spanish should be forked only to workers that speak Spanish.




Rosenberg & Kyzivat          Informational                     [Page 18]
^L
RFC 4596                Caller Preferences Uses                July 2006


3.9.2.  Solution

   A user at phone Y1 that speaks English only would generate a REGISTER
   that looks like, in part:

      REGISTER sip:example.com SIP/2.0
      To: sip:Y@example.com
      Contact: <sip:Y1@pc.example.com>;languages="en"

   A user at a phone Y2 that speaks Spanish and a little bit of English
   would generate a REGISTER that looks like, in part:

      REGISTER sip:example.com SIP/2.0
      To: sip:Y@example.com
      Contact: <sip:Y2-es@pc2.example.com>;languages="es"
      Contact: <sip:Y2-en@pc2.example.com>;languages="en";q=0.2

   Y2 has registered two contacts.  Both of them route to the same
   device (pc2.example.com), but they differ in their language support
   and relative q-values.  Multiple contacts are needed whenever a UA
   wishes to express differing preferences for being reached for
   different feature collections.

   A user at phone Y3 that speaks English and Spanish fluently would
   generate a REGISTER that looks like, in part:

      REGISTER sip:example.com SIP/2.0
      To: sip:Y@example.com
      Contact: <sip:Y3@pc3.example.com>;languages="es,en"

   Notice that only a single contact is needed because the same q-value
   is applied across all feature collections.

   For the language-based routing to occur, the caller must indicate its
   language preferences explicitly:

      INVITE sip:Y@example.com SIP/2.0
      Accept-Contact: *;languages="en";require

   The predicate derived from this looks like:

      (& (languages="en"))

   This matches the one contact for Y1, the second contact registered
   for Y2, and the one contact for Y3, all with a score of 1.0.  The
   first contact registered by Y2 does not match, and because of the
   "require" flag, is discarded.  The remaining contacts are sorted by
   q-value and divided into equivalence classes.  There are two



Rosenberg & Kyzivat          Informational                     [Page 19]
^L
RFC 4596                Caller Preferences Uses                July 2006


   equivalence classes.  The first contains Y1 and Y3 with a q-value of
   1.0, and the second contains Y2-en with a q-value of 0.2.  The
   contacts in the first class are ordered by Qa.  However, since all
   contacts have the same value of Qa (1.0), there is no change in
   ordering.  Thus, Y1 and Y3 are tried first, followed by Y2-en.  This
   is the desired behavior.

   An "explicit" tag is not used because that would cause the exclusion
   of a contact that does not mention language.

   A caller that speaks Spanish only would specify their preference
   thusly:

      INVITE sip:Y@example.com SIP/2.0
      Accept-Contact: *;languages="es";require

   This matches the first contact of Y2 phones, and Y3 phones, all with
   a score of 1.0.  The English contact of Y2, Y2-en, doesn't match and
   is discarded because of the "require" flag.  The remaining contacts
   are sorted by q-values (Y3, Y2-es) and broken into a single
   equivalence class containing both contacts.  Since the Qa for both
   contacts is the same (1.0) there is no reordering.  The result is
   that the call is routed to either Y3 or Y2-es.

3.10.  I Hate Voicemail!

3.10.1.  Desired Behavior

   AOR Y has two contacts, a phone Y1 and a voicemail service Y2.  X
   wishes to call Y and talk in person.  X does not want to be sent to
   voicemail under any circumstances.

3.10.2.  Solution

   The phone would register with a Contact that looks like, in part:

      REGISTER sip:example.com SIP/2.0
      To: sip:Y@example.com
      Contact: <sip:Y1@pc.example.com>
        ;audio
        ;mobility="fixed"










Rosenberg & Kyzivat          Informational                     [Page 20]
^L
RFC 4596                Caller Preferences Uses                July 2006


   and the voicemail server would register with a Contact that looks
   like, in part:

      REGISTER sip:example.com SIP/2.0
      To: sip:Y@example.com
      Contact: <sip:Y2@pc.example.com>
         ;msgserver
         ;automata
         ;attendant
         ;audio
         ;q=0.2

   The voicemail server registers with a lower q-value so that it is
   used only after the phone itself is rung.  Note that the voicemail
   server need not actually register.  There can be a configured contact
   and feature set defined for it instead.

   A caller that wishes to avoid voicemail can include an explicit
   preference to avoid it.  A caller would do this with the Reject-
   Contact header field:

      INVITE sip:Y@example.com SIP/2.0
      Reject-Contact: *;msgserver

   Since this feature set contains a feature tag that is not contained
   in the registration for Y1, the feature set is discarded when
   examining Y1.  However, the registration for Y2 contains all feature
   tags listed in the feature set, and so the rule is considered.  There
   is a match, and therefore, Y2 is discarded.  The result is that the
   user is never routed to voicemail.

3.11.  I Hate People!

3.11.1.  Desired Behavior

   The situation is similar to Section 3.10, except the caller wishes
   only to leave a message, not actually speak to the person.

3.11.2.  Solution

   The caller would send an INVITE that looks like, in part:

      INVITE sip:Y@example.com SIP/2.0
      Accept-Contact: *;msgserver;require;explicit

   This caller preference matches both Y1 and Y2.  Y1 matches, but with
   a score of zero.  Y2 matches with a score of 1.  Since both the




Rosenberg & Kyzivat          Informational                     [Page 21]
^L
RFC 4596                Caller Preferences Uses                July 2006


   "require" and "explicit" flags are set, Y1 is discarded.  Therefore,
   the call is routed to Y2, the voicemail server, as desired.

   Because of the presence of the "require" and "explicit" tags, if
   these preferences are used with a user that doesn't have voicemail or
   that fails to indicate it with a msgserver capability, the call will
   fail completely with a 480 Temporarily Unavailable error, rather than
   connect to the user.

3.12.  Prefer Voicemail

3.12.1.  Desired Behavior

   The situation is similar to that of Section 3.10.  However, the
   caller prefers to leave a message.  If voicemail is not available,
   they are willing to talk to a person.

3.12.2.  Solution

   It had been hoped that RFC 3841 could provide a solution for this
   case, but it does not, because doing so would require a re-ordering
   of the callee contacts, which is not done.  The caller may achieve
   the intended effect by making two call attempts:

   o  First, make an attempt requiring voicemail, as described in
      Section 3.11.

   o  If that fails with a 480 error, send an invitation with no Accept-
      Contact or Reject-Contact headers.

3.13.  Routing to an Executive

3.13.1.  Desired Behavior

   Y is the AOR of an executive.  It has three contacts.  Y1 is the
   phone on the executive's desk.  Y2 is the phone on the desk of the
   executive's assistant.  Y3 is the address of an auto-attendant system
   that can answer general questions, route calls to other parties, etc.
   By default, calls to Y should be directed to Y2, and if that fails,
   to Y3.  If Y3 doesn't answer, then Y1 should ring.

3.13.2.  Solution

   This is primarily a called party feature and is best accomplished
   with a CPL (Call Processing Language) script [5].  However, it can be
   accomplished with caller preferences alone by properly setting the
   q-values across the three devices.  Assuming this coordination is
   possible, here are the settings that would be made:



Rosenberg & Kyzivat          Informational                     [Page 22]
^L
RFC 4596                Caller Preferences Uses                July 2006


   Y1 would generate a REGISTER that looks like, in part:

      REGISTER sip:example.com SIP/2.0
      To: sip:Y@example.com
      Contact: <sip:Y1@pc.example.com>;q=0.1

   Y2 would generate a REGISTER that looks like, in part:

      REGISTER sip:example.com SIP/2.0
      To: sip:Y@example.com
      Contact: <sip:Y2@pc2.example.com>;attendant;q=1.0

   Y3 would generate a REGISTER that looks like, in part:

      REGISTER sip:example.com SIP/2.0
      To: sip:Y@example.com
      Contact: <sip:Y3@pc3.example.com>;attendant;automata;q=0.5

   Note that, in reality, the automated attendant would probably not use
   REGISTER.  Since the attendant would be used for every employee in
   the company, a static contact would probably be added
   administratively for each user in the enterprise.  However, the
   information in that static contact would be identical to the
   information in the registration above.

   When X makes a call to the executive, Y, and expresses no preference,
   the proxy computes an implicit preference to support INVITE.  All
   three contacts match such a preference, even though they have not
   indicated explicit support for INVITE.  Thus, no contacts are
   discarded.  Since each contact has a different q-value, the caller
   preferences do not cause any reordering.  The result is that the call
   is first routed to Y2, then Y3, then Y1, all as a result of the
   proper setting of the q-values.

3.14.  Speak to the Executive

3.14.1.  Desired Behavior

   This case is similar to that of Section 3.13, but this time the
   caller, X, has a preference.  X calls Y, but wants to speak directly
   to the executive.  X doesn't want the call to ring either the
   assistant or the auto attendant (automaton).









Rosenberg & Kyzivat          Informational                     [Page 23]
^L
RFC 4596                Caller Preferences Uses                July 2006


3.14.2.  Solution

   X's INVITE would look like, in part:

      INVITE sip:Y@example.com SIP/2.0
      Reject-Contact: *;attendant
      Reject-Contact: *;automata

   Note that the caller uses two separate Reject-Contact header field
   values, rather than a single one with two separate feature
   parameters.  The distinction is important.  If X had to use a single
   value with two parameters, a matching UA would need to declare that
   it was BOTH an attendant and an automaton.  If it only declared that
   it was one of these, based on the matching rules in the caller
   preferences specification, it would not be rejected.

   The above request would result in the elimination of both Y2 and Y3
   as contacts.  The call would then be routed to Y1, as desired.

   This case indicates why a CPL script, or some other programmed
   version of the feature, is preferable.  With caller preferences, a
   caller can override the desired ring sequence and disturb the
   executive without any kind of authorization.  A proper version of
   this service would simply not permit caller preferences to force the
   call to go directly to the executive.

3.15.  Mobile Phone Only

3.15.1.  Desired Behavior

   The situation is similar to that in Section 3.13.  However, the
   executive also has a mobile phone that they have registered.  Caller
   X knows that the owner of Y is traveling, and that an assistant is
   covering the office phone.  X wants to call Y and ring only the
   mobile phone.

3.15.2.  Solution

   The mobile phone would generate a registration that looks like, in
   part:

      REGISTER sip:example.com SIP/2.0
      To: sip:Y@example.com
      Contact: <sip:Y4@mobile.example.com>;mobility="mobile";q=0.1







Rosenberg & Kyzivat          Informational                     [Page 24]
^L
RFC 4596                Caller Preferences Uses                July 2006


   The caller would express their preference by generating an INVITE
   that looks like, in part:

      INVITE sip:Y@example.com SIP/2.0
      Accept-Contact: *;mobility="mobile";require;explicit

   All four contacts match.  However, Y1 through Y3 match with a score
   of zero.  Y4 matches with a score of 1.  Because of the "require" and
   "explicit" tags, Y1 through Y3 are discarded, and only Y4 is used, as
   desired.

   Note that this only works if the mobile phone specifies the mobility
   feature in its registration.

3.16.  Simultaneous Languages

3.16.1.  Desired Behavior

   AOR Y is as in Section 3.9.  Caller X, fluent in both English and
   Spanish, has discovered that the company's Spanish language
   documentation is inconsistent with the English language documentation
   and wants to discuss the differences between the two.  So X wants to
   speak with one of the workers that is fluent in both English and
   Spanish.

3.16.2.  Solution

   The caller would generate an INVITE that looks like, in part:

      INVITE sip:Y@example.com SIP/2.0
      Accept-Contact: *;language="en";require
      Accept-Contact: *;language="es";require

   This will require a Contact URI to match both constraints.  That
   means it needs to support English and Spanish.  This will achieve the
   desired property.

   Note that there are two separate Accept-Contact header fields.  If
   the caller had instead used this INVITE:

      INVITE sip:Y@example.com SIP/2.0
      Accept-Contact: *;language="en,es";require

   It would have connected them to a UA that speaks either English or
   Spanish, which is not what is desired here.

   An "explicit" option is not used, because it would bypass contacts
   that do not include a language tag.



Rosenberg & Kyzivat          Informational                     [Page 25]
^L
RFC 4596                Caller Preferences Uses                July 2006


3.17.  The Number You Have Called...

3.17.1.  Desired Behavior

   Consider once more the case of the executive, where the caller wishes
   to reach only their mobile phone (Section 3.15).  However, there is a
   twist.  The callee Y has moved to new address YY, and all the
   configuration described for the callee now applies to YY.  The old
   address Y remains with a pair of statically assigned contacts.  One
   contact is YY.  The other is M, referencing an automaton that
   generates a voice message reporting that the number has been changed.
   The caller is unaware of the move and calls Y, requesting to reach
   the mobile phone in exactly the same way they did in Section 3.15.
   The call should connect to the mobile.

3.17.2.  Solution

   There would be four registrations against YY:

   YY1, the executive, would generate a REGISTER that looks like, in
   part:

      REGISTER sip:example.com SIP/2.0
      To: sip:YY@example.com
      Contact: <sip:YY1@pc.example.com>;q=0.1

   YY2, the attendant, would generate a REGISTER that looks like, in
   part:

      REGISTER sip:example.com SIP/2.0
      To: sip:YY@example.com
      Contact: <sip:YY2@pc2.example.com>;attendant;q=1.0

   YY3, the answering service, would generate a REGISTER that looks
   like, in part:

      REGISTER sip:example.com SIP/2.0
      To: sip:YY@example.com
      Contact: <sip:YY3@pc3.example.com>;attendant;automata;q=0.5

   YY4, the mobile, would generate a REGISTER that looks like, in part:

      REGISTER sip:example.com SIP/2.0
      To: sip:YY@example.com
      Contact: <sip:YY4@mobile.example.com>;mobility="mobile";q=0.5






Rosenberg & Kyzivat          Informational                     [Page 26]
^L
RFC 4596                Caller Preferences Uses                July 2006


   Although it would be configured administratively, there are two
   registered contacts for Y.  The first is for the forwarding:

      REGISTER sip:example.com SIP/2.0
      To: sip:Y@example.com
      Contact: <sip:YY@example.com>;q=1.0

   and the second for the automated answering service:

      REGISTER sip:example.com SIP/2.0
      To: sip:Y@example.com
      Contact: <sip:machine@example.com>;automata;q=0.5

   The caller, not knowing that Y has moved, calls Y and asks for their
   mobile phone:

      INVITE sip:Y@example.com SIP/2.0
      Accept-Contact: *;mobility="mobile";require;explicit

   This reaches the example.com proxy, which finds two registrations.
   Only one of these (the automaton) is associated with feature
   parameters.  The other has no feature parameters and is therefore
   immune to caller preferences processing.  The caller preferences are
   applied to the automaton's contact.  The feature sets match, but have
   a score of zero.  Since the "require" and "explicit" tags are
   present, the contact for the automaton is dropped.  The other
   contact, YY@example.com, is then added back in as the sole contact.
   The proxy therefore sends the call to sip:YY@example.com.  There,
   there are four registrations, all of which are associated with
   feature parameters.  The caller preferences are applied.  Only YY4
   matches explicitly, however.  Because of the presence of the
   "require" and "explicit" flags, all other contacts are dropped.  As
   such, the call is forwarded to YY4, and the mobile phone rings.

3.18.  The Number You Have Called, Take Two

3.18.1.  Desired Behavior

   This use case is nearly identical to that of Section 3.17.  However,
   this time, the caller wishes to contact the personal phone of Y.
   They don't feel strongly about it, and will accept other devices.

3.18.2.  Solution

   The INVITE generated by the caller in this case will look like:

      INVITE sip:Y@example.com SIP/2.0
      Accept-Contact: *;class="personal"



Rosenberg & Kyzivat          Informational                     [Page 27]
^L
RFC 4596                Caller Preferences Uses                July 2006


   This reaches the example.com proxy.  Once more, the first
   registration (which forwards to the address-of-record for YY) is
   unaffected by the caller preferences computation.  The other contact,
   for the automaton, is a match, but its score is zero.  Its caller
   preference Qa equals zero.  The other contact is added back in with a
   Qa of 1.0.  The contacts are sorted based on q-value, resulting in YY
   (q=1.0) followed by machine (q=0.5).  These are broken into
   equivalence classes.  There are two classes, one for each contact.
   As a result, the caller's preferences have no impact on the ordering,
   and the call is routed to YY.

   When the request for YY@example.com is processed, all four contacts
   match.  However, the score for all of them is zero (none are the
   personal phone).  As such, the contacts are ordered based on q-value.
   Each contact has a different q-value, so no reordering based on
   caller preference is possible (not that the caller preference would
   cause a reordering; all contacts have a Qa of 0.0).  Thus, the
   highest q-value contact is tried, which is the executive assistant.

3.19.  Forwarding to a Colleague

3.19.1.  Desired Behavior

   Alice wants to forward her phone to Bob, but doesn't want folks
   calling her to get Bob's voicemail if he doesn't answer.  She wants
   her callers to get her voicemail.

3.19.2.  Solution

   Alice would create three registrations.  The first, Y1, represents
   Alice's phone.  The second is Bob's AOR.  The third is a voicemail
   server.  The three contacts have decreasing q-values.  The
   registration for Bob's AOR contains an embedded Reject-Contact header
   field, which rejects message servers.

      REGISTER sip:example.com
      To: <sip:alice@example.com>
      Contact: <sip:Y1@192.0.2.150>;q=1.0

      REGISTER sip:example.com
      To: <sip:alice@example.com>
      Contact: <sip:bob@example.com?Reject-Contact=*;msgserver>;q=0.3









Rosenberg & Kyzivat          Informational                     [Page 28]
^L
RFC 4596                Caller Preferences Uses                July 2006


      REGISTER sip:example.com
      To: <sip:alice@example.com>
      Contact: <sip:alice-drop@msgcenter.example.com>
        ;msgserver;
        ;automata
        ;attendant
        ;q=0.1

   Meanwhile, Bob is registered as follows:

      REGISTER sip:example.com
      To: <sip:bob@example.com>
      Contact: <sip:bob3@192.0.2.212>;q=0.8

      REGISTER sip:example.com
      To: <sip:bob@example.com>
      Contact: <sip:bob-drop@msgcenter.example.com>
        ;msgserver
        ;automata
        ;attendant
        ;q=0.2

   Carol calls Alice and doesn't include any caller preference
   parameters.  As such, the example.com proxy constructs an implicit
   preference for INVITE.  This preference matches all three registered
   contacts, with a score of zero.  Because each contact has a different
   q-value, there is no reordering of contacts.  So, the proxy tries the
   highest q-value Contact, Alice's desk phone (Y1).  The proxy cancels
   after a few seconds (no answer).  The proxy then tries the next
   Contact, which is Bob's AOR.  When constructing the request for this
   Contact, the proxy includes the embedded Reject-Contact header field
   in the INVITE.  This INVITE undergoes caller preferences processing
   based on Bob's registered Contacts.

   Bob has two registered Contacts.  The second is a message server, and
   it matches the Reject-Contact in the INVITE.  Thus, this contact is
   discarded.  The other remaining Contact, Bob's phone, is tried.  Bob
   is not around, so his phone rings for a while.  Upon timeout, the
   proxy determines it is unable to reach Bob's AOR.  So, the proxy
   handling Alice tries the final remaining contact, which is Alice's
   message server.










Rosenberg & Kyzivat          Informational                     [Page 29]
^L
RFC 4596                Caller Preferences Uses                July 2006


4.  Capability Use Cases

   The callee capabilities spec [2] allows the Contact header field in
   OPTIONS responses and dialog initiating messages to contain
   capabilities of the UA.  These capabilities can be very useful for
   developing new applications.  In the subsections below, several
   usages are outlined.

4.1.  Web Redirect

   A caller sends an INVITE to the called party.  However, the called
   party is not present.  The proxy server representing the called party
   would like to redirect the caller to a web page, where they can find
   out more information on how to reach the called party.  However, the
   proxy needs to know whether or not the caller supports redirects to
   web pages.  If it doesn't, the proxy would connect the user to an
   interactive voice response (IVR) device, which would execute an
   answering machine application.

   The proxy could make such a determination if the caller included the
   "schemes" feature tag in the Contact header field of its INVITE:

      INVITE sip:callee@example.com SIP/2.0
      Contact: <sip:host22.example.com>;schemes="http,sip,sips,tel"

   This tells the proxy that the UAC can be redirected to an http URI.
   The INVITE from a normal "black phone" that lacked this capability
   would look like:

      INVITE sip:callee@example.com SIP/2.0
      Contact: <sip:host22.example.com>;schemes="sip,sips,tel"

   This indicates that it needs to be connected to the IVR.

4.2.  Voicemail Icon

   On the circuit network, when a user makes a call, and an answering
   machine picks up, the caller usually requires several seconds to
   determine that they are speaking to an answering machine.  It would
   be helpful if a phone could display an icon immediately on call
   completion that indicated that an answering machine was reached.

   This indication can be provided by the "msgserver" feature parameter.
   When the answering machine picks up, its 200 OK looks like, in part:

      SIP/2.0 200 OK
      Contact: <sip:server33.example.com>;msgserver;automata;attendant




Rosenberg & Kyzivat          Informational                     [Page 30]
^L
RFC 4596                Caller Preferences Uses                July 2006


   This tells the caller that it's an answering machine.

5.  Usage of the Feature Tags

   The caller preferences extension briefly enumerates a list of media
   feature tags that can be registered by a device and included in the
   Accept-Contact and Reject-Contact header fields in a request.  Proper
   operation of caller preferences depends strongly on consistent
   interpretation of these feature tags by the caller and the callee.
   In this section, we provide some guidelines on the usage of these
   feature tags.

   Generally speaking, the more information a device provides when it
   registers, the more effective the caller preferences extension is.
   This is why the callee capabilities extension recommends that a
   device register as much information as it can.  This point cannot be
   overstated.

   If devices explicitly registered features that they don't support,
   such as 'video="false"', the operation of RFC 3841 would be improved.
   However, given the open-ended nature of capabilities, it will never
   be possible to ensure the registration of negative values for all
   capabilities of interest to a caller.  Furthermore, attempting to do
   so would significantly bloat registrations.  Instead, it is
   recommended that all "unusual" capabilities be explicitly registered.

   The subsections below show example registrations from typical
   devices.

5.1.  Traditional Cell Phone

   A VoIP cell phone capable of making voice calls would generate a
   registration that looks like, in part:

      REGISTER sip:example.com SIP/2.0
      To: sip:user@example.com
      Contact: <sip:cell-phone@example.com>
        ;audio
        ;class="business"
        ;duplex="full"
        ;+sip.extensions="100rel,path"
        ;mobility="mobile"
        ;methods="INVITE,BYE,OPTIONS,CANCEL,ACK"
        ;schemes="sip,sips,tel"
        ;uri-user="<cell-phone>"
        ;uri-domain="example.com"





Rosenberg & Kyzivat          Informational                     [Page 31]
^L
RFC 4596                Caller Preferences Uses                July 2006


5.2.  Traditional Work Phone

   A traditional landline IP PBX phone would generate a registration
   that looks like:

      REGISTER sip:example.com SIP/2.0
      To: sip:user@example.com
      Contact: <sip:ippbx-phone@example.com>
        ;audio
        ;class="business"
        ;duplex="full"
        ;events="dialog"
        ;+sip.extensions="100rel,privacy"
        ;mobility="fixed"
        ;methods="INVITE,BYE,OPTIONS,CANCEL,ACK,SUBSCRIBE"
        ;schemes="sip,sips,tel"
        ;uri-user="<ippbx-phone>"
        ;uri-domain="example.com"

   This device also supports the dialog event package and several SIP
   extensions that would be typical in an IP PBX phone.

5.3.  PC Messaging Application

   A PC messenger client, capable of just doing presence and IM (no
   voice) would generate a registration that looks like:

      REGISTER sip:example.com SIP/2.0
      To: sip:user@example.com
      Contact: <sip:pc-msgr@example.com>
        ;class="personal"
        ;mobility="fixed"
        ;methods="OPTIONS,MESSAGE,NOTIFY"
        ;schemes="sip,sips,im,pres"
        ;uri-user="<pc-msgr>"
        ;uri-domain="example.com"















Rosenberg & Kyzivat          Informational                     [Page 32]
^L
RFC 4596                Caller Preferences Uses                July 2006


5.4.  Standalone Videophone

   A standalone IP videophone, capable of audio and video, would
   generate a registration that looks like, in part

      REGISTER sip:example.com SIP/2.0
      To: sip:user@example.com
      Contact: <sip:vp@example.com>
        ;audio
        ;video
        ;class="business"
        ;duplex="full"
        ;mobility="fixed"
        ;methods="INVITE,BYE,OPTIONS,CANCEL,ACK"
        ;schemes="sip,sips,tel"
        ;uri-user="<vp>"
        ;uri-domain="example.com"

6.  Example of Implementation of Preference and Capability Matching

   RFC 3841 [3] utilizes the definitions and feature matching algorithm
   defined in RFC 2533 [6].  This provides a precise normative
   specification of the algorithm.  However, that specification isn't
   ideal as a guideline for implementation because it is more complex
   than is required for the restricted use employed by RFC 3841.  (The
   simplification is primarily because a particular feature tag may only
   appear once in each Contact, Accept-Contact, or Reject-Contact
   header.)

   This section provides a sample approach to implementing the matching
   of caller preferences to callee capabilities; it does not require the
   use of the notation and techniques of RFC 2533.  It is not normative,
   but is believed to be consistent with that definition.  It may be
   considered an alternative for that portion of RFC 3841 beginning with
   Section 7.2.3 and extending to the end of page 13 in the middle of
   Section 7.2.4.

   In this section, there are frequent references to syntactic elements
   defined by ABNF in RFC 3840, Section 9, and RFC 3841, Section 10.
   Here, ABNF elements are enclosed to single quotes -- for example,
   'feature-param'.  Such a reference identifies a sequence of octets
   within a SIP request that match the corresponding ABNF element when
   the sip request is parsed according to RFCs 3261, 3840, and 3841.








Rosenberg & Kyzivat          Informational                     [Page 33]
^L
RFC 4596                Caller Preferences Uses                July 2006


6.1.  Extracting a Feature Set from a Header

   Contact header fields, Accept-Contact header fields, and Reject-
   Contact header fields each contain zero or more 'feature-param's,
   each in turn may contain one or more 'tag-value's, or a 'string-
   value'.  The first step is to extract from each header field a more
   useful representation as a feature set, herein called an FS.  (This
   FS representation of a feature set representation differs from that
   in RFC 2533.)  This process is the same for each type of header.

   An FS consists of a set of one or more feature params denoted by FP.
   Each FP has a name, denoted FP.NAME, and a set of one or more value
   ranges denoted by VR.  Each VR consists of:

   o  A type (VR.TYPE): either token (TOKEN-TYPE), string (STRING-TYPE),
      or number-range (RANGE-TYPE)

   o  A negation flag (VR.NEGATION): either NEGATED, or NON-NEGATED

   o  The actual value, differing by type:

      *  For TOKEN-TYPE and STRING-TYPE, a sequence of octets
         (VR.OCTETS)

      *  For RANGE-TYPE, a pair of signed real numbers (VR.LB and VR.UB)
         representing the lower and upper bounds on the range,
         inclusive.

   A single FS is created to represent the features of one header.
   (Contact, Accept-Contact, Reject-Contact.)  Within the FS, an FP is
   created for each 'feature-param' in the header.  To create an FP, a
   'feature-param' is examined as follows:

   o  If the 'feature-param' contains an instance of 'other-tags', then
      FP.NAME is the value matched by 'ftag-name'.

   o  Otherwise, the 'feature-param' contains an instance of 'base-
      tags'.  If the value matched by 'base-tags' is "language" or
      "type", then FP.NAME is just the value matched by 'base-tags'.  If
      not, then FP.NAME is the value matched by 'base-tags' and prefixed
      with "sip.".

   o  The value of the 'feature-param', if any, is processed (according
      to the rules in the next section) to extract a set of one or more
      VRs that are associated with the FP.






Rosenberg & Kyzivat          Informational                     [Page 34]
^L
RFC 4596                Caller Preferences Uses                July 2006


6.2.  Extracting Values from a Feature Parameter

   The value of a 'feature-param' is an encoded representation (as
   specified in RFC 3840) of one or more value ranges of the
   corresponding feature.  There are several data types that these
   values may take on: boolean, token, string, number, or numeric range.
   The type is determined by the encoded form of the value.  (These
   types and their representations are specific to this implementation.)

   (Note: numeric values can explicitly represent a range of values.
   The other types only represent single value: a degenerate range.  The
   term value range is used to encompass all of these.)

   The value of the 'feature-param' ('string-value', 'tag-value-list',
   or none) is converted to VR form as follows:

   o  If there is no value, then a single new VR is created with VR.TYPE
      = TOKEN-TYPE, VR.NEGATION = NON-NEGATED, and VR.OCTETS set to
      "true".

   o  If the 'feature-param' contains a 'string-value', then a single
      new VR is created with VR.TYPE = STRING-TYPE, VR.NEGATION =
      NON-NEGATED, and VR.OCTETS is set to the octets matching 'qdtext'.

   o  Otherwise the 'feature-param' contains a 'tag-value-list', and a
      new VR is created for each 'tag-value' in the 'tag-value-list', as
      follows:

   o  If the 'tag-value' begins with "!", VR.NEGATION = NEGATED;
      otherwise, VR.NEGATION = NON-NEGATED.

   o  If the 'tag-value' contains a 'boolean' or 'token-nobang', then
      VR.TYPE = TOKEN-TYPE, and VR.OCTETS is set to the octets matched
      by 'boolean' or 'token-nobang'.

   o  If the 'tag-value' contains a 'numeric', VR.TYPE = RANGE-TYPE and:

      *  If 'numeric-relation' is "<=", VR.UB is set to the numeric
         value matching 'number'.  VR.LB is set to MIN-REAL (a negative
         number with the largest expressible magnitude.)

      *  If 'numeric-relation' is "=", both VR.LB and VR.UB are set to
         the numeric value matching 'number'.

      *  If 'numeric-relation' is ">=", VR.LB is set to the numeric
         value matching 'number' plus a small epsilon.  VR.UB is set to
         MAX-REAL (a positive number with the largest expressible
         magnitude).



Rosenberg & Kyzivat          Informational                     [Page 35]
^L
RFC 4596                Caller Preferences Uses                July 2006


      *  Else the 'numeric-relation' consists of two 'number's separated
         by a colon.  In this case, VR.LB is set to the numeric value of
         the smaller of the two numbers, and VR.UB is set to the numeric
         value of the larger of the two numbers.

6.3.  Comparing Two Value-Ranges

   Two VRs match if their ranges overlap.  The comparison is done
   according to type, and only comparisons between like types are
   defined.  When two VRs of differing types are compared, they are
   considered not to overlap.  Either or both of the VRs may be NEGATED.
   Comparison proceeds as follows:

   o  If the VRs are of different types, the match is false.

   o  Otherwise:

      *  Two VRs with VR.TYPE = RANGE-TYPE match if max(VR1.LB, VR2.LB)
         <= min(VR1.UB, VR2.UB).

      *  Two VRs with VR.TYPE = TOKEN-TYPE match if their respective
         VR.OCTETS values compare equal by case-insensitive comparison.

      *  Two VRs with VR.TYPE = STRING-TYPE match if their respective
         VR.OCTETS values compare equal by case-sensitive comparison.

   o  The result (true/false) is then negated if VR1.NEGATION = NEGATED,
      and negated again if VR2.NEGATION = NEGATED.

6.4.  Feature Set to Feature Set Matching

   In RFC 2533, the matching of two feature sets is commutative, but as
   applied to caller preferences matching it is not.  In this
   application, one feature set comes from an Accept-Contact or Reject-
   Contact header, and the other comes from a Contact header.  For
   purposes of this description, these will be termed the preferred-
   features (FSp) and the capability-features (FSc), respectively.
   Non-commutativity arises from explicit tests for the presence among
   capability-params of feature param names used in preferred-features.

   A preferred-features feature set FSp may be matched to one
   capability-features feature set FSc, and this yields the following
   metrics:

   o  NPF - The number of preferred-features.

   o  NCF - The number of preferred-features for which there is a
      capability-feature of the same name.



Rosenberg & Kyzivat          Informational                     [Page 36]
^L
RFC 4596                Caller Preferences Uses                July 2006


   o  NVM - The number of value matches between corresponding features
      of the two feature sets.

   For a particular pair of FPp and FPc, these metrics are computed as
   follows:

   o  All the metrics are set to zero.

   o  The following steps are applied for each feature param (FPp) of
      the FSp:

      *  NPF is incremented.

      *  A corresponding FP with the same name is sought (using case-
         insensitive comparison) in the FSc.

      *  If a corresponding feature param (FPc) is found:

         +  NCF is incremented.

         +  Every VR of FPp is matched to every VR of FPc.

         +  If any of those matches succeed, NVM is incremented.

6.5.  Selecting and Ordering Contacts Based on Caller Preferences

6.5.1.  Reject-Contact Processing

   The reject processing specified in Section 7.4.2 of RFC 3841 may be
   performed as follows:

   o  For each candidate Contact in the target set, match the feature
      set of each Reject-Contact to it.

   o  If (NVM == NPF) & (NCF == NPF), remove the contact URI from the
      target set.

6.5.2.  Accept-Contact Processing

   The matching of an Accept-Contact against a Contact and subsequent
   scoring of the match specified in Section 7.4.2 of RFC 3841 may be
   performed as follows:

   o  Match the feature set of the Accept-Contact to that of the Contact
      as specified in Section 6.4.






Rosenberg & Kyzivat          Informational                     [Page 37]
^L
RFC 4596                Caller Preferences Uses                July 2006


   o  If (NVM < NCF), then the match failed.  If the Accept-Contact had
      its "require" flag set, then discard the corresponding contact URI
      from the target set.

   o  Compute the score as NVM/NPF.

   o  Apply the "require" and "explicit" flags as specified in the text
      and Figure 7 of RFC 3841.

7.  Security Considerations

   This document provides explanation and examples of the use and
   implementation of RFCs 3840 and 3841.  The security considerations
   sections of those documents apply to the material presented here.

8.  Acknowledgements

   The authors would like to thank Rohan Mahy for his input in this
   specification.

9.  Informative References

   [1]   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.

   [2]   Rosenberg, J., Schulzrinne, H., and P. Kyzivat, "Indicating
         User Agent Capabilities in the Session Initiation Protocol
         (SIP)", RFC 3840, August 2004.

   [3]   Rosenberg, J., Schulzrinne, H., and P. Kyzivat, "Caller
         Preferences for the Session Initiation Protocol (SIP)",
         RFC 3841, August 2004.

   [4]   Mankin, A., Bradner, S., Mahy, R., Willis, D., Ott, J., and B.
         Rosen, "Change Process for the Session Initiation Protocol
         (SIP)", BCP 67, RFC 3427, December 2002.

   [5]   Lennox, J. and H. Schulzrinne, "Call Processing Language
         Framework and Requirements", RFC 2824, May 2000.

   [6]   Klyne, G., "A Syntax for Describing Media Feature Sets",
         RFC 2533, March 1999.

   [7]   Rosenberg, J., Schulzrinne, H., and R. Mahy, "An INVITE-
         Initiated Dialog Event Package for the Session Initiation
         Protocol (SIP)", RFC 4235, November 2005.




Rosenberg & Kyzivat          Informational                     [Page 38]
^L
RFC 4596                Caller Preferences Uses                July 2006


   [8]   Rosenberg, J., "A Presence Event Package for the Session
         Initiation Protocol (SIP)", RFC 3856, August 2004.

   [9]   Rosenberg, J., Peterson, J., Schulzrinne, H., and G. Camarillo,
         "Best Current Practices for Third Party Call Control (3pcc) in
         the Session Initiation Protocol (SIP)", BCP 85, RFC 3725,
         April 2004.

   [10]  Campbell, B., "The Message Session Relay Protocol", Work in
         Progress, July 2006.

Authors' Addresses

   Jonathan Rosenberg
   Cisco Systems
   600 Lanidex Plaza
   Parsippany, NJ  07054
   US

   Phone: +1 973 952-5000
   EMail: jdrosen@cisco.com
   URI:   http://www.jdrosen.net


   Paul Kyzivat
   Cisco Systems
   1414 Massachusetts Avenue
   Boxborough, MA  01719
   US

   Phone: +1 978 936-1881
   EMail: pkyzivat@cisco.com



















Rosenberg & Kyzivat          Informational                     [Page 39]
^L
RFC 4596                Caller Preferences Uses                July 2006


Full Copyright Statement

   Copyright (C) The Internet Society (2006).

   This document is subject to the rights, licenses and restrictions
   contained in BCP 78, and except as set forth therein, the authors
   retain all their rights.

   This document and the information contained herein are provided on an
   "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
   OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
   ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
   INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
   INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

Intellectual Property

   The IETF takes no position regarding the validity or scope of any
   Intellectual Property Rights or other rights that might be claimed to
   pertain to the implementation or use of the technology described in
   this document or the extent to which any license under such rights
   might or might not be available; nor does it represent that it has
   made any independent effort to identify any such rights.  Information
   on the procedures with respect to rights in RFC documents can be
   found in BCP 78 and BCP 79.

   Copies of IPR disclosures made to the IETF Secretariat and any
   assurances of licenses to be made available, or the result of an
   attempt made to obtain a general license or permission for the use of
   such proprietary rights by implementers or users of this
   specification can be obtained from the IETF on-line IPR repository at
   http://www.ietf.org/ipr.

   The IETF invites any interested party to bring to its attention any
   copyrights, patents or patent applications, or other proprietary
   rights that may cover technology that may be required to implement
   this standard.  Please address the information to the IETF at
   ietf-ipr@ietf.org.

Acknowledgement

   Funding for the RFC Editor function is provided by the IETF
   Administrative Support Activity (IASA).







Rosenberg & Kyzivat          Informational                     [Page 40]
^L