[Serusers] Arbitrarily altering the "Contact:" field

reticent tavis.lists at galaxytelecom.net
Tue Mar 15 21:14:10 CET 2005


Sorry, forgot to mention i'm running the latest CVS build as of March 7

reticent wrote:

> I've got a situation where i need to replicate registrations to an 
> outside proxy, a simple replicate wont work because i need the 
> registration on the outside proxy to reference the SER proxy and not 
> the client directly.
>
> The one requirement is that i know (in a scripting context) what the 
> username of the registration is so i can construct a Contact that 
> contains it.
>
> The only function i've found that could do this is the subst(///) 
> function in the textops.so module, however its acting very strangely.
>
> Ex.
>
> subst('/^Contact:.*sip:([0-9]+)@.*$/Contact: <sip:\1@!OUTSIDE_PROXY!>/');
>
> Seems to match properly, but inspecting the packet as its routed out 
> (using ngrep) shows the following contact field
>
> "<sip:200010001000@!OUTSIDE_PROXY!>sip:200010001000@!ORIGINAL_IP!:5070."
>
> My understanding is that "sip:200010001000@!ORIGINAL_IP!:5070" should 
> have been replaced with <sip:200010001000@!OUTSIDE_PROXY!> instead of 
> being prepended.
>
> Perhaps there is a module that provides a function that would allow me 
> to manipulate the contact more easily (i'm aware that the regex in the 
> subst in inadequate and would not match the full range of RFC3261 
> valid Contact strings, i'm just testing right now)
>
> Would anyone be able to offer any advice?
>
> tavis
>
> _______________________________________________
> Serusers mailing list
> serusers at lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serusers
>
>





More information about the sr-users mailing list