[Kamailio-Users] using "substr()" function from TEXTOPS in "onreply_route" block

Iñaki Baz Castillo ibc at aliax.net
Wed Nov 26 22:25:29 CET 2008


El Miércoles, 26 de Noviembre de 2008, Alex R.S.M escribió:
> Hi,
>
> I was wondering if anyone has used "substr()" function from TEXTOPS in
> "onreply_route" block. This function works fine in "route" and
> "branch_route" blocks. However, it creates duplicate fields (instead of
> substituting) when being used in "onreply_route" blocks.
>
> I need to modify FROM field in "onreply_route" block. As far as I know,
> "uac_replace_from()" function works only in request_route block, so my only
> option is to use "substr()".

"uac_replace_from()" replaces the From downstream cally restores it when a 
reply arrives, before forwarding it upstream (to the caller).
You don't need to use "uac_replace_from()" in onreply_route.

Also, I already realized that "uac_replace_from()" can't be used two times 
during the same transaction since it creates duplicate value, but this occurs 
also when using it twice in request_route block.



-- 
Iñaki Baz Castillo




More information about the sr-users mailing list