5.4. Appearance Agent
An Appearance Agent defined in this specification MUST implement a dialog package state agent for the UAs registered against the AOR. The Appearance Agent MUST support the appearance dialog package extensions defined in Section 5.2 and use the 'shared' Event header field parameter. The Appearance Agent MUST support publications and subscriptions for this event package.
The Appearance Agent MUST have a way of discovering the state of all dialogs associated with the AOR. If this information is not available from a call stateful proxy or Back-to-Back User Agent (B2BUA), the Appearance Agent can use the registration event package [RFC3680] to learn of UAs associated with the AOR and subscribe to their dialog event state. An Appearance Agent can also subscribe to a UA's dialog event state in order to reconstruct state. As a result, the registrar MUST support the registration event package.
Dialog package notifications are recommended by RFC 4235 to "only contain information on the dialogs whose state or participation information has changed." This specification extends RFC 4235 as follows. The Appearance Agent SHOULD send dialog event state notifications whenever the following events happen to UAs in the AOR group:
-
A call is received, placed, answered, or terminated.
-
A call is placed on or off hold.
-
A call is joined or replaced.
-
An appearance number is reserved or released.
The Appearance Agent MUST allocate an appearance number for all incoming calls and send immediate notifications to the UAs subscribed to the shared group AOR. A new appearance number is allocated except when a call replaces another call, in which case the appearance number of the replaced call is used.
The Appearance Agent MUST assign an appearance number to outgoing calls either when the request is published or when an INVITE is sent without prior publication. When a UA publishes an attempt to seize an appearance for an outgoing call or when a UA publishes a consultation call (i.e., the publication does not contain an appearance number), the Appearance Agent reserves the appearance number for that UA. If the reserved appearance number is not used within a time period (recommended value: 30 seconds), the Appearance Agent frees up the appearance number so that it can be allocated to another UA.
If an incoming call arrives for a group and there are no available appearance numbers, the incoming call will still be forked to all subscribed UAs but will not have an appearance number included in the notification. Also, the call will not have an appearance parameter in the Alert-Info header field when it arrives at a UA. If all subscribed UAs in the group reject the incoming call, normal call treatment occurs (likely forwarding to voice mail or another AOR).
The allocation of appearance numbers is managed by the Appearance Agent; this is not directly observable by UAs. However, UAs subscribing to the shared group AOR will be notified whenever an appearance number is allocated or freed by the Appearance Agent.
The Appearance Agent is responsible for assigning appearance numbers to new dialogs created by UAs and for resolving appearance number contention. Contention can occur when two UAs simultaneously attempt to seize the same appearance number. The Appearance Agent detects contention by receiving publications from UAs with the same appearance number within a short period of time. When contention is detected, the Appearance Agent MUST select only one of the UAs to be assigned the appearance number. The other UAs will receive an error response to their publication. The criteria for selecting which UA wins the contention is an Appearance Agent policy decision. One approach is to select the first publication that arrived. The Appearance Agent can determine which publication arrived first by looking at the SIP timestamps in Via header fields or based on other local processing timestamps.