Asterisk - The Open Source Telephony Project  18.5.0
Data Structures | Macros | Functions | Variables
res_pjsip_dialog_info_body_generator.c File Reference
#include "asterisk.h"
#include <pjsip.h>
#include <pjsip_simple.h>
#include <pjlib.h>
#include "asterisk/module.h"
#include "asterisk/callerid.h"
#include "asterisk/res_pjsip.h"
#include "asterisk/res_pjsip_pubsub.h"
#include "asterisk/res_pjsip_presence_xml.h"
#include "asterisk/res_pjsip_body_generator_types.h"
Include dependency graph for res_pjsip_dialog_info_body_generator.c:

Go to the source code of this file.

Data Structures

struct  dialog_info_xml_state
 Structure which contains dialog-info+xml state information. More...
 

Macros

#define MAX_STRING_GROWTHS   6
 

Functions

static void __reg_module (void)
 
static void __unreg_module (void)
 
struct ast_moduleAST_MODULE_SELF_SYM (void)
 
static void * dialog_info_allocate_body (void *data)
 
static int dialog_info_generate_body_content (void *body, void *data)
 
static void dialog_info_to_string (void *body, struct ast_str **str)
 
static void dialog_info_xml_state_destroy (void *obj)
 Destructor for dialog-info+xml information. More...
 
static struct ast_channelfind_ringing_channel (struct ao2_container *device_state_info)
 
static int load_module (void)
 
static int unload_module (void)
 

Variables

static struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "PJSIP Extension State Dialog Info+XML Provider" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "30ef0c93b36035ec78c9cfd712d36d9b" , .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_CHANNEL_DEPEND, .requires = "res_pjsip,res_pjsip_pubsub", }
 
static const struct ast_module_infoast_module_info = &__mod_info
 
static struct ast_sip_pubsub_body_generator dialog_info_body_generator
 
static const struct ast_datastore_info dialog_info_xml_datastore
 Datastore for attaching dialog-info+xml state information. More...
 

Macro Definition Documentation

◆ MAX_STRING_GROWTHS

#define MAX_STRING_GROWTHS   6

Definition at line 278 of file res_pjsip_dialog_info_body_generator.c.

Referenced by dialog_info_to_string().

Function Documentation

◆ __reg_module()

static void __reg_module ( void  )
static

Definition at line 333 of file res_pjsip_dialog_info_body_generator.c.

◆ __unreg_module()

static void __unreg_module ( void  )
static

Definition at line 333 of file res_pjsip_dialog_info_body_generator.c.

◆ AST_MODULE_SELF_SYM()

struct ast_module* AST_MODULE_SELF_SYM ( void  )

Definition at line 333 of file res_pjsip_dialog_info_body_generator.c.

◆ dialog_info_allocate_body()

static void* dialog_info_allocate_body ( void *  data)
static

Definition at line 57 of file res_pjsip_dialog_info_body_generator.c.

References ast_sip_presence_xml_create_node(), NULL, and ast_sip_exten_state_data::pool.

58 {
59  struct ast_sip_exten_state_data *state_data = data;
60 
61  return ast_sip_presence_xml_create_node(state_data->pool, NULL, "dialog-info");
62 }
#define NULL
Definition: resample.c:96
pj_xml_node * ast_sip_presence_xml_create_node(pj_pool_t *pool, pj_xml_node *parent, const char *name)
Create XML node.
Definition: presence_xml.c:152
structure used for presence XML bodies

◆ dialog_info_generate_body_content()

static int dialog_info_generate_body_content ( void *  body,
void *  data 
)
static

Definition at line 93 of file res_pjsip_dialog_info_body_generator.c.

References ao2_cleanup, ao2_ref, ast_calloc, ast_channel_caller(), ast_channel_connected(), ast_channel_lock, ast_channel_unlock, ast_channel_unref, ast_copy_pj_str(), ast_datastores_add(), ast_datastores_alloc_datastore(), ast_datastores_find(), AST_EXTENSION_ONHOLD, ast_json_integer_create(), ast_json_integer_get(), AST_PRES_RESTRICTED, AST_PRES_RESTRICTION, ast_sip_presence_exten_state_to_str(), ast_sip_presence_xml_create_attr(), ast_sip_presence_xml_create_node(), ast_sip_sanitize_xml(), ast_sip_subscription_get_dialog(), ast_sip_subscription_get_endpoint(), ast_sip_subscription_get_persistence_data(), ast_sip_subscription_set_persistence_data(), ast_strdupa, ast_strip_quoted(), ast_strlen_zero, ast_datastore::data, ast_sip_exten_state_data::datastores, ast_sip_exten_state_data::device_state_info, ast_sip_exten_state_data::exten, ast_sip_exten_state_data::exten_state, find_ringing_channel(), ast_party_connected_line::id, ast_sip_exten_state_data::local, name, ast_sip_endpoint::notify_early_inuse_ringing, NULL, ast_party_id::number, ast_sip_exten_state_data::pool, ast_party_number::presentation, ast_sip_exten_state_data::remote, S_COR, S_OR, state, ast_sip_exten_state_data::sub, and dialog_info_xml_state::version.

