Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Addressed Kevin's review feedback.
Section
Column
Warning

Under Construction - This page is a stub!

Overview

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vel odio ullamcorper, laoreet odio non, tempus orci. Vivamus consectetur risus sit amet augue euismod interdum. Duis consequat rhoncus mi, eu sodales tellus imperdiet non. Duis tempor venenatis nunc in lacinia. Vivamus a blandit elit, id dapibus nibh. Aliquam suscipit nibh in metus sodales, ac ultrices odio sodales.

First Heading

Nullam pulvinar, metus non auctor mollis, sem purus aliquet libero, sit amet ullamcorper tellus tellus id orci. Phasellus auctor at risus eget interdum. Suspendisse potenti. Duis dolor dolor, aliquam non aliquet eget, aliquam ut enim. Donec fringilla cursus dolor et facilisis. Vestibulum vulputate euismod rhoncus. Suspendisse ut lacinia orci, ac accumsan diam. Suspendisse eu dignissim tellus.

  • item 1
  • item 2
  • item 3

Capabilities

Asterisk's PJSIP channel driver provides the same presence subscription capabilities as chan_sip does. This means that RFC 3856 presence and RFC 4235 dialog info are supported. Presence subscriptions support RFC 3863 PIDF+XML bodies as well as XPIDF+XML. Beyond that, Asterisk also supports subscribing to RFC 4662 lists of presence resources.

Configuration

If you are familiar with configuring subscriptions in chan_sip then this should be familiar to you. Configuration of presence is performed using the "hint" priority for an extension in extensions.conf.
Column
Panel
titleOn this Page

Table of Contents
maxLevel2

Second Heading

Nulla sollicitudin velit vitae orci aliquam venenatis. Etiam in leo vel risus porta rutrum. Fusce viverra, dui porttitor viverra ultricies, neque elit cursus ipsum, non pulvinar lectus ipsum et quam. Curabitur eu erat lacinia, congue est et, malesuada lacus. Donec est justo, ullamcorper vel scelerisque vitae, hendrerit sed purus.

first sub-heading

Duis molestie convallis lectus a porta. Vivamus semper, nunc ac interdum faucibus, nibh nunc ultrices felis, consequat condimentum massa risus nec justo. Fusce auctor orci a metus pellentesque, non posuere purus vehicula. In cursus ac tellus in iaculis.

second sub-heading

In mollis eu erat vel consequat. Phasellus sapien leo, venenatis sed tincidunt ut, dictum a arcu. Etiam at justo ornare, imperdiet justo non, sollicitudin diam. Fusce vitae malesuada massa. Integer quam sem, tristique faucibus semper iaculis, porttitor vel arcu.

Panel
titleextensions.conf
No Format
nopaneltrue
[default]
exten => 1000,hint,PJSIP/alice

The line shown here is similar to any normal line in a dialplan, except that instead of a priority number or label, the word "hint" is specified. The hint is used to associate the state of individual devices with the state of a dialplan extension. An English translation of the dialplan line would be "Use the state of device PJSIP/alice as the basis for the state of extension 1000". When PJSIP endpoints subscribe to presence, they are subscribing to the state of an extension in the dialplan. By providing the dialplan hint, you are creating the necessary association in order to know which device (or devices) are relevant. For the example given above, this means that if someone subscribes to the state of extension 1000, then they will be told the state of PJSIP/alice. For more information about device state, see this page.

There are two endpoint options that affect presence subscriptions in pjsip.conf. The allow_subscribe option determines whether SUBSCRIBE requests from the endpoint are permitted to be received by Asterisk. By default, allow_subscribe is enabled. The other setting that affects presence subscriptions is the context option. This is used to determine the dialplan context in which the extension being subscribed to should be searched for. Given the dialplan snippet above, if the intent of an endpoint that subscribes to extension 1000 is to subscribe to the hint at [email protected], then the context of the subscribing endpoint would need to be set to "default". Note that if the context option is set to something other than "default", then Asterisk will search that context for the hint instead.

In order for presence subscriptions to work properly, some modules need to be loaded. Here is a list of the required modules:

  • res_pjsip.so: Core of PJSIP code in Asterisk.
  • res_pjsip_pubsub.so: The code that implements SUBSCRIBE/NOTIFY logic, on which individual event handlers are built.
  • res_pjsip_exten_state.so: Handles the "presence" and "dialog" events.
  • res_pjsip_pidf_body_generator.so: This module generates application/pidf+xml message bodies. Required for most subscriptions to the "presence" event.
  • res_pjsip_xpidf_body_generator.so: This module generates application/xpidf+xml message bodies. Required for some subscriptions to the "presence" event.
  • res_pjsip_dialog_info_body_generator.so: Required for subscriptions to the "dialog" event. This module generates application/dialog-info message bodies.

If you are unsure of what event or what body type your device uses for presence subscriptions, consult the device manufacturer's manual for more information.

Presence Customisations

Digium Presence

Digium phones are outfitted with a custom supplement to the base PIDF+XML presence format that allows for XMPP-like presence to be understood. To add this, the hint can be modified to include an additional presence state, like so:

Panel
titleextensions.conf
No Format
nopaneltrue
[default]
exten => 1000,hint,PJSIP/alice,CustomPresence:alice

This means that updates to the presence state of CustomPresence:alice will also be conveyed to subscribers to extension 1000. For more information on presence state in Asterisk, see this page.

The res_pjsip_pidf_digium_body_supplement.so module must be loaded in order for additional presence details to be reported.

Rich Presence (limited)

Some rich presence supplements that were in chan_sip have been migrated to the PJSIP channel driver as well. This is an extremely limited implementation of the "activities" element of a person. The res_pjsip_pidf_eyebeam_body_supplement.so module is required to add this functionality.