<div dir="ltr">Hello friends<br>Help me to understand. In request_route i make replace from and to fields. <div>After an unsuccessful attempt to invite, I try to direct the call to another place and again I need to replace the from and to fields. But instead of replacing, new values are simply added<br></div><div><br></div><div>route {</div><div>    ...</div><div>    route(rewrite_header);</div><div>    ...</div><div>}</div><div>failure_route[missed_call] {<br></div><div>    setflag(need_uac_restore);</div><div>    ...</div><div>    route(rewrite_header);</div><div>}</div><div>route[rewrite_header] {<br></div><div>    if (isflagset(need_uac_restore)) {<br>        xlog("L_INFO", "[ $ci ] - restore from and to fields\n");<br>        uac_restore_from();<br>        uac_restore_to();<br>    }<br></div><div>     uac_replace_from("","sip:$avp(fromuser)@$avp(fromdomain)");</div><div>     uac_replace_to("","sip:$avp(touser)@$avp(todomain)");</div><div>}</div><div><br></div><div>in the end I get such fields<br></div><div><br></div><div>From:  <<a href="mailto:sip%3A2220222@10.10.10.10">sip:2220222@10.10.10.10</a>><sip:5274274@sipofon.loc>;tag=fe654d87-7565-408f-9925-98a5bac99e1c<br>To: <<a href="mailto:sip%3A3865071@10.10.10.10">sip:3865071@10.10.10.10</a>><sip:3865071@sipofon.loc><br></div><div><br></div><div>it simply appends the new value to the old and does not replace it<br></div><div>changing replace modes in uac module does not change behavior<br></div><div>in debug log i see this</div><div><br></div><div>DBG:uac:replace_uri: uri to replace [<<a href="mailto:sip%3A2220222@10.23.100.40">sip:2220222@10.23.100.40</a>>], replacement is [<<a href="mailto:sip%3A79385274274@multifon.ru">sip:79385274274@multifon.ru</a>>]<br>DBG:dialog:new_dlg_val: inserting <739823>=<<sip:5274274@sipofon.loc>><br>DBG:dialog:store_dlg_value_unsafe: var found-> <<<a href="mailto:sip%3A2220222@10.10.10.10">sip:2220222@10.10.10.10</a>>>!<br>DBG:uac:replace_uri: uri to replace [<<a href="mailto:sip%3A3865071@10.100.100.100">sip:3865071@10.100.100.100</a>>], replacement is [<sip:3865071@sipofon.loc>]<br>DBG:dialog:new_dlg_val: inserting <739824>=<<sip:3865071@sipofon.loc>><br>DBG:dialog:store_dlg_value_unsafe: var found-> <<<a href="mailto:sip%3A3865071@10.10.10.10">sip:3865071@10.10.10.10</a>>>!<br></div><div><br></div><div>10.23.100.40 - call initiator</div><div>10.10.10.10 - where should the call go first<br></div><div>10.100.100.100 - opensips<br></div><div>sipofon.loc - where should the call go after failure_route has worked<br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div>