[SR-Users] Rewrite contact address on 200 OK?

Alex Balashov abalashov at evaristesys.com
Fri Oct 25 19:04:55 CEST 2019


On Fri, Oct 25, 2019 at 06:47:38PM +0300, Oded Arbel wrote:

> Thanks for the reply. I haven't used add_contact_alias/handle_ruri_alias
> before - how would I make use of them?
> 
> Should I call add_contact_alias() in the 200 reply route? And if so - when
> do I call handle_ruri_alias()?

Try set_contact_alias() (it might make more sense than
add_contact_alias() here, though they are substantially the same) in the
onreply_route handling both the 18x and the 200 OK, and call
handle_ruri_alias() in the section of the config with loose_route()
route and friends, which handles in-dialog request routing. 

One nice thing about handle_ruri_alias() is it silently returns if there
is no ;alias URI parameter, so you can call it without a bunch of
conditional logic around whether it is appropriate to call it.

-- Alex

-- 
Alex Balashov | Principal | Evariste Systems LLC

Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free) 
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/



More information about the sr-users mailing list