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

Function get_contact_uri

modules/tm/t_msgbuilder.c:418–439  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

416 * Does not parse headers !
417 */
418static inline int get_contact_uri(struct sip_msg* msg, str* uri)
419{
420 contact_t* c;
421
422 uri->len = 0;
423 if (!msg->contact) return 1;
424
425 if (parse_contact(msg->contact) < 0) {
426 LM_ERR("failed to parse Contact body\n");
427 return -1;
428 }
429
430 c = ((contact_body_t*)msg->contact->parsed)->contacts;
431
432 if (!c) {
433 LM_ERR("body or * contact\n");
434 return -2;
435 }
436
437 *uri = c->uri;
438 return 0;
439}
440
441
442

Callers 1

build_dlg_ackFunction · 0.70

Calls 1

parse_contactFunction · 0.85

Tested by

no test coverage detected