MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / contact_parser

Function contact_parser

parser/contact/parse_contact.c:38–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36
37
38static inline int contact_parser(char* _s, int _l, contact_body_t* _c)
39{
40 str tmp;
41
42 tmp.s = _s;
43 tmp.len = _l;
44
45 trim_leading(&tmp);
46
47 if (tmp.len == 0) {
48 LM_ERR("empty body\n");
49 return -1;
50 }
51
52 if (tmp.s[0] == '*') {
53 _c->star = 1;
54 if (tmp.len!=1) {
55 LM_ERR("invalid START Contact header (more than START only)\n");
56 return -2;
57 }
58 } else {
59 if (parse_contacts(&tmp, &(_c->contacts)) < 0) {
60 LM_ERR("failed to parse contacts\n");
61 return -3;
62 }
63 }
64
65 return 0;
66}
67
68
69/*

Callers 1

parse_contactFunction · 0.85

Calls 2

trim_leadingFunction · 0.85
parse_contactsFunction · 0.85

Tested by

no test coverage detected