[OpenSIPS-Users] TEXTOPS module

Stanisław Pitucha viraptor at gmail.com
Mon Dec 20 15:09:32 CET 2010

On 20/12/10 13:51, Denis Putyato wrote:
> Thank you Bogdan for your answer. Now I understood that apply changes is a bad idea.
> But during process a call I have to make some changes to INVITE message. 
> For example,
> I need to add Remote-Party-ID (RPI) and/or P-Asserted-ID (PAI) and make uac_replace_from(). If I make it for the first time everything fine. 
> But if I need then change these fields (via subst or uac_replace_from() again)(for example, some gateways fails and cannot accepts call, I use use_next_gw() of d_routing module and MUST change callerid information) then my tests show that during, for example, second time call of uac_replace_from() there are two uri in From: header field (as you understand that is wrong), or if I make subst() of RPI or PAI then second header RPI and PAI appear in addition of first headers which I added (or subst) before. 
> And to avoid this I make signaling loop. New INVITE process as a new message with modified early headers, so I can change it again.   

I'm not 100% sure if that will work in your case (never used uac), but
you may be able to do all this by starting transaction early. If you
force t_newtran() early in the script (you probably should anyways), any
modification done to the message after that point should not be present
in the failure route.

So do t_newtran(), get the first gateway, modify as needed - if you
fail, just reapply the changes as if you were working on the original

Unless someone shouts now that it doesn't interact properly with uac
that is ;)


More information about the Users mailing list