本文整理汇总了C++中pj_stricmp函数的典型用法代码示例。如果您正苦于以下问题:C++ pj_stricmp函数的具体用法?C++ pj_stricmp怎么用?C++ pj_stricmp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pj_stricmp函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: silk_test_alloc
/*
* Check if factory can allocate the specified codec.
*/
static pj_status_t silk_test_alloc(pjmedia_codec_factory *factory,
const pjmedia_codec_info *info )
{
const pj_str_t silk_tag = {"SILK", 4};
unsigned i;
PJ_UNUSED_ARG(factory);
PJ_ASSERT_RETURN(factory==&silk_factory.base, PJ_EINVAL);
/* Type MUST be audio. */
if (info->type != PJMEDIA_TYPE_AUDIO)
return PJMEDIA_CODEC_EUNSUP;
/* Check encoding name. */
if (pj_stricmp(&info->encoding_name, &silk_tag) != 0)
return PJMEDIA_CODEC_EUNSUP;
/* Channel count must be one */
if (info->channel_cnt != 1)
return PJMEDIA_CODEC_EUNSUP;
/* Check clock-rate */
for (i=0; i<PJ_ARRAY_SIZE(silk_factory.silk_param); ++i) {
silk_param *sp = &silk_factory.silk_param[i];
if (sp->enabled && info->clock_rate == sp->clock_rate)
{
return PJ_SUCCESS;
}
}
/* Clock rate not supported */
return PJMEDIA_CODEC_EUNSUP;
}
示例2: ilbc_test_alloc
/*
* Check if factory can allocate the specified codec.
*/
static pj_status_t ilbc_test_alloc( pjmedia_codec_factory *factory,
const pjmedia_codec_info *info )
{
const pj_str_t ilbc_tag = { "iLBC", 4};
PJ_UNUSED_ARG(factory);
PJ_ASSERT_RETURN(factory==&ilbc_factory.base, PJ_EINVAL);
/* Type MUST be audio. */
if (info->type != PJMEDIA_TYPE_AUDIO)
return PJMEDIA_CODEC_EUNSUP;
/* Check encoding name. */
if (pj_stricmp(&info->encoding_name, &ilbc_tag) != 0)
return PJMEDIA_CODEC_EUNSUP;
/* Check clock-rate */
if (info->clock_rate != CLOCK_RATE)
return PJMEDIA_CODEC_EUNSUP;
/* Channel count must be one */
if (info->channel_cnt != 1)
return PJMEDIA_CODEC_EUNSUP;
/* Yes, this should be iLBC! */
return PJ_SUCCESS;
}
示例3: PJ_DEF
PJ_DEF(pj_bool_t) pjxpidf_get_status(pjxpidf_pres *pres)
{
pj_xml_node *atom;
pj_xml_node *addr;
pj_xml_node *status;
pj_xml_attr *attr;
atom = pj_xml_find_node(pres, &STR_ATOM);
if (!atom) {
pj_assert(0);
return PJ_FALSE;
}
addr = pj_xml_find_node(atom, &STR_ADDRESS);
if (!addr) {
pj_assert(0);
return PJ_FALSE;
}
status = pj_xml_find_node(addr, &STR_STATUS);
if (!status) {
pj_assert(0);
return PJ_FALSE;
}
attr = pj_xml_find_attr(status, &STR_STATUS, NULL);
if (!attr) {
pj_assert(0);
return PJ_FALSE;
}
return pj_stricmp(&attr->value, &STR_OPEN)==0 ? PJ_TRUE : PJ_FALSE;
}
示例4: pjsip_event_hdr_create
/*
* Parse Event header.
*/
static pjsip_hdr *parse_hdr_event(pjsip_parse_ctx *ctx)
{
pjsip_event_hdr *hdr = pjsip_event_hdr_create(ctx->pool);
const pj_str_t id_param = { "id", 2 };
const pjsip_parser_const_t *pc = pjsip_parser_const();
pj_scan_get(ctx->scanner, &pc->pjsip_TOKEN_SPEC, &hdr->event_type);
while (*ctx->scanner->curptr == ';') {
pj_str_t pname, pvalue;
pj_scan_get_char(ctx->scanner);
pjsip_parse_param_imp(ctx->scanner, ctx->pool, &pname, &pvalue, 0);
if (pj_stricmp(&pname, &id_param)==0) {
hdr->id_param = pvalue;
} else {
pjsip_param *param = PJ_POOL_ALLOC_T(ctx->pool, pjsip_param);
param->name = pname;
param->value = pvalue;
pj_list_push_back(&hdr->other_param, param);
}
}
pjsip_parse_end_hdr_imp( ctx->scanner );
return (pjsip_hdr*)hdr;
}
示例5: registrar_validate_path
static int registrar_validate_path(struct rx_task_data *task_data, struct ast_str **path_str)
{
const pj_str_t path_supported_name = { "path", 4 };
pjsip_supported_hdr *supported_hdr;
int i;
if (!task_data->aor->support_path) {
return 0;
}
if (build_path_data(task_data, path_str)) {
return -1;
}
if (!*path_str) {
return 0;
}
supported_hdr = pjsip_msg_find_hdr(task_data->rdata->msg_info.msg, PJSIP_H_SUPPORTED, NULL);
if (!supported_hdr) {
return -1;
}
/* Find advertised path support */
for (i = 0; i < supported_hdr->count; i++) {
if (!pj_stricmp(&supported_hdr->values[i], &path_supported_name)) {
return 0;
}
}
/* Path header present, but support not advertised */
return -1;
}
示例6: spx_test_alloc
/*
* Check if factory can allocate the specified codec.
*/
static pj_status_t spx_test_alloc( pjmedia_codec_factory *factory,
const pjmedia_codec_info *info )
{
const pj_str_t speex_tag = { "speex", 5};
unsigned i;
PJ_UNUSED_ARG(factory);
/* Type MUST be audio. */
if (info->type != PJMEDIA_TYPE_AUDIO)
return PJMEDIA_CODEC_EUNSUP;
/* Check encoding name. */
if (pj_stricmp(&info->encoding_name, &speex_tag) != 0)
return PJMEDIA_CODEC_EUNSUP;
/* Check clock-rate */
for (i=0; i<PJ_ARRAY_SIZE(spx_factory.speex_param); ++i) {
if (info->clock_rate == spx_factory.speex_param[i].clock_rate) {
/* Okay, let's Speex! */
return PJ_SUCCESS;
}
}
/* Unsupported, or mode is disabled. */
return PJMEDIA_CODEC_EUNSUP;
}
示例7: PJ_DEF
PJ_DEF(pj_bool_t) pjpidf_status_is_basic_open(const pjpidf_status *st)
{
pj_xml_node *node = pj_xml_find_node((pj_xml_node*)st, &BASIC);
if (!node)
return PJ_FALSE;
return pj_stricmp(&node->content, &OPEN)==0;
}
示例8: pjsip_msg_find_hdr
static pjsip_require_hdr *find_req_hdr(pjsip_msg *msg)
{
pjsip_require_hdr *hreq;
hreq = (pjsip_require_hdr*)
pjsip_msg_find_hdr(msg, PJSIP_H_REQUIRE, NULL);
while (hreq) {
unsigned i;
for (i=0; i<hreq->count; ++i) {
if (!pj_stricmp(&hreq->values[i], &tag_100rel)) {
return hreq;
}
}
if ((void*)hreq->next == (void*)&msg->hdr)
return NULL;
hreq = (pjsip_require_hdr*)
pjsip_msg_find_hdr(msg, PJSIP_H_REQUIRE, hreq->next);
}
return NULL;
}
示例9: pjsip_sess_expires_hdr_create
/*
* Parse Session-Expires header.
*/
static pjsip_hdr *parse_hdr_se(pjsip_parse_ctx *ctx)
{
pjsip_sess_expires_hdr *hdr = pjsip_sess_expires_hdr_create(ctx->pool);
const pjsip_parser_const_t *pc = pjsip_parser_const();
pj_str_t token;
pj_scan_get(ctx->scanner, &pc->pjsip_DIGIT_SPEC, &token);
hdr->sess_expires = pj_strtoul(&token);
while (*ctx->scanner->curptr == ';') {
pj_str_t pname, pvalue;
pj_scan_get_char(ctx->scanner);
pjsip_parse_param_imp(ctx->scanner, ctx->pool, &pname, &pvalue, 0);
if (pj_stricmp(&pname, &STR_REFRESHER)==0) {
hdr->refresher = pvalue;
} else {
pjsip_param *param = PJ_POOL_ALLOC_T(ctx->pool, pjsip_param);
param->name = pname;
param->value = pvalue;
pj_list_push_back(&hdr->other_param, param);
}
}
pjsip_parse_end_hdr_imp( ctx->scanner );
return (pjsip_hdr*)hdr;
}
示例10: parse_digest_challenge
static void parse_digest_challenge( pj_scanner *scanner, pj_pool_t *pool,
pjsip_digest_challenge *chal)
{
pj_list_init(&chal->other_param);
for (;;) {
pj_str_t name, value;
pjsip_parse_param_imp(scanner, pool, &name, &value,
PJSIP_PARSE_REMOVE_QUOTE);
if (!pj_stricmp(&name, &pjsip_REALM_STR)) {
chal->realm = value;
} else if (!pj_stricmp(&name, &pjsip_DOMAIN_STR)) {
chal->domain = value;
} else if (!pj_stricmp(&name, &pjsip_NONCE_STR)) {
chal->nonce = value;
} else if (!pj_stricmp(&name, &pjsip_OPAQUE_STR)) {
chal->opaque = value;
} else if (!pj_stricmp(&name, &pjsip_STALE_STR)) {
if (!pj_stricmp(&value, &pjsip_TRUE_STR) ||
!pj_stricmp(&value, &pjsip_QUOTED_TRUE_STR))
{
chal->stale = 1;
}
} else if (!pj_stricmp(&name, &pjsip_ALGORITHM_STR)) {
chal->algorithm = value;
} else if (!pj_stricmp(&name, &pjsip_QOP_STR)) {
chal->qop = value;
} else {
pjsip_param *p = PJ_POOL_ALLOC_T(pool, pjsip_param);
p->name = name;
p->value = value;
pj_list_insert_before(&chal->other_param, p);
}
/* Eat comma */
if (!pj_scan_is_eof(scanner) && *scanner->curptr == ',')
pj_scan_get_char(scanner);
else
break;
}
}
示例11: PJ_DEF
PJ_DEF(pj_status_t) pjmedia_sdp_transport_cmp( const pj_str_t *t1,
const pj_str_t *t2)
{
static const pj_str_t ID_RTP_AVP = { "RTP/AVP", 7 };
static const pj_str_t ID_RTP_SAVP = { "RTP/SAVP", 8 };
/* Exactly equal? */
if (pj_stricmp(t1, t2) == 0)
return PJ_SUCCESS;
/* Compatible? */
if ((!pj_stricmp(t1, &ID_RTP_AVP) || !pj_stricmp(t1, &ID_RTP_SAVP)) &&
(!pj_stricmp(t2, &ID_RTP_AVP) || !pj_stricmp(t2, &ID_RTP_SAVP)))
return PJ_SUCCESS;
return PJMEDIA_SDP_ETPORTNOTEQUAL;
}
示例12: PJ_DEF
PJ_DEF(pj_xml_attr*) pj_xml_find_attr( pj_xml_node *node, const pj_str_t *name,
const pj_str_t *value)
{
pj_xml_attr *attr = node->attr_head.next;
while (attr != (void*)&node->attr_head) {
if (pj_stricmp(&attr->name, name)==0) {
if (value) {
if (pj_stricmp(&attr->value, value)==0)
return attr;
} else {
return attr;
}
}
attr = attr->next;
}
return NULL;
}
示例13: is_home_domain
/// Utility to determine if this URI belongs to the home domain.
pj_bool_t PJUtils::is_home_domain(const pjsip_uri* uri)
{
if ((PJSIP_URI_SCHEME_IS_SIP(uri)) &&
(pj_stricmp(&((pjsip_sip_uri*)uri)->host, &stack_data.home_domain)==0))
{
return PJ_TRUE;
}
return PJ_FALSE;
}
示例14: get_binding_id
std::string get_binding_id(pjsip_contact_hdr *contact)
{
// Get a suitable binding string from +sip.instance and reg_id parameters
// if they are supplied.
std::string id;
pj_str_t *instance = NULL;
pj_str_t *reg_id = NULL;
pjsip_param *p = contact->other_param.next;
while ((p != NULL) && (p != &contact->other_param))
{
if (pj_stricmp(&p->name, &STR_SIP_INSTANCE) == 0)
{
instance = &p->value;
}
else if (pj_stricmp(&p->name, &STR_REG_ID) == 0)
{
reg_id = &p->value;
}
p = p->next;
}
if (instance != NULL)
{
// The contact a +sip.instance parameters, so form a suitable binding
// string.
id = PJUtils::pj_str_to_string(instance);
id = id.substr(1, id.size() - 2); // Strip quotes
if (reg_id != NULL)
{
id = id + ":" + PJUtils::pj_str_to_string(reg_id);
}
if (PJUtils::is_emergency_registration(contact))
{
id = "sos" + id;
}
}
return id;
}
示例15: PJ_DEF
PJ_DEF(pjdialog_info_dialog*) pjdialog_info_parse(pj_pool_t *pool, char *text, int len)
{
pjdialog_info_dialog *dialog_info = pj_xml_parse(pool, text, len);
if (dialog_info)
{
if (pj_stricmp(&dialog_info->name, &DIALOG_INFO) == 0)
return dialog_info;
}
return NULL;
}