Asterisk - The Open Source Telephony Project  18.5.0
Data Fields
ast_sip_publish_handler Struct Reference

Callbacks that publication handlers will define. More...

#include <res_pjsip_pubsub.h>

Collaboration diagram for ast_sip_publish_handler:
Collaboration graph
[legend]

Data Fields

const char * event_name
 The name of the event this handler deals with. More...
 
int(* new_publication )(struct ast_sip_endpoint *endpoint, const char *resource, const char *event_configuration)
 Called when a PUBLISH to establish a new publication arrives. More...
 
struct {
   struct ast_sip_publish_handler *   next
 
next
 
int(* publication_state_change )(struct ast_sip_publication *pub, pjsip_msg_body *body, enum ast_sip_publish_state state)
 Published resource has changed states. More...
 
struct ao2_containerpublications
 Publications. More...
 
void(* publish_expire )(struct ast_sip_publication *pub)
 Called when a publication has reached its expiration. More...
 

Detailed Description

Callbacks that publication handlers will define.

Definition at line 49 of file res_pjsip_pubsub.h.

Field Documentation

◆ event_name

const char* event_name

The name of the event this handler deals with.

Definition at line 51 of file res_pjsip_pubsub.h.

Referenced by ast_sip_register_publish_handler(), find_pub_handler(), load_module(), and publish_request_initial().

◆ new_publication

int(* new_publication) (struct ast_sip_endpoint *endpoint, const char *resource, const char *event_configuration)

Called when a PUBLISH to establish a new publication arrives.

Parameters
endpointThe endpoint from whom the PUBLISH arrived.
resourceThe resource whose state is being published.
event_configurationThe name of the event type configuration to use for this resource.
Returns
Response code for the incoming PUBLISH

Definition at line 64 of file res_pjsip_pubsub.h.

Referenced by publish_request_initial().

◆ next [1/2]

◆ next [2/2]

struct { ... } next

◆ publication_state_change

int(* publication_state_change) (struct ast_sip_publication *pub, pjsip_msg_body *body, enum ast_sip_publish_state state)

Published resource has changed states.

The state parameter can be used to take further action. For instance, if the state is AST_SIP_PUBLISH_STATE_INITIALIZED, then this is the initial PUBLISH request. This is a good time to set up datastores on the publication or any other initial needs.

AST_SIP_PUBLISH_STATE_TERMINATED is used when the remote end is terminating its publication. This is a good opportunity to free any resources associated with the publication.

AST_SIP_PUBLISH_STATE_ACTIVE is used when a publication that modifies state arrives.

Parameters
pubThe publication whose state has changed
bodyThe body of the inbound PUBLISH
stateThe state of the publication

Definition at line 88 of file res_pjsip_pubsub.h.

Referenced by publish_request_initial(), and pubsub_on_rx_publish_request().

◆ publications

struct ao2_container* publications

◆ publish_expire

void(* publish_expire) (struct ast_sip_publication *pub)

Called when a publication has reached its expiration.

Definition at line 68 of file res_pjsip_pubsub.h.


The documentation for this struct was generated from the following file: