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

Function w_replace_to

modules/uac/uac.c:463–484  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

461
462
463static int w_replace_to(struct sip_msg* msg, str *dsp, str *uri)
464{
465 unsigned flags = (unsigned)context_get_int(
466 CONTEXT_GLOBAL, current_processing_ctx, uac_replace_flags);
467
468 if (flags & UAC_INUSE_REPLACE_TO) {
469 LM_ERR("scripting bug: uac_replace_to() already called!\n");
470 return E_SCRIPT;
471 }
472
473 /* parse TO hdr */
474 if ( msg->to==0 && (parse_headers(msg,HDR_TO_F,0)!=0 || msg->to==0) ) {
475 LM_ERR("failed to parse TO hdr\n");
476 return -1;
477 }
478
479 if (route_type == REQUEST_ROUTE && !route_stack[route_stack_start])
480 context_put_int(CONTEXT_GLOBAL, current_processing_ctx,
481 uac_replace_flags, (int)(flags|UAC_INUSE_REPLACE_TO));
482
483 return (replace_uri(msg, dsp, uri, msg->to, 1)==0)?1:-1;
484}
485
486
487

Callers

nothing calls this directly

Calls 3

context_get_intFunction · 0.85
context_put_intFunction · 0.85
replace_uriFunction · 0.85

Tested by

no test coverage detected