[Serusers] Arbitrarily altering the "Contact:" field
Klaus Darilion
klaus.mailinglists at pernau.at
Tue Mar 15 20:32:48 CET 2005
Hi Tavis!
I did similar things when a patched ser to work as outbound proxy (e.g.
like a jasomi peer point). It's a bad hack but it works fine with me.
The regexps are attached (to avoid line breaks in the email).
These regexp works following:
user at domain ==> user_domain at proxyIPaddress
in the reply_route, it works the other way round
user_domain at proxyIPaddress ==> user at domain
To use it as outbound proxy, I also had to modify the save() function to
use user_domain at proxyIPaddress as AOR instead of the real AOR.
regards,
klaus
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
>
>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ser.cfg.txt
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20050315/df7d1791/attachment.txt>
More information about the sr-users
mailing list