<div dir="ltr">Hi forum,<div><br><div>This is the scenario:</div><div><br></div><div>VM <- Kamailio -> SP1 ----- SP2 ---- PhoneA (john)</div><div>PhoneB</div><div><br></div><div>PhoneA is configured in <b>dbaliases</b> table:</div><div>alias_username, alias_domain, username, domain</div><div>11111111, <a href="http://sp1.com">sp1.com</a>, john, <a href="http://sp2.com">sp2.com</a></div><div><br></div><div>When PhoneB dials 1111111, Kamailio converts <a href="mailto:111111@sp1.com">111111@sp1.com</a> to <a href="mailto:john@sp2.com">john@sp2.com</a></div><div>Now I need to provide VM services to PhoneA. (Opposite direction)</div><div>PhoneA calls voicemail but the calling number is <a href="mailto:john@sp2.com">john@sp2.com</a><br></div><div>I need to have SP1 use the <a href="mailto:11111111@sp1.com">11111111@sp1.com</a> format<br></div><div><br></div><div>How can I overwrite the From?</div><div><br></div><div>Pseudo algorithm</div><div>------------------------</div><div><br></div><div>If destination is VM and from domain ($fU) is <a href="http://sp2.com">sp2.com</a>: </div><div>   Find user URI:  ( In this case john extracted from <a href="mailto:john@sp2.com">john@sp2.com</a> in dbaliases)</div><div>      If user is found:</div><div>        rewrite From URI: </div><div>            use alias_username@alias_domain</div><div><br></div><div>I'm using default kamailio.cfg and calls successfully are forwarded to VM</div><div><br></div><div>Thank you</div><div><br></div><div><br></div><div><br></div><div><br></div></div></div>