[OpenSER-Users] Fix up source address.

Peter P GMX Prometheus001 at gmx.net
Thu Jan 10 23:30:35 CET 2008


I have a similar problem, but this regexp solution caused a strange 
behaviour

The original Contact Address, which shall replaced is:
sip:49xxxxxx1200 at 10.10.1.51:5060
with $var(my_ip)=33.222.111.0 (Example)

subst('/(Contact:.+@)[0-9.]+.*>/\1$var(my_ip)>/');
leads to
<sip:49xxxxxx1200 at 10.10.1.51:506049xxxxxx1200 at 33.222.111.0>
So the secod address is simply added.


I tried another way:
replace_all("sip:49xxxxxx1200 at 10.10.1.51>", 
"sip:49xxxxxx1200 at 33.222.111.0>");
leads to
Contact: <sip:49xxxxxx1200 at 33.222.111.0>sip:49xxxxxx1200 at 10.10.1.51:5060

Best regards
Peter
Robert Dyck schrieb:
> I assume you are referring to a SIP message and not its IP wrapper. And I also 
> assume you are using fix_nated_contact() from nathelper. This function is 
> working as it was designed. I quote from the documentation "Rewrites Contact 
> HF to contain request's source address:port".
>
> I believe nathelper was built to aid service providers who might receive SIP 
> messages with unroutable contacts.
>
> In the past I have used a patched version of nathlper that let you specify the 
> address you wanted in the Contact. I did not write the patch and I am not a 
> programmer so I did not want to build a new patch for each new version of 
> openser. I finally settled for a textops equivalent. $var(my_ip) is set 
> elsewhere in the script.
>
> subst('/(Contact:.+@)[0-9.]+.*>/\1$var(my_ip)>/');
>
> On Friday 28 December 2007, Alex Balashov wrote:
>   
>> Greetings,
>>
>> I have a strange problem using OpenSER 1.3.x with nathelper.
>>
>> Two ethernet interfaces:
>>
>> eth0 = 192.168.0.0/24
>> eth1 = outside.ip/29
>>
>> For some reason, no matter what I do to mangle the requests with
>> nathelper's functions, the packet is *always* sent out of eth1 with
>> the *source address* of the machine's eth0.  Obviously, the response
>> from the far-end SIP peer never gets back.
>>
>> The packet does physically go over eth1, I know that much from packet
>> captures.  I don't even see how this is possible;  when OpenSER issues
>> a packet, shouldn't it originate according to the machine's routing
>> table, take the most specific route, and consequently, adopt the right
>> source address?
>>
>> What gives?
>>
>> I have OpenSER 'listening' on both interfaces, and have tried both on and
>> off with this setting.
>>
>> Thanks,
>>
>> --
>> Alex Balashov
>> Evariste Systems
>> Web    : http://www.evaristesys.com/
>> Tel    : +1-678-954-0670
>> Direct : +1-678-954-0671
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.openser.org
>> http://lists.openser.org/cgi-bin/mailman/listinfo/users
>>     
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.openser.org
> http://lists.openser.org/cgi-bin/mailman/listinfo/users
>
>   




More information about the sr-users mailing list