| 423 | |
| 424 | |
| 425 | static int w_replace_from(struct sip_msg* msg, str* dsp, str* uri) |
| 426 | { |
| 427 | unsigned flags = (unsigned)context_get_int( |
| 428 | CONTEXT_GLOBAL, current_processing_ctx, uac_replace_flags); |
| 429 | |
| 430 | if (flags & UAC_INUSE_REPLACE_FROM) { |
| 431 | LM_ERR("scripting bug: uac_replace_from() already called!\n"); |
| 432 | return E_SCRIPT; |
| 433 | } |
| 434 | |
| 435 | if (parse_from_header(msg)<0 ) { |
| 436 | LM_ERR("failed to find/parse FROM hdr\n"); |
| 437 | return -1; |
| 438 | } |
| 439 | |
| 440 | LM_DBG("dsp=%p (len=%d) , uri=%p (len=%d)\n", |
| 441 | dsp,dsp?dsp->len:0,uri,uri?uri->len:0); |
| 442 | |
| 443 | if (route_type == REQUEST_ROUTE && !route_stack[route_stack_start]) |
| 444 | context_put_int(CONTEXT_GLOBAL, current_processing_ctx, |
| 445 | uac_replace_flags, (int)(flags|UAC_INUSE_REPLACE_FROM)); |
| 446 | |
| 447 | return (replace_uri(msg, dsp, uri, msg->from, 0)==0)?1:-1; |
| 448 | } |
| 449 | |
| 450 | |
| 451 | static int w_restore_to(struct sip_msg *msg) |
nothing calls this directly
no test coverage detected