# Asterisk Project : Asterisk 13 Configuration_res_pjsip_pubsub

Created by wikibot on Aug 08, 2014

# Module that implements publish and subscribe support.

This configuration documentation is for functionality provided by `res_pjsip_pubsub`.

## pjsip.conf

### subscription_persistence

Persists SIP subscriptions so they survive restarts.

#### Configuration Option Reference

Option Name | Type | Default Value | Regular Expression | Description
--- | --- | --- | --- | ---
`packet` | `String` |  | `false` | Entire SIP SUBSCRIBE packet that created the subscription
`src_name` | `String` |  | `false` | The source address of the subscription
`src_port` | `Unsigned Integer` | `0` | `false` | The source port of the subscription
`transport_key` | `String` | `0` | `false` | The type of transport the subscription was received on
`local_name` | `String` |  | `false` | The local address the subscription was received on
`local_port` | `Unsigned Integer` | `0` | `false` | The local port the subscription was received on
`cseq` | `Unsigned Integer` | `0` | `false` | The sequence number of the next NOTIFY to be sent
`tag` | `Custom` |  | `false` | The local tag of the dialog for the subscription
`endpoint` | `Custom` |  | `false` | The name of the endpoint that subscribed
`expires` | `Custom` |  | `false` | The time at which the subscription expires

### resource_list

Resource list configuration parameters.

#### Configuration Option Reference

Option Name | Type | Default Value | Regular Expression | Description
--- | --- | --- | --- | ---
`type` | `None` |  | `false` | Must be of type 'resource_list'
`event` | `String` |  | `false` | The SIP event package that the list resource belong to.
`list_item` | `Custom` |  | `false` | The name of a resource to report state on
`full_state` | `Boolean` | `no` | `false` | Indicates if the entire list's state should be sent out.
`notification_batch_interval` | `Unsigned Integer` | `0` | `false` | Time Asterisk should wait, in milliseconds, before sending notifications.

#### Configuration Option Descriptions

##### event

The SIP event package describes the types of resources that Asterisk reports the state of.

- `presence` - Device state and presence reporting.
- `message-summary` - Message-waiting indication (MWI) reporting.

##### list_item

In general Asterisk looks up list items in the following way:

1. Check if the list item refers to another configured resource list.

2. Pass the name of the resource off to event-package-specific handlers to find the specified resource.

The second part means that the way the list item is specified depends on what type of list this is. For instance, if you have the event set to `presence`, then list items should be in the form of dialplan_extension@dialplan_context. For `message-summary` mailbox names should be listed.

##### full_state

If this option is enabled, and a resource changes state, then Asterisk will construct a notification that contains the state of all resources in the list. If the option is disabled, Asterisk will construct a notification that only contains the states of resources that have changed.

Note

Icon

Even with this option disabled, there are certain situations where Asterisk is forced to send a notification with the states of all resources in the list. When a subscriber renews or terminates its subscription to the list, Asterisk MUST send a full state notification.

##### notification_batch_interval

When a resource's state changes, it may be desired to wait a certain amount before Asterisk sends a notification to subscribers. This allows for other state changes to accumulate, so that Asterisk can communicate multiple state changes in a single notification instead of rapidly sending many notifications.

### inbound-publication

The configuration for inbound publications

#### Configuration Option Reference

Option Name | Type | Default Value | Regular Expression | Description
--- | --- | --- | --- | ---
`endpoint` | `Custom` |  | `false` | Optional name of an endpoint that is only allowed to publish to this resource
`type` | `None` |  | `false` | Must be of type 'inbound-publication'.

### Import Version

This documentation was imported from Asterisk Version SVN-branch-13-r420538