Пример #1
0
int parse_sipifmatch(struct hdr_field* _h)
{
	str *e;

	DBG("parse_sipifmatch() called\n");

        if (_h->parsed != 0) {
                return 0;
        }

        e = (str*)pkg_malloc(sizeof(str));
        if (e == 0) {
                LOG(L_ERR, "parse_ifsipmatch(): No memory left\n");
                return -1;
        }

        memset(e, 0, sizeof(str));

        if (etag_parser(_h->body.s, _h->body.len, e) < 0) {
                LOG(L_ERR, "parse_sipifmatch(): Error in tag_parser\n");
                pkg_free(e);
                return -2;
        }

        _h->parsed = (void*)e;
        return 0;
}
Пример #2
0
int
parse_sipifmatch(struct hdr_field* _h)
{
	str *e;

	LM_DBG("called\n");

        if (_h->parsed != 0) {
                return 0;
        }

        e = (str*)pkg_malloc(sizeof(str));
        if (e == 0) {
                LM_ERR("no pkg memory left\n");
                return -1;
        }

        memset(e, 0, sizeof(str));

        if (etag_parser(_h->body.s, _h->body.len, e) < 0) {
                LM_ERR("error in etag_parser\n");
                pkg_free(e);
				set_err_info(OSER_EC_PARSER, OSER_EL_MEDIUM,
					"error parsing etag headers");
				set_err_reply(400, "bad headers");
                return -2;
        }

        _h->parsed = (void*)e;
        return 0;
}
Пример #3
0
int parse_sipifmatch(struct hdr_field* _h)
{
	str *e;

	LM_DBG("parse sip-if-match called\n");

	if (_h->parsed != 0) {
		return 0;
	}

	e = (str*)pkg_malloc(sizeof(str));
	if (e == 0) {
		LM_ERR("No memory left\n");
		return -1;
	}

	memset(e, 0, sizeof(str));

	if (etag_parser(_h->body.s, _h->body.len, e) < 0) {
		LM_ERR("Error in etag parser\n");
		pkg_free(e);
		return -2;
	}

	_h->parsed = (void*)e;
	return 0;
}