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

Function parse_contact

parser/contact/parse_contact.c:72–99  ·  view source on GitHub ↗

* Parse contact header field body */

Source from the content-addressed store, hash-verified

70 * Parse contact header field body
71 */
72int parse_contact(struct hdr_field* _h)
73{
74 contact_body_t* b;
75
76 if (_h->parsed != 0) {
77 return 0; /* Already parsed */
78 }
79
80 b = (contact_body_t*)pkg_malloc(sizeof(contact_body_t));
81 if (b == 0) {
82 LM_ERR("no pkg memory left\n");
83 return -1;
84 }
85
86 memset(b, 0, sizeof(contact_body_t));
87
88 if (contact_parser(_h->body.s, _h->body.len, b) < 0) {
89 LM_ERR("failed to parse contact\n");
90 pkg_free(b);
91 set_err_info(OSER_EC_PARSER, OSER_EL_MEDIUM,
92 "error parsing CONTACT headers");
93 set_err_reply(400, "bad headers");
94 return -2;
95 }
96
97 _h->parsed = (void*)b;
98 return 0;
99}
100
101
102/*

Callers 15

pv_get_contact_bodyFunction · 0.85
get_contact_uriFunction · 0.85
get_register_expireFunction · 0.85
allow_registerFunction · 0.85
subs_cback_funcFunction · 0.85
extract_sdialog_infoFunction · 0.85
topo_dlg_replace_contactFunction · 0.85
validate_contact_headerFunction · 0.85
run_reg_tm_cbackFunction · 0.85
b2b_new_dlgFunction · 0.85

Calls 3

contact_parserFunction · 0.85
set_err_infoFunction · 0.85
set_err_replyFunction · 0.85

Tested by

no test coverage detected