94 {
95  pj_xml_node *dialog_info = body, *dialog, *state;
96  struct ast_datastore *datastore;
97  struct dialog_info_xml_state *datastore_state;
98  struct ast_sip_exten_state_data *state_data = data;
99  char *local = ast_strdupa(state_data->local), *stripped, *statestring = NULL;
100  char *remote = ast_strdupa(state_data->remote);
101  char *pidfstate = NULL, *pidfnote = NULL;
102  enum ast_sip_pidf_state local_state;
103  char version_str[32], sanitized[PJSIP_MAX_URL_SIZE];
104  struct ast_sip_endpoint *endpoint = NULL;
105  unsigned int notify_early_inuse_ringing = 0;
106 
107  if (!local || !remote || !state_data->datastores) {
108  return -1;
109  }
110 
111  datastore = ast_datastores_find(state_data->datastores, "dialog-info+xml");
112  if (!datastore) {
113  const struct ast_json *version_json = NULL;
114 
115  datastore = ast_datastores_alloc_datastore(&dialog_info_xml_datastore, "dialog-info+xml");
116  if (!datastore) {
117  return -1;
118  }
119 
120  datastore->data = ast_calloc(1, sizeof(struct dialog_info_xml_state));
121  if (!datastore->data || ast_datastores_add(state_data->datastores, datastore)) {
122  ao2_ref(datastore, -1);
123  return -1;
124  }
125  datastore_state = datastore->data;
126 
127  if (state_data->sub) {
128  version_json = ast_sip_subscription_get_persistence_data(state_data->sub);
129  }
130 
131  if (version_json) {
132  datastore_state->version = ast_json_integer_get(version_json);
133  datastore_state->version++;
134  } else {
135  datastore_state->version = 0;
136  }
137  } else {
138  datastore_state = datastore->data;
139  datastore_state->version++;
140  }
141 
142  stripped = ast_strip_quoted(local, "<", ">");
143  ast_sip_sanitize_xml(stripped, sanitized, sizeof(sanitized));
144 
145  if (state_data->sub && (endpoint = ast_sip_subscription_get_endpoint(state_data->sub))) {
146  notify_early_inuse_ringing = endpoint->notify_early_inuse_ringing;
147  ao2_cleanup(endpoint);
148  }
149  ast_sip_presence_exten_state_to_str(state_data->exten_state, &statestring,
150  &pidfstate, &pidfnote, &local_state, notify_early_inuse_ringing);
151 
152  ast_sip_presence_xml_create_attr(state_data->pool, dialog_info, "xmlns", "urn:ietf:params:xml:ns:dialog-info");
153 
154  snprintf(version_str, sizeof(version_str), "%u", datastore_state->version);
155  ast_sip_presence_xml_create_attr(state_data->pool, dialog_info, "version", version_str);
156 
157  if (state_data->sub) {
159  }
160 
161  ast_sip_presence_xml_create_attr(state_data->pool, dialog_info, "state", "full");
162  ast_sip_presence_xml_create_attr(state_data->pool, dialog_info, "entity", sanitized);
163 
164  dialog = ast_sip_presence_xml_create_node(state_data->pool, dialog_info, "dialog");
165  ast_sip_presence_xml_create_attr(state_data->pool, dialog, "id", state_data->exten);
166  if (!ast_strlen_zero(statestring) && !strcmp(statestring, "early")) {
167  struct ast_channel *callee = NULL;
168  char local_target[PJSIP_MAX_URL_SIZE + 32] = "";
169  char *local_cid_name = NULL;
170  pj_xml_node *local_node, *local_identity_node, *local_target_node;
171 
172  ast_sip_presence_xml_create_attr(state_data->pool, dialog, "direction", "recipient");
173 
174  if (state_data->device_state_info) {
175  callee = find_ringing_channel(state_data->device_state_info);
176  }
177 
178  if (callee) {
179  static char *anonymous = "anonymous";
180  static char *invalid = "anonymous.invalid";
181  char *remote_cid_name;
182  char *remote_connected_num;
183  int remote_connected_num_restricted;
184  char *local_caller_num;
185  pjsip_dialog *dlg = ast_sip_subscription_get_dialog(state_data->sub);
186  pjsip_sip_uri *dlg_remote_fromhdr = pjsip_uri_get_uri(dlg->local.info->uri);
187  char remote_target[PJSIP_MAX_URL_SIZE + 32];
188  char dlg_remote_uri[PJSIP_MAX_URL_SIZE];
189  char *from_domain_stripped;
190  char from_domain_sanitized[PJSIP_MAX_URL_SIZE];
191  pj_xml_node *remote_node, *remote_identity_node, *remote_target_node;
192 
193  /* We use the local dialog URI to determine the domain to use in the XML itself */
194  ast_copy_pj_str(dlg_remote_uri, &dlg_remote_fromhdr->host, sizeof(dlg_remote_uri));
195  from_domain_stripped = ast_strip_quoted(dlg_remote_uri, "<", ">");
196  ast_sip_sanitize_xml(from_domain_stripped, from_domain_sanitized, sizeof(from_domain_sanitized));
197 
198  ast_channel_lock(callee);
199 
200  /* The remote node uses the connected line information, so who is calling the
201  * monitored endpoint.
202  */
203  remote_cid_name = S_COR(ast_channel_connected(callee)->id.name.valid,
204  S_COR((ast_channel_connected(callee)->id.name.presentation &
206  ast_channel_connected(callee)->id.name.str), "");
207 
208  remote_connected_num_restricted = (ast_channel_connected(callee)->id.number.presentation &
210  remote_connected_num = S_COR(ast_channel_connected(callee)->id.number.valid,
211  S_COR(remote_connected_num_restricted, anonymous,
212  ast_channel_connected(callee)->id.number.str), "invalid");
213 
214  snprintf(remote_target, sizeof(remote_target), "sip:%s@%s", remote_connected_num,
215  remote_connected_num_restricted ? invalid : from_domain_sanitized);
216 
217  /* The local node uses the callerid information, so what the callerid would be
218  * if the monitored endpoint was calling.
219  */
220  local_cid_name = S_COR(ast_channel_caller(callee)->id.name.valid,
221  ast_channel_caller(callee)->id.name.str, "");
222  local_caller_num = S_COR(ast_channel_caller(callee)->id.number.valid,
223  ast_channel_caller(callee)->id.number.str, "invalid");
224 
225  snprintf(local_target, sizeof(local_target), "sip:%s@%s", local_caller_num,
226  from_domain_sanitized);
227 
228  ast_channel_unlock(callee);
229  callee = ast_channel_unref(callee);
230 
231  remote_node = ast_sip_presence_xml_create_node(state_data->pool, dialog, "remote");
232  remote_identity_node = ast_sip_presence_xml_create_node(state_data->pool, remote_node, "identity");
233  remote_target_node = ast_sip_presence_xml_create_node(state_data->pool, remote_node, "target");
234 
235  pj_strdup2(state_data->pool, &remote_identity_node->content, remote_target);
236  if (!ast_strlen_zero(remote_cid_name)) {
237  ast_sip_presence_xml_create_attr(state_data->pool, remote_identity_node, "display", remote_cid_name);
238  }
239  ast_sip_presence_xml_create_attr(state_data->pool, remote_target_node, "uri", remote_target);
240  }
241 
242  if (state_data->device_state_info) {
243  local_node = ast_sip_presence_xml_create_node(state_data->pool, dialog, "local");
244  local_identity_node = ast_sip_presence_xml_create_node(state_data->pool, local_node, "identity");
245  local_target_node = ast_sip_presence_xml_create_node(state_data->pool, local_node, "target");
246 
247  /* If a channel is not available we fall back to the sanitized local URI instead */
248  pj_strdup2(state_data->pool, &local_identity_node->content, S_OR(local_target, sanitized));
249  if (!ast_strlen_zero(local_cid_name)) {
250  ast_sip_presence_xml_create_attr(state_data->pool, local_identity_node, "display", local_cid_name);
251  }
252  ast_sip_presence_xml_create_attr(state_data->pool, local_target_node, "uri", S_OR(local_target, sanitized));
253  }
254  }
255 
256  state = ast_sip_presence_xml_create_node(state_data->pool, dialog, "state");
257  pj_strdup2(state_data->pool, &state->content, statestring);
258 
259  if (state_data->exten_state == AST_EXTENSION_ONHOLD) {
260  pj_xml_node *local_node, *target, *param;
261 
262  local_node = ast_sip_presence_xml_create_node(state_data->pool, dialog, "local");
263  target = ast_sip_presence_xml_create_node(state_data->pool, local_node, "target");
264  ast_sip_presence_xml_create_attr(state_data->pool, target, "uri", sanitized);
265  param = ast_sip_presence_xml_create_node(state_data->pool, target, "param");
266  ast_sip_presence_xml_create_attr(state_data->pool, param, "pname", "+sip.rendering");
267  ast_sip_presence_xml_create_attr(state_data->pool, param, "pvalue", "no");
268  }
269 
270  ao2_ref(datastore, -1);
271 
272  return 0;
273 }
struct ast_party_caller * ast_channel_caller(struct ast_channel *chan)
static const struct ast_datastore_info dialog_info_xml_datastore
Datastore for attaching dialog-info+xml state information.
enum sip_cc_notify_state state
Definition: chan_sip.c:959
#define ast_channel_lock(chan)
Definition: channel.h:2945
Main Channel structure associated with a channel.
int presentation
Q.931 presentation-indicator and screening-indicator encoded fields.
Definition: channel.h:296
struct ast_party_id id
Connected party ID.
Definition: channel.h:459
#define ast_channel_unref(c)
Decrease channel reference count.
Definition: channel.h:2981
pj_xml_attr * ast_sip_presence_xml_create_attr(pj_pool_t *pool, pj_xml_node *node, const char *name, const char *value)
Create XML attribute.
Definition: presence_xml.c:140
int ast_datastores_add(struct ao2_container *datastores, struct ast_datastore *datastore)
Add a data store to a container.
Definition: datastore.c:101
Structure which contains dialog-info+xml state information.
enum ast_extension_states exten_state
Structure for a data store object.
Definition: datastore.h:68
void ast_copy_pj_str(char *dest, const pj_str_t *src, size_t size)
Copy a pj_str_t into a standard character buffer.
Definition: res_pjsip.c:5240
#define NULL
Definition: resample.c:96
struct ast_sip_subscription * sub
#define AST_PRES_RESTRICTED
Definition: callerid.h:325
struct ast_datastore * ast_datastores_find(struct ao2_container *datastores, const char *name)
Find a data store in a container.
Definition: datastore.c:119
#define ast_strlen_zero(foo)
Definition: strings.h:52
Number structure.
Definition: app_followme.c:154
char * ast_strip_quoted(char *s, const char *beg_quotes, const char *end_quotes)
Strip leading/trailing whitespace and quotes from a string.
Definition: main/utils.c:1639
void ast_sip_subscription_set_persistence_data(struct ast_sip_subscription *subscription, struct ast_json *persistence_data)
Set persistence data for a subscription.
void ast_sip_presence_exten_state_to_str(int state, char **statestring, char **pidfstate, char **pidfnote, enum ast_sip_pidf_state *local_state, unsigned int notify_early_inuse_ringing)
Convert extension state to relevant PIDF strings.
Definition: presence_xml.c:84
struct ast_party_connected_line * ast_channel_connected(struct ast_channel *chan)
#define ao2_ref(o, delta)
Definition: astobj2.h:464
#define S_COR(a, b, c)
returns the equivalent of logic or for strings, with an additional boolean check: second one if not e...
Definition: strings.h:85
unsigned int notify_early_inuse_ringing
Definition: res_pjsip.h:897
#define ast_strdupa(s)
duplicate a string in memory from the stack
Definition: astmm.h:300
struct ast_datastore * ast_datastores_alloc_datastore(const struct ast_datastore_info *info, const char *uid)
Allocate a datastore for use with the datastores container.
Definition: datastore.c:138
An entity with which Asterisk communicates.
Definition: res_pjsip.h:812
struct ao2_container * device_state_info
#define ast_channel_unlock(chan)
Definition: channel.h:2946
static const char name[]
Definition: cdr_mysql.c:74
#define ast_calloc(num, len)
A wrapper for calloc()
Definition: astmm.h:204
pj_xml_node * ast_sip_presence_xml_create_node(pj_pool_t *pool, pj_xml_node *parent, const char *name)
Create XML node.
Definition: presence_xml.c:152
void ast_sip_sanitize_xml(const char *input, char *output, size_t len)
Replace offensive XML characters with XML entities.
Definition: presence_xml.c:29
static struct ast_channel * find_ringing_channel(struct ao2_container *device_state_info)
#define AST_PRES_RESTRICTION
Definition: callerid.h:323
struct ast_sip_endpoint * ast_sip_subscription_get_endpoint(struct ast_sip_subscription *sub)
Get the endpoint that is associated with this subscription.
pjsip_dialog * ast_sip_subscription_get_dialog(struct ast_sip_subscription *sub)
Get the pjsip dialog that is associated with this subscription.
structure used for presence XML bodies
void * data
Definition: datastore.h:70
#define ao2_cleanup(obj)
Definition: astobj2.h:1958
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one...
Definition: strings.h:79
Abstract JSON element (object, array, string, int, ...).
const struct ast_json * ast_sip_subscription_get_persistence_data(const struct ast_sip_subscription *subscription)
Retrieve persistence data for a subscription.
ast_sip_pidf_state
intmax_t ast_json_integer_get(const struct ast_json *integer)
Get the value from a JSON integer.
Definition: json.c:322
unsigned int version
Version to place into the next NOTIFY.
struct ast_json * ast_json_integer_create(intmax_t value)
Create a JSON integer.
Definition: json.c:317
struct ast_party_number number
Subscriber phone number.
Definition: channel.h:343

◆ dialog_info_to_string()

static void dialog_info_to_string ( void *  body,
struct ast_str **  str 
)
static

Definition at line 280 of file res_pjsip_dialog_info_body_generator.c.

References ast_log, AST_PJSIP_XML_PROLOG_LEN, ast_str_buffer(), ast_str_make_space, ast_str_size(), ast_str_update(), LOG_WARNING, and MAX_STRING_GROWTHS.

281 {
282  pj_xml_node *dialog_info = body;
283  int growths = 0;
284  int size;
285 
286  do {
287  size = pj_xml_print(dialog_info, ast_str_buffer(*str), ast_str_size(*str) - 1, PJ_TRUE);
288  if (size <= AST_PJSIP_XML_PROLOG_LEN) {
289  ast_str_make_space(str, ast_str_size(*str) * 2);
290  ++growths;
291  }
292  } while (size <= AST_PJSIP_XML_PROLOG_LEN && growths < MAX_STRING_GROWTHS);
293  if (size <= AST_PJSIP_XML_PROLOG_LEN) {
294  ast_log(LOG_WARNING, "dialog-info+xml body text too large\n");
295  return;
296  }
297 
298  *(ast_str_buffer(*str) + size) = '\0';
299  ast_str_update(*str);
300 }
size_t ast_str_size(const struct ast_str *buf)
Returns the current maximum length (without reallocation) of the current buffer.
Definition: strings.h:699
#define LOG_WARNING
Definition: logger.h:274
#define ast_str_make_space(buf, new_len)
Definition: strings.h:780
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
Definition: strings.h:714
#define ast_log
Definition: astobj2.c:42
#define AST_PJSIP_XML_PROLOG_LEN
Length of the XML prolog when printing presence or other XML in PJSIP.
void ast_str_update(struct ast_str *buf)
Update the length of the buffer, after using ast_str merely as a buffer.
Definition: strings.h:663

◆ dialog_info_xml_state_destroy()

static void dialog_info_xml_state_destroy ( void *  obj)
static

Destructor for dialog-info+xml information.

Definition at line 46 of file res_pjsip_dialog_info_body_generator.c.

References ast_free.

47 {
48  ast_free(obj);
49 }
#define ast_free(a)
Definition: astmm.h:182

◆ find_ringing_channel()

static struct ast_channel* find_ringing_channel ( struct ao2_container device_state_info)
static

Definition at line 68 of file res_pjsip_dialog_info_body_generator.c.

References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_channel_creationtime(), ast_channel_lock, ast_channel_ref, ast_channel_unlock, AST_DEVICE_RINGING, AST_DEVICE_RINGINUSE, ast_tvcmp(), ast_tvzero(), c, ast_device_state_info::causing_channel, ast_device_state_info::device_state, and NULL.

Referenced by dialog_info_generate_body_content().

69 {
70  struct ao2_iterator citer;
72  struct ast_channel *c = NULL;
73  struct timeval tv = {0,};
74 
75  /* iterate ringing devices and get the oldest of all causing channels */
76  citer = ao2_iterator_init(device_state_info, 0);
77  for (; (device_state = ao2_iterator_next(&citer)); ao2_ref(device_state, -1)) {
78  if (!device_state->causing_channel || (device_state->device_state != AST_DEVICE_RINGING &&
79  device_state->device_state != AST_DEVICE_RINGINUSE)) {
80  continue;
81  }
82  ast_channel_lock(device_state->causing_channel);
83  if (ast_tvzero(tv) || ast_tvcmp(ast_channel_creationtime(device_state->causing_channel), tv) < 0) {
84  c = device_state->causing_channel;
86  }
87  ast_channel_unlock(device_state->causing_channel);
88  }
89  ao2_iterator_destroy(&citer);
90  return c ? ast_channel_ref(c) : NULL;
91 }
#define ast_channel_lock(chan)
Definition: channel.h:2945
Main Channel structure associated with a channel.
int ast_tvzero(const struct timeval t)
Returns true if the argument is 0,0.
Definition: time.h:108
void ao2_iterator_destroy(struct ao2_iterator *iter)
Destroy a container iterator.
static struct test_val c
#define NULL
Definition: resample.c:96
struct ast_channel * causing_channel
Definition: pbx.h:98
#define ao2_ref(o, delta)
Definition: astobj2.h:464
enum ast_device_state device_state
Definition: pbx.h:97
int ast_tvcmp(struct timeval _a, struct timeval _b)
Compres two struct timeval instances returning -1, 0, 1 if the first arg is smaller, equal or greater to the second.
Definition: time.h:128
#define ao2_iterator_next(iter)
Definition: astobj2.h:1933
struct timeval ast_channel_creationtime(struct ast_channel *chan)
#define ast_channel_unlock(chan)
Definition: channel.h:2946
#define ast_channel_ref(c)
Increase channel reference count.
Definition: channel.h:2970
When we need to walk through a container, we use an ao2_iterator to keep track of the current positio...
Definition: astobj2.h:1841
struct ao2_iterator ao2_iterator_init(struct ao2_container *c, int flags) attribute_warn_unused_result
Create an iterator for a container.

◆ load_module()

static int load_module ( void  )
static

Definition at line 312 of file res_pjsip_dialog_info_body_generator.c.

References AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, and ast_sip_pubsub_register_body_generator().

Referenced by unload_module().

313 {
316  }
317 
319 }
int ast_sip_pubsub_register_body_generator(struct ast_sip_pubsub_body_generator *generator)
Register a body generator with the pubsub core.
static struct ast_sip_pubsub_body_generator dialog_info_body_generator
Module has failed to load, may be in an inconsistent state.
Definition: module.h:78

◆ unload_module()

static int unload_module ( void  )
static

Definition at line 321 of file res_pjsip_dialog_info_body_generator.c.

References AST_MODFLAG_LOAD_ORDER, AST_MODPRI_CHANNEL_DEPEND, AST_MODULE_INFO(), AST_MODULE_SUPPORT_CORE, ast_sip_pubsub_unregister_body_generator(), ASTERISK_GPL_KEY, and load_module().

322 {
324  return 0;
325 }
static struct ast_sip_pubsub_body_generator dialog_info_body_generator
void ast_sip_pubsub_unregister_body_generator(struct ast_sip_pubsub_body_generator *generator)
Unregister a body generator with the pubsub core.

Variable Documentation

◆ __mod_info

struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "PJSIP Extension State Dialog Info+XML Provider" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "30ef0c93b36035ec78c9cfd712d36d9b" , .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_CHANNEL_DEPEND, .requires = "res_pjsip,res_pjsip_pubsub", }
static

Definition at line 333 of file res_pjsip_dialog_info_body_generator.c.

◆ ast_module_info

const struct ast_module_info* ast_module_info = &__mod_info
static

Definition at line 333 of file res_pjsip_dialog_info_body_generator.c.

◆ dialog_info_body_generator

struct ast_sip_pubsub_body_generator dialog_info_body_generator
static

Definition at line 302 of file res_pjsip_dialog_info_body_generator.c.

◆ dialog_info_xml_datastore

const struct ast_datastore_info dialog_info_xml_datastore
static
Initial value:
= {
.type = "dialog-info+xml",
}
static void dialog_info_xml_state_destroy(void *obj)
Destructor for dialog-info+xml information.

Datastore for attaching dialog-info+xml state information.

Definition at line 52 of file res_pjsip_dialog_info_body_generator.c.