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

Function ospGetTo

modules/osp/sipheader.c:442–462  ·  view source on GitHub ↗

* Get To header * param msg SIP message * param to To header * param bufsize Size of to header buffer * return 0 success, -1 failure */

Source from the content-addressed store, hash-verified

440 * return 0 success, -1 failure
441 */
442int ospGetTo(
443 struct sip_msg* msg,
444 char* to,
445 int bufsize)
446{
447 int result = -1;
448
449 if ((to!= NULL) && (bufsize > 0)) {
450 to[0] = '\0';
451 if (msg->to != NULL) {
452 ospCopyStrToBuffer(&msg->to->body, to, bufsize);
453 result = 0;
454 } else {
455 LM_ERR("failed to find To header\n");
456 }
457 } else {
458 LM_ERR("bad parameters to parse To header\n");
459 }
460
461 return result;
462}
463
464/*
465 * Get user part from P-Asserted-Identity header

Callers 1

ospRequestRoutingFunction · 0.85

Calls 1

ospCopyStrToBufferFunction · 0.85

Tested by

no test coverage detected