Ejemplo n.º 1
0
/*
 * Allow-Events header.
 */
PJ_DEF(pjsip_allow_events_hdr*) pjsip_allow_events_hdr_create(pj_pool_t *pool)
{
    const pj_str_t STR_ALLOW_EVENTS = { "Allow-Events", 12};
    pjsip_allow_events_hdr *hdr;

    hdr = pjsip_generic_array_hdr_create(pool, &STR_ALLOW_EVENTS);

    if (hdr) {
	hdr->sname.ptr = "u";
	hdr->sname.slen = 1;
    }

    return hdr;
}
Ejemplo n.º 2
0
/// Custom parser for Privacy header.  This is registered with PJSIP below
/// in register_custom_headers().
///
/// The Privacy header is a simple comma-separated list of values so we use
/// the built-in PJSIP parser code.
pjsip_hdr* parse_hdr_privacy(pjsip_parse_ctx* ctx)
{
  pjsip_generic_array_hdr *privacy = pjsip_generic_array_hdr_create(ctx->pool, &STR_PRIVACY);
  pjsip_parse_generic_array_hdr_imp(privacy, ctx->scanner);
  return (pjsip_hdr*)privacy;
}