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.
static void add_eyebeam(pj_pool_t *pool, pj_xml_node *node, const char *pidfstate)
static pj_pool_t * pool
Global memory pool for configuration and timers.
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.
enum ast_extension_states exten_state
const char * type
Content type In "plain/text", "plain" is the type.
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.
static struct ast_sip_pubsub_body_supplement pidf_supplement
static int pidf_supplement_body(void *body, void *data)
static int unload_module(void)
#define ast_alloca(size)
call __builtin_alloca to ensure we get gcc builtin semantics
static int load_module(void)
pj_xml_node * ast_sip_presence_xml_create_node(pj_pool_t *pool, pj_xml_node *parent, const char *name)
Create XML node.
Module has failed to load, may be in an inconsistent state.
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS|AST_MODFLAG_LOAD_ORDER, "HTTP Phone Provisioning",.support_level=AST_MODULE_SUPPORT_EXTENDED,.load=load_module,.unload=unload_module,.reload=reload,.load_pri=AST_MODPRI_CHANNEL_DEPEND,.requires="http",)
structure used for presence XML bodies
int ast_sip_pubsub_register_body_supplement(struct ast_sip_pubsub_body_supplement *supplement)
Register a body generator with the pubsub core.
void ast_sip_pubsub_unregister_body_supplement(struct ast_sip_pubsub_body_supplement *supplement)
Unregister a body generator with the pubsub core.
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.