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

Function get_contact_uri

modules/tm/dlg.c:242–265  ·  view source on GitHub ↗

* Parse Contact header field body and extract URI * Does not parse headers !! */

Source from the content-addressed store, hash-verified

240 * Does not parse headers !!
241 */
242static inline int get_contact_uri(struct sip_msg* _m, str* _uri)
243{
244 contact_t* c;
245
246 _uri->len = 0;
247
248 if (!_m->contact) return 1;
249
250 if (parse_contact(_m->contact) < 0) {
251 LM_ERR("failed to parse Contact body\n");
252 return -2;
253 }
254
255 c = ((contact_body_t*)_m->contact->parsed)->contacts;
256
257 if (!c) {
258 LM_ERR("Empty body or * contact\n");
259 return -3;
260 }
261
262 _uri->s = c->uri.s;
263 _uri->len = c->uri.len;
264 return 0;
265}
266
267
268/*

Callers 2

response2dlgFunction · 0.70
dlg_confirmed_resp_uacFunction · 0.70

Calls 1

parse_contactFunction · 0.85

Tested by

no test coverage detected