SIP Presence

Asterisk provides the ability for devices to subscribe to extension state using the SIP protocol. This functionality is often referred to as BLF (Busy Lamp Field).[131]

Asterisk Configuration

To get this working, hints must be defined in /etc/asterisk/extensions.conf (see the section called “Hints” for more information on configuring hints in the dialplan). Additionally, there are some important options that must be set in the configuration file for the SIP channel driver, which is /etc/asterisk/sip.conf. The following list discusses these options:

callcounter

Enables/disables call counters. This must be enabled for Asterisk to be able to provide state information for SIP devices. This option may be set either in the [general] section or in peer-specific sections of sip.conf.

Tip

If you would like device states to work for SIP devices, you must at least set the callcounter option to yes. Otherwise, the SIP channel driver will not bother tracking calls to and from devices and will provide no state information about them.

busylevel

Sets the number of calls that must be in progress for Asterisk to report that a device is busy. This option may only be set in peer-specific sections of sip.conf. By default, this option is not set. This means that Asterisk will report that a device is in use, but never busy.

call-limit

This option has been deprecated in favor of using the GROUP() and GROUP_COUNT() functions in the Asterisk dialplan. You may find older documentation that suggests that this option is required for SIP presence to work. That used to be the case, but this option has been replaced by the callcounter option for that purpose.

allowsubscribe

Allows you to disable support for subscriptions. If this option has not been set, subscriptions will be enabled. To disable subscription support completely, set allowsubscribe to no in the [general] section of sip.conf.

subscribecontext

Allows you to set a specific context for subscriptions. Without this set, the context defined by the context option will be used. This option may be set either in the [general] section or in peer-specific sections of sip.conf.

notifyringing

Controls whether or not a notification will be sent when an extension goes into a ringing state. This option is set to yes by default. It only has an effect on subscriptions that use the dialog-info event package. This option can only be set globally in the [general] section of sip.conf.

notifyhold

Allows chan_sip to set SIP devices’ states to ONHOLD. This is set to yes by default. This option can only be set globally in the [general] section of sip.conf.

notifycid

Enables/disables sending of an inbound call’s caller ID information to an extension. This option applies to devices that subscribe to dialog-info+xml-based extension state notifications, such as Snom phones. Displaying caller ID information can be useful to help an agent decide whether to execute a pickup on an incoming call. This option is set to no by default.

Note

This magic pickup only works if the extension and context of the hint are the same as the extension and context of the incoming call. Notably, the usage of the subscribecontext option usually breaks this option. This option can also be set to the value ignore-context. This will bypass the context issue, but should only be used in an environment where there is only a single instance of the extension that has been subscribed to. Otherwise, you might accidentally pick up calls that you did not mean to pick up.



[131] Some also like to call these “blinky lamps” or “blinky lights” for their phones. Geeks and their LEDs…