29#include <pjsip_simple.h>
49 static const char *XMLNS_DM_PREFIX =
"xmlns:dm";
50 static const char *XMLNS_DM =
"urn:ietf:params:xml:ns:pidf:data-model";
52 static const char *XMLNS_RPID_PREFIX =
"xmlns:rpid";
53 static const char *XMLNS_RPID =
"urn:ietf:params:xml:ns:pidf:rpid";
57 if (pidfstate[0] !=
'-') {
59 size_t str_size =
sizeof(
"rpid:") + strlen(pidfstate);
63 strcpy(act_str,
"rpid:");
64 strcat(act_str, pidfstate);
75 pjpidf_pres *pres = body;
77 char *statestring =
NULL, *pidfstate =
NULL, *pidfnote =
NULL;
81 &pidfstate, &pidfnote, &local_state, 0);
88 .
type =
"application",
89 .subtype =
"pidf+xml",
112 .
requires =
"res_pjsip,res_pjsip_pubsub",
Asterisk main include file. File version handling, generic pbx functions.
#define ast_alloca(size)
call __builtin_alloca to ensure we get gcc builtin semantics
Asterisk module definitions.
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
@ AST_MODPRI_CHANNEL_DEPEND
@ AST_MODULE_SUPPORT_CORE
#define ASTERISK_GPL_KEY
The text the key() function should return.
@ AST_MODULE_LOAD_SUCCESS
@ AST_MODULE_LOAD_DECLINE
Module has failed to load, may be in an inconsistent state.
static void add_eyebeam(pj_pool_t *pool, pj_xml_node *node, const char *pidfstate)
static int load_module(void)
static struct ast_sip_pubsub_body_supplement pidf_supplement
static int unload_module(void)
static int pidf_supplement_body(void *body, void *data)
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.
pj_xml_node * ast_sip_presence_xml_create_node(pj_pool_t *pool, pj_xml_node *parent, const char *name)
Create XML node.
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.
void ast_sip_pubsub_unregister_body_supplement(struct ast_sip_pubsub_body_supplement *supplement)
Unregister a body generator with the pubsub core.
int ast_sip_pubsub_register_body_supplement(struct ast_sip_pubsub_body_supplement *supplement)
Register a body generator with the pubsub core.
structure used for presence XML bodies
enum ast_extension_states exten_state
const char * type
Content type In "plain/text", "plain" is the type